]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/musb/musb_virthub.c
usb: move the OTG state from the USB PHY to the OTG structure
[karo-tx-linux.git] / drivers / usb / musb / musb_virthub.c
index e2d2d8c9891bc1f7a4cf5f8a16048d58a3d4c630..a133bd8c5dc7f310fbcdc90d1f6adce0e28b068a 100644 (file)
@@ -69,7 +69,7 @@ void musb_host_finish_resume(struct work_struct *work)
        musb->port1_status |= USB_PORT_STAT_C_SUSPEND << 16;
        usb_hcd_poll_rh_status(musb->hcd);
        /* NOTE: it might really be A_WAIT_BCON ... */
-       musb->xceiv->state = OTG_STATE_A_HOST;
+       musb->xceiv->otg->state = OTG_STATE_A_HOST;
 
        spin_unlock_irqrestore(&musb->lock, flags);
 }
@@ -107,9 +107,9 @@ void musb_port_suspend(struct musb *musb, bool do_suspend)
                dev_dbg(musb->controller, "Root port suspended, power %02x\n", power);
 
                musb->port1_status |= USB_PORT_STAT_SUSPEND;
-               switch (musb->xceiv->state) {
+               switch (musb->xceiv->otg->state) {
                case OTG_STATE_A_HOST:
-                       musb->xceiv->state = OTG_STATE_A_SUSPEND;
+                       musb->xceiv->otg->state = OTG_STATE_A_SUSPEND;
                        musb->is_active = otg->host->b_hnp_enable;
                        if (musb->is_active)
                                mod_timer(&musb->otg_timer, jiffies
@@ -118,13 +118,13 @@ void musb_port_suspend(struct musb *musb, bool do_suspend)
                        musb_platform_try_idle(musb, 0);
                        break;
                case OTG_STATE_B_HOST:
-                       musb->xceiv->state = OTG_STATE_B_WAIT_ACON;
+                       musb->xceiv->otg->state = OTG_STATE_B_WAIT_ACON;
                        musb->is_active = otg->host->b_hnp_enable;
                        musb_platform_try_idle(musb, 0);
                        break;
                default:
                        dev_dbg(musb->controller, "bogus rh suspend? %s\n",
-                               usb_otg_state_string(musb->xceiv->state));
+                               usb_otg_state_string(musb->xceiv->otg->state));
                }
        } else if (power & MUSB_POWER_SUSPENDM) {
                power &= ~MUSB_POWER_SUSPENDM;
@@ -145,7 +145,7 @@ void musb_port_reset(struct musb *musb, bool do_reset)
        u8              power;
        void __iomem    *mbase = musb->mregs;
 
-       if (musb->xceiv->state == OTG_STATE_B_IDLE) {
+       if (musb->xceiv->otg->state == OTG_STATE_B_IDLE) {
                dev_dbg(musb->controller, "HNP: Returning from HNP; no hub reset from b_idle\n");
                musb->port1_status &= ~USB_PORT_STAT_RESET;
                return;
@@ -224,24 +224,24 @@ void musb_root_disconnect(struct musb *musb)
        usb_hcd_poll_rh_status(musb->hcd);
        musb->is_active = 0;
 
-       switch (musb->xceiv->state) {
+       switch (musb->xceiv->otg->state) {
        case OTG_STATE_A_SUSPEND:
                if (otg->host->b_hnp_enable) {
-                       musb->xceiv->state = OTG_STATE_A_PERIPHERAL;
+                       musb->xceiv->otg->state = OTG_STATE_A_PERIPHERAL;
                        musb->g.is_a_peripheral = 1;
                        break;
                }
                /* FALLTHROUGH */
        case OTG_STATE_A_HOST:
-               musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
+               musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON;
                musb->is_active = 0;
                break;
        case OTG_STATE_A_WAIT_VFALL:
-               musb->xceiv->state = OTG_STATE_B_IDLE;
+               musb->xceiv->otg->state = OTG_STATE_B_IDLE;
                break;
        default:
                dev_dbg(musb->controller, "host disconnect (%s)\n",
-                       usb_otg_state_string(musb->xceiv->state));
+                       usb_otg_state_string(musb->xceiv->otg->state));
        }
 }