diff options
author | Bin Liu <b-liu@ti.com> | 2013-09-17 12:43:13 -0500 |
---|---|---|
committer | Sebastian Reichel <sre@debian.org> | 2013-10-12 23:14:57 +0200 |
commit | 38d43d1f079577fa3fb4b781d3648f3f7d78170e (patch) | |
tree | 3ef46b1258103a611225a4fa24c1f9df551970e6 | |
parent | 7706438c01d6160a9b96900931ac8d8d630110c6 (diff) | |
download | linux-38d43d1f079577fa3fb4b781d3648f3f7d78170e.tar.bz2 |
usb: musb: fix otg default state
Right after the musb_hdrc driver is loaded, the otg default state
is a_idle, and Mode=Host, which are set by musb_host_setup().
This causes the following kernel message during musb gadget
enumeration.
CAUTION: musb: Babble Interrupt Occurred
This patch sets the otg default state to b_idle, and its Mode to
Peripheral.
It has been validated on TI AM335x GP EVM USB0 port with g_zero.
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/musb/musb_gadget.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 9a08679d204d..58c029f1e74c 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1790,6 +1790,10 @@ int musb_gadget_setup(struct musb *musb) musb->g.max_speed = USB_SPEED_HIGH; musb->g.speed = USB_SPEED_UNKNOWN; + MUSB_DEV_MODE(musb); + musb->xceiv->otg->default_a = 0; + musb->xceiv->state = OTG_STATE_B_IDLE; + /* this "gadget" abstracts/virtualizes the controller */ musb->g.name = musb_driver_name; musb->g.is_otg = 1; |