diff options
Diffstat (limited to 'patches/linux-3.12/0201-usb-musb-gadget-stay-IDLE-without-gadget-driver.patch')
-rw-r--r-- | patches/linux-3.12/0201-usb-musb-gadget-stay-IDLE-without-gadget-driver.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/patches/linux-3.12/0201-usb-musb-gadget-stay-IDLE-without-gadget-driver.patch b/patches/linux-3.12/0201-usb-musb-gadget-stay-IDLE-without-gadget-driver.patch new file mode 100644 index 0000000..6c36895 --- /dev/null +++ b/patches/linux-3.12/0201-usb-musb-gadget-stay-IDLE-without-gadget-driver.patch @@ -0,0 +1,56 @@ +From: Markus Pargmann <mpa@pengutronix.de> +Date: Mon, 14 Oct 2013 11:21:03 +0200 +Subject: [PATCH] usb: musb: gadget, stay IDLE without gadget driver + +If there is no gadget driver musb should stay in B_IDLE state. + +Signed-off-by: Markus Pargmann <mpa@pengutronix.de> +--- + drivers/usb/musb/musb_core.c | 3 --- + drivers/usb/musb/musb_gadget.c | 14 ++++++++++++-- + 2 files changed, 12 insertions(+), 5 deletions(-) + +diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c +index cd70cc8..0c59481 100644 +--- a/drivers/usb/musb/musb_core.c ++++ b/drivers/usb/musb/musb_core.c +@@ -831,12 +831,9 @@ b_host: + case OTG_STATE_B_WAIT_ACON: + dev_dbg(musb->controller, "HNP: RESET (%s), to b_peripheral\n", + usb_otg_state_string(musb->xceiv->state)); +- musb->xceiv->state = OTG_STATE_B_PERIPHERAL; + musb_g_reset(musb); + break; + case OTG_STATE_B_IDLE: +- musb->xceiv->state = OTG_STATE_B_PERIPHERAL; +- /* FALLTHROUGH */ + case OTG_STATE_B_PERIPHERAL: + musb_g_reset(musb); + break; +diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c +index 3671898..4d3da1a 100644 +--- a/drivers/usb/musb/musb_gadget.c ++++ b/drivers/usb/musb/musb_gadget.c +@@ -2116,10 +2116,20 @@ __acquires(musb->lock) + * or else after HNP, as A-Device + */ + if (devctl & MUSB_DEVCTL_BDEVICE) { +- musb->xceiv->state = OTG_STATE_B_PERIPHERAL; ++ if (!musb->gadget_driver) { ++ musb->is_active = 0; ++ musb->xceiv->state = OTG_STATE_B_IDLE; ++ } else { ++ musb->xceiv->state = OTG_STATE_B_PERIPHERAL; ++ } + musb->g.is_a_peripheral = 0; + } else { +- musb->xceiv->state = OTG_STATE_A_PERIPHERAL; ++ if (!musb->gadget_driver) { ++ musb->is_active = 0; ++ musb->xceiv->state = OTG_STATE_A_IDLE; ++ } else { ++ musb->xceiv->state = OTG_STATE_A_PERIPHERAL; ++ } + musb->g.is_a_peripheral = 1; + } + |