aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/ux500.c
diff options
context:
space:
mode:
authorAntoine Tenart <antoine.tenart@free-electrons.com>2014-10-30 13:41:13 -0400
committerFelipe Balbi <balbi@ti.com>2014-11-03 11:01:25 -0500
commite47d92545c2972bcf3711e7db80f481e402163c7 (patch)
treea84db324fbd565aaa371bc0ef5677456541877e3 /drivers/usb/musb/ux500.c
parenta2655e4a8edb66d21b0967940172e83a51d30ef3 (diff)
usb: move the OTG state from the USB PHY to the OTG structure
Before using the PHY framework instead of the USB PHY one, we need to move the OTG state into another place, since it won't be available when USB PHY isn't used. This patch moves the OTG state into the OTG structure, and makes all the needed modifications in the drivers using the OTG state. [ balbi@ti.com : fix build regressions with phy-tahvo.c, musb_dsps.c, phy-isp1301-omap, and chipidea's debug.c ] Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/ux500.c')
-rw-r--r--drivers/usb/musb/ux500.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
index d0180a70051d..1d631d5f4a27 100644
--- a/drivers/usb/musb/ux500.c
+++ b/drivers/usb/musb/ux500.c
@@ -56,7 +56,7 @@ static void ux500_musb_set_vbus(struct musb *musb, int is_on)
56 devctl = musb_readb(musb->mregs, MUSB_DEVCTL); 56 devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
57 57
58 if (is_on) { 58 if (is_on) {
59 if (musb->xceiv->state == OTG_STATE_A_IDLE) { 59 if (musb->xceiv->otg->state == OTG_STATE_A_IDLE) {
60 /* start the session */ 60 /* start the session */
61 devctl |= MUSB_DEVCTL_SESSION; 61 devctl |= MUSB_DEVCTL_SESSION;
62 musb_writeb(musb->mregs, MUSB_DEVCTL, devctl); 62 musb_writeb(musb->mregs, MUSB_DEVCTL, devctl);
@@ -76,7 +76,7 @@ static void ux500_musb_set_vbus(struct musb *musb, int is_on)
76 } else { 76 } else {
77 musb->is_active = 1; 77 musb->is_active = 1;
78 musb->xceiv->otg->default_a = 1; 78 musb->xceiv->otg->default_a = 1;
79 musb->xceiv->state = OTG_STATE_A_WAIT_VRISE; 79 musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE;
80 devctl |= MUSB_DEVCTL_SESSION; 80 devctl |= MUSB_DEVCTL_SESSION;
81 MUSB_HST_MODE(musb); 81 MUSB_HST_MODE(musb);
82 } 82 }
@@ -102,7 +102,7 @@ static void ux500_musb_set_vbus(struct musb *musb, int is_on)
102 mdelay(200); 102 mdelay(200);
103 103
104 dev_dbg(musb->controller, "VBUS %s, devctl %02x\n", 104 dev_dbg(musb->controller, "VBUS %s, devctl %02x\n",
105 usb_otg_state_string(musb->xceiv->state), 105 usb_otg_state_string(musb->xceiv->otg->state),
106 musb_readb(musb->mregs, MUSB_DEVCTL)); 106 musb_readb(musb->mregs, MUSB_DEVCTL));
107} 107}
108 108
@@ -112,7 +112,7 @@ static int musb_otg_notifications(struct notifier_block *nb,
112 struct musb *musb = container_of(nb, struct musb, nb); 112 struct musb *musb = container_of(nb, struct musb, nb);
113 113
114 dev_dbg(musb->controller, "musb_otg_notifications %ld %s\n", 114 dev_dbg(musb->controller, "musb_otg_notifications %ld %s\n",
115 event, usb_otg_state_string(musb->xceiv->state)); 115 event, usb_otg_state_string(musb->xceiv->otg->state));
116 116
117 switch (event) { 117 switch (event) {
118 case UX500_MUSB_ID: 118 case UX500_MUSB_ID:
@@ -127,7 +127,7 @@ static int musb_otg_notifications(struct notifier_block *nb,
127 if (is_host_active(musb)) 127 if (is_host_active(musb))
128 ux500_musb_set_vbus(musb, 0); 128 ux500_musb_set_vbus(musb, 0);
129 else 129 else
130 musb->xceiv->state = OTG_STATE_B_IDLE; 130 musb->xceiv->otg->state = OTG_STATE_B_IDLE;
131 break; 131 break;
132 default: 132 default:
133 dev_dbg(musb->controller, "ID float\n"); 133 dev_dbg(musb->controller, "ID float\n");