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>
This commit is contained in:

committed by
Felipe Balbi

parent
a2655e4a8e
commit
e47d92545c
@@ -2463,7 +2463,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
|
||||
if (!is_host_active(musb))
|
||||
return 0;
|
||||
|
||||
switch (musb->xceiv->state) {
|
||||
switch (musb->xceiv->otg->state) {
|
||||
case OTG_STATE_A_SUSPEND:
|
||||
return 0;
|
||||
case OTG_STATE_A_WAIT_VRISE:
|
||||
@@ -2473,7 +2473,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
|
||||
*/
|
||||
devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
|
||||
if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS)
|
||||
musb->xceiv->state = OTG_STATE_A_WAIT_BCON;
|
||||
musb->xceiv->otg->state = OTG_STATE_A_WAIT_BCON;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2481,7 +2481,7 @@ static int musb_bus_suspend(struct usb_hcd *hcd)
|
||||
|
||||
if (musb->is_active) {
|
||||
WARNING("trying to suspend as %s while active\n",
|
||||
usb_otg_state_string(musb->xceiv->state));
|
||||
usb_otg_state_string(musb->xceiv->otg->state));
|
||||
return -EBUSY;
|
||||
} else
|
||||
return 0;
|
||||
@@ -2678,7 +2678,7 @@ int musb_host_setup(struct musb *musb, int power_budget)
|
||||
|
||||
MUSB_HST_MODE(musb);
|
||||
musb->xceiv->otg->default_a = 1;
|
||||
musb->xceiv->state = OTG_STATE_A_IDLE;
|
||||
musb->xceiv->otg->state = OTG_STATE_A_IDLE;
|
||||
|
||||
otg_set_host(musb->xceiv->otg, &hcd->self);
|
||||
hcd->self.otg_port = 1;
|
||||
|
Reference in New Issue
Block a user