aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorApelete Seketeli <apelete@seketeli.net>2013-11-19 17:18:20 -0500
committerFelipe Balbi <balbi@ti.com>2013-11-25 11:25:58 -0500
commitfd3923a9904f34d5472134358d87f454a288fc45 (patch)
tree161126dd6ad9c85c9f80a7c62405077f45f61bfe /drivers/usb/musb
parentb144e4ab1ef130e8bf30bcd3e529b7f35112c503 (diff)
usb: fix musb gadget to enable OTG mode conditionally
The musb driver is usable in host, gadget or dual role mode depending on the kernel configuration. However, the musb gadget part of the driver is enabling OTG mode whether the driver is built for dual role or gadget only mode. This induces a bug for gadget only USB device controllers where the kernel tries to use Host Negotiation Protocol with such controllers, which causes a panic. This behaviour is now fixed by enabling OTG mode only when musb driver is built for dual role mode. Signed-off-by: Apelete Seketeli <apelete@seketeli.net> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_gadget.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index d2d3a173b315..32fb057c03f5 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1796,7 +1796,11 @@ int musb_gadget_setup(struct musb *musb)
1796 1796
1797 /* this "gadget" abstracts/virtualizes the controller */ 1797 /* this "gadget" abstracts/virtualizes the controller */
1798 musb->g.name = musb_driver_name; 1798 musb->g.name = musb_driver_name;
1799#if IS_ENABLED(CONFIG_USB_MUSB_DUAL_ROLE)
1799 musb->g.is_otg = 1; 1800 musb->g.is_otg = 1;
1801#elif IS_ENABLED(CONFIG_USB_MUSB_GADGET)
1802 musb->g.is_otg = 0;
1803#endif
1800 1804
1801 musb_g_init_endpoints(musb); 1805 musb_g_init_endpoints(musb);
1802 1806