]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00261037-1: usb: usb host works abnormal after unload gadget module
authorPeter Chen <peter.chen@freescale.com>
Thu, 2 May 2013 01:04:18 +0000 (09:04 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:14:01 +0000 (14:14 +0200)
If there is usb device on the OTG port when controller works
at host mode, and at this time, we unload gadget module, the
usbcmd.rs will be cleared, it is unexpected behavior.

When the controller works at one mode(eg, host mode), the register
should not be written by other mode driver (eg, devcie driver).
The OTG driver does not consider this situation, and current i.mx
FSL OTG driver does not support fully OTG function, so we remove
the caller at fsl_otg_set_peripheral which will touch controller
register.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
drivers/usb/otg/fsl_otg.c

index 9fd3c87babfb9220bd939d2a485cb9f48c917ed1..00bd2e6095250cbac590ca8e5c716698df6ebaa4 100755 (executable)
@@ -690,9 +690,16 @@ static int fsl_otg_set_peripheral(struct otg_transceiver *otg_p,
                return -ENODEV;
 
        if (!gadget) {
-               if (!otg_dev->otg.default_a)
+               /*
+                * At i.mx platform, we still not implement fully
+                * OTG.
+                */
+               /*
+               if (!otg_dev->otg.default_a) {
                        otg_p->gadget->ops->vbus_draw(otg_p->gadget, 0);
-               usb_gadget_vbus_disconnect(otg_dev->otg.gadget);
+                       usb_gadget_vbus_disconnect(otg_dev->otg.gadget);
+               }
+               */
                otg_dev->otg.gadget = 0;
                otg_dev->fsm.b_bus_req = 0;
                pdata->port_enables = 0;