aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/common
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/common
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/common')
-rw-r--r--drivers/usb/common/usb-otg-fsm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/common/usb-otg-fsm.c b/drivers/usb/common/usb-otg-fsm.c
index 98e8340a5bb1..c6b35b77dab7 100644
--- a/drivers/usb/common/usb-otg-fsm.c
+++ b/drivers/usb/common/usb-otg-fsm.c
@@ -124,10 +124,10 @@ static void otg_leave_state(struct otg_fsm *fsm, enum usb_otg_state old_state)
124static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state) 124static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
125{ 125{
126 state_changed = 1; 126 state_changed = 1;
127 if (fsm->otg->phy->state == new_state) 127 if (fsm->otg->state == new_state)
128 return 0; 128 return 0;
129 VDBG("Set state: %s\n", usb_otg_state_string(new_state)); 129 VDBG("Set state: %s\n", usb_otg_state_string(new_state));
130 otg_leave_state(fsm, fsm->otg->phy->state); 130 otg_leave_state(fsm, fsm->otg->state);
131 switch (new_state) { 131 switch (new_state) {
132 case OTG_STATE_B_IDLE: 132 case OTG_STATE_B_IDLE:
133 otg_drv_vbus(fsm, 0); 133 otg_drv_vbus(fsm, 0);
@@ -236,7 +236,7 @@ static int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
236 break; 236 break;
237 } 237 }
238 238
239 fsm->otg->phy->state = new_state; 239 fsm->otg->state = new_state;
240 return 0; 240 return 0;
241} 241}
242 242
@@ -247,7 +247,7 @@ int otg_statemachine(struct otg_fsm *fsm)
247 247
248 mutex_lock(&fsm->lock); 248 mutex_lock(&fsm->lock);
249 249
250 state = fsm->otg->phy->state; 250 state = fsm->otg->state;
251 state_changed = 0; 251 state_changed = 0;
252 /* State machine state change judgement */ 252 /* State machine state change judgement */
253 253