diff options
Diffstat (limited to 'drivers/usb/musb/musb_virthub.c')
-rw-r--r-- | drivers/usb/musb/musb_virthub.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c index e2d2d8c9891b..b072420e44f5 100644 --- a/drivers/usb/musb/musb_virthub.c +++ b/drivers/usb/musb/musb_virthub.c | |||
@@ -69,9 +69,10 @@ void musb_host_finish_resume(struct work_struct *work) | |||
69 | musb->port1_status |= USB_PORT_STAT_C_SUSPEND << 16; | 69 | musb->port1_status |= USB_PORT_STAT_C_SUSPEND << 16; |
70 | usb_hcd_poll_rh_status(musb->hcd); | 70 | usb_hcd_poll_rh_status(musb->hcd); |
71 | /* NOTE: it might really be A_WAIT_BCON ... */ | 71 | /* NOTE: it might really be A_WAIT_BCON ... */ |
72 | musb->xceiv->state = OTG_STATE_A_HOST; | 72 | musb->xceiv->otg->state = OTG_STATE_A_HOST; |
73 | 73 | ||
74 | spin_unlock_irqrestore(&musb->lock, flags); | 74 | spin_unlock_irqrestore(&musb->lock, flags); |
75 | musb_host_resume_root_hub(musb); | ||
75 | } | 76 | } |
76 | 77 | ||
77 | void musb_port_suspend(struct musb *musb, bool do_suspend) | 78 | void musb_port_suspend(struct musb *musb, bool do_suspend) |
@@ -107,9 +108,9 @@ void musb_port_suspend(struct musb *musb, bool do_suspend) | |||
107 | dev_dbg(musb->controller, "Root port suspended, power %02x\n", power); | 108 | dev_dbg(musb->controller, "Root port suspended, power %02x\n", power); |
108 | 109 | ||
109 | musb->port1_status |= USB_PORT_STAT_SUSPEND; | 110 | musb->port1_status |= USB_PORT_STAT_SUSPEND; |
110 | switch (musb->xceiv->state) { | 111 | switch (musb->xceiv->otg->state) { |
111 | case OTG_STATE_A_HOST: | 112 | case OTG_STATE_A_HOST: |
112 | musb->xceiv->state = OTG_STATE_A_SUSPEND; | 113 | musb->xceiv->otg->state = OTG_STATE_A_SUSPEND; |
113 | musb->is_active = otg->host->b_hnp_enable; | 114 | musb->is_active = otg->host->b_hnp_enable; |
114 | if (musb->is_active) | 115 | if (musb->is_active) |
115 | mod_timer(&musb->otg_timer, jiffies | 116 | mod_timer(&musb->otg_timer, jiffies |
@@ -118,13 +119,13 @@ void musb_port_suspend(struct musb *musb, bool do_suspend) | |||
118 | musb_platform_try_idle(musb, 0); | 119 | musb_platform_try_idle(musb, 0); |
119 | break; | 120 | break; |
120 | case OTG_STATE_B_HOST: | 121 | case OTG_STATE_B_HOST: |
121 | musb->xceiv->state = OTG_STATE_B_WAIT_ACON; | 122 | musb->xceiv->otg->state = OTG_STATE_B_WAIT_ACON; |
122 | musb->is_active = otg->host->b_hnp_enable; | 123 | musb->is_active = otg->host->b_hnp_enable; |
123 | musb_platform_try_idle(musb, 0); | 124 | musb_platform_try_idle(musb, 0); |
124 | break; | 125 | break; |
125 | default: | 126 | default: |
126 | dev_dbg(musb->controller, "bogus rh suspend? %s\n", | 127 | dev_dbg(musb->controller, "bogus rh suspend? %s\n", |
127 | usb_otg_state_string(musb->xceiv->state)); | 128 | usb_otg_state_string(musb->xceiv->otg->state)); |
128 | } | 129 | } |
129 | } else if (power & MUSB_POWER_SUSPENDM) { | 130 | } else if (power & MUSB_POWER_SUSPENDM) { |
130 | power &= ~MUSB_POWER_SUSPENDM; | 131 | power &= ~MUSB_POWER_SUSPENDM; |
@@ -145,7 +146,7 @@ void musb_port_reset(struct musb *musb, bool do_reset) | |||
145 | u8 power; | 146 | u8 power; |
146 | void __iomem *mbase = musb->mregs; | 147 | void __iomem *mbase = musb->mregs; |
147 | 148 | ||
148 | if (musb->xceiv->state == OTG_STATE_B_IDLE) { | 149 | if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) { |
149 | dev_dbg(musb->controller, "HNP: Returning from HNP; no hub reset from b_idle\n"); | 150 | dev_dbg(musb->controller, "HNP: Returning from HNP; no hub reset from b_idle\n"); |
150 | musb->port1_status &= ~USB_PORT_STAT_RESET; | 151 | musb->port1_status &= ~USB_PORT_STAT_RESET; |
151 | return; | 152 | return; |
@@ -224,24 +225,24 @@ void musb_root_disconnect(struct musb *musb) | |||
224 | usb_hcd_poll_rh_status(musb->hcd); | 225 | usb_hcd_poll_rh_status(musb->hcd); |
225 | musb->is_active = 0; | 226 | musb->is_active = 0; |
226 | 227 | ||
227 | switch (musb->xceiv->state) { | 228 | switch (musb->xceiv->otg->state) { |
228 | case OTG_STATE_A_SUSPEND: | 229 | case OTG_STATE_A_SUSPEND: |
229 | if (otg->host->b_hnp_enable) { | 230 | if (otg->host->b_hnp_enable) { |
230 | musb->xceiv->state = OTG_STATE_A_PERIPHERAL; | 231 | musb->xceiv->otg->state = OTG_STATE_A_PERIPHERAL; |
231 | musb->g.is_a_peripheral = 1; | 232 | musb->g.is_a_peripheral = 1; |
232 | break; | 233 | break; |
233 | } | 234 | } |
234 | /* FALLTHROUGH */ | 235 | /* FALLTHROUGH */ |
235 | case OTG_STATE_A_HOST: | 236 | case OTG_STATE_A_HOST: |
236 | musb->xceiv->state = OTG_STATE_A_WAIT_BCON; | 237 | musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON; |
237 | musb->is_active = 0; | 238 | musb->is_active = 0; |
238 | break; | 239 | break; |
239 | case OTG_STATE_A_WAIT_VFALL: | 240 | case OTG_STATE_A_WAIT_VFALL: |
240 | musb->xceiv->state = OTG_STATE_B_IDLE; | 241 | musb->xceiv->otg->state = OTG_STATE_B_IDLE; |
241 | break; | 242 | break; |
242 | default: | 243 | default: |
243 | dev_dbg(musb->controller, "host disconnect (%s)\n", | 244 | dev_dbg(musb->controller, "host disconnect (%s)\n", |
244 | usb_otg_state_string(musb->xceiv->state)); | 245 | usb_otg_state_string(musb->xceiv->otg->state)); |
245 | } | 246 | } |
246 | } | 247 | } |
247 | 248 | ||