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>
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;