diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-04-02 13:16:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:41 -0400 |
commit | 1de00dae8036dfee44ebea2c38f942fb6072e0b7 (patch) | |
tree | 35d384cb2fe51ac384da554042450e7d24d190b0 /drivers/usb/musb/musb_virthub.c | |
parent | f7f9d63eac12b345d6243d1d608b7944a05be921 (diff) |
musb: make initial HNP roleswitch work (v2)
Minor HNP bugfixes, so the initial role switch works:
- A-Device:
* disconnect-during-suspend enters A_PERIPHERAL state
* kill OTG timer after reset as A_PERIPHERAL ...
* ... and also pass that reset to the gadget
* once HNP succeeds, clear the "ignore_disconnect" flag
* from A_PERIPHERAL, disconnect transitions to A_WAIT_BCON
- B-Device:
* kill OTG timer on entry to B_HOST state (HNP succeeded)
* once HNP succeeds, clear "ignore_disconnect" flag
* kick the root hub only _after_ the state is adjusted
Other state transitions are left alone. Notably, exit paths from
the "roles have switched" state ... A_PERIPHERAL handling of that
stays seriously broken.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/musb_virthub.c')
-rw-r--r-- | drivers/usb/musb/musb_virthub.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c index d7e1bc44f00..c85a82a41d5 100644 --- a/drivers/usb/musb/musb_virthub.c +++ b/drivers/usb/musb/musb_virthub.c | |||
@@ -187,8 +187,17 @@ void musb_root_disconnect(struct musb *musb) | |||
187 | musb->is_active = 0; | 187 | musb->is_active = 0; |
188 | 188 | ||
189 | switch (musb->xceiv->state) { | 189 | switch (musb->xceiv->state) { |
190 | case OTG_STATE_A_HOST: | ||
191 | case OTG_STATE_A_SUSPEND: | 190 | case OTG_STATE_A_SUSPEND: |
191 | #ifdef CONFIG_USB_MUSB_OTG | ||
192 | if (is_otg_enabled(musb) | ||
193 | && musb->xceiv->host->b_hnp_enable) { | ||
194 | musb->xceiv->state = OTG_STATE_A_PERIPHERAL; | ||
195 | musb->g.is_a_peripheral = 1; | ||
196 | break; | ||
197 | } | ||
198 | #endif | ||
199 | /* FALLTHROUGH */ | ||
200 | case OTG_STATE_A_HOST: | ||
192 | musb->xceiv->state = OTG_STATE_A_WAIT_BCON; | 201 | musb->xceiv->state = OTG_STATE_A_WAIT_BCON; |
193 | musb->is_active = 0; | 202 | musb->is_active = 0; |
194 | break; | 203 | break; |