MLK-16682 usb: cdns3: gadget: delete useless is_iso_flag
authorPeter Chen <peter.chen@nxp.com>
Mon, 23 Oct 2017 08:53:52 +0000 (16:53 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:39:09 +0000 (15:39 -0500)
Since the runtime endpoint type is decided by device descriptors,
we delete useless is_iso_flag which is decided during the initialization.
It also fixed a bug the max_packet_size is determined wrongly for
high/full speed connection.

BuildInfo:
- SCFW 8dcff26, IMX-MKIMAGE ea027c4b, ATF
- U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g6dc7b0f

Acked-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/cdns3/gadget.c
drivers/usb/cdns3/gadget.h

index 673d3b9..dd6984b 100644 (file)
@@ -1357,13 +1357,13 @@ static void cdns_ep_config(struct usb_ss_endpoint *usb_ss_ep)
                break;
 
        case USB_SPEED_FULL:
-               max_packet_size = (usb_ss_ep->is_iso_flag ?
+               max_packet_size = (is_iso_ep ?
                        ENDPOINT_MAX_PACKET_SIZE_1023 :
                        ENDPOINT_MAX_PACKET_SIZE_64);
                break;
 
        case USB_SPEED_HIGH:
-               max_packet_size = (usb_ss_ep->is_iso_flag ?
+               max_packet_size = (is_iso_ep ?
                        ENDPOINT_MAX_PACKET_SIZE_1024 :
                        ENDPOINT_MAX_PACKET_SIZE_512);
                break;
@@ -1976,10 +1976,8 @@ static int usb_ss_init_ep(struct usb_ss_dev *usb_ss)
                        usb_ss_ep->endpoint.caps.dir_out = 1;
 
                /* check endpoint type */
-               if (iso_ep_reg & (1uL << ep_reg_pos)) {
+               if (iso_ep_reg & (1uL << ep_reg_pos))
                        usb_ss_ep->endpoint.caps.type_iso = 1;
-                       usb_ss_ep->is_iso_flag = 1;
-               }
 
                if (bulk_ep_reg & (1uL << ep_reg_pos)) {
                        usb_ss_ep->endpoint.caps.type_bulk = 1;
index 136fd6e..a1363cd 100644 (file)
@@ -168,7 +168,6 @@ struct usb_ss_endpoint {
        char name[20];
        int hw_pending_flag;
        int stalled_flag;
-       int is_iso_flag;
        int wedge_flag;
        void *cpu_addr;
        dma_addr_t dma_addr;