35 #include <linux/module.h>
36 #include <linux/kernel.h>
37 #include <linux/sched.h>
38 #include <linux/errno.h>
40 #include <linux/time.h>
43 #include <asm/unaligned.h>
48 static void musb_port_suspend(
struct musb *
musb,
bool do_suspend)
81 switch (musb->
xceiv->state) {
89 musb_platform_try_idle(musb, 0);
94 musb_platform_try_idle(musb, 0);
100 }
else if (power & MUSB_POWER_SUSPENDM) {
101 power &= ~MUSB_POWER_SUSPENDM;
113 static void musb_port_reset(
struct musb *musb,
bool do_reset)
119 dev_dbg(musb->
controller,
"HNP: Returning from HNP; no hub reset from b_idle\n");
144 power & ~MUSB_POWER_RESUME);
189 switch (musb->
xceiv->state) {
191 if (otg->
host->b_hnp_enable) {
193 musb->
g.is_a_peripheral = 1;
216 struct musb *musb = hcd_to_musb(hcd);
235 struct musb *musb = hcd_to_musb(hcd);
242 if (
unlikely(!HCD_HW_ACCESSIBLE(hcd))) {
243 spin_unlock_irqrestore(&musb->
lock, flags);
252 case ClearHubFeature:
262 case ClearPortFeature:
263 if ((wIndex & 0xff) != 1)
270 musb_port_suspend(musb,
false);
273 if (!hcd->self.is_b_host)
274 musb_platform_set_vbus(musb, 0);
288 case GetHubDescriptor:
318 musb_port_reset(musb,
false);
326 power &= ~MUSB_POWER_RESUME;
354 if ((wIndex & 0xff) != 1)
369 if (!hcd->self.is_b_host)
373 musb_port_reset(musb,
true);
376 musb_port_suspend(musb,
true);
430 spin_unlock_irqrestore(&musb->
lock, flags);