aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-fsl-usb.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/phy/phy-fsl-usb.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/phy/phy-fsl-usb.c')
-rw-r--r--drivers/usb/phy/phy-fsl-usb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index f1ea5990a50a..15d7a81eece5 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -623,7 +623,7 @@ static int fsl_otg_set_host(struct usb_otg *otg, struct usb_bus *host)
623 /* Mini-A cable connected */ 623 /* Mini-A cable connected */
624 struct otg_fsm *fsm = &otg_dev->fsm; 624 struct otg_fsm *fsm = &otg_dev->fsm;
625 625
626 otg->phy->state = OTG_STATE_UNDEFINED; 626 otg.state = OTG_STATE_UNDEFINED;
627 fsm->protocol = PROTO_UNDEF; 627 fsm->protocol = PROTO_UNDEF;
628 } 628 }
629 } 629 }
@@ -681,7 +681,7 @@ static int fsl_otg_set_power(struct usb_phy *phy, unsigned mA)
681{ 681{
682 if (!fsl_otg_dev) 682 if (!fsl_otg_dev)
683 return -ENODEV; 683 return -ENODEV;
684 if (phy->state == OTG_STATE_B_PERIPHERAL) 684 if (phy->otg.state == OTG_STATE_B_PERIPHERAL)
685 pr_info("FSL OTG: Draw %d mA\n", mA); 685 pr_info("FSL OTG: Draw %d mA\n", mA);
686 686
687 return 0; 687 return 0;
@@ -714,7 +714,7 @@ static int fsl_otg_start_srp(struct usb_otg *otg)
714{ 714{
715 struct fsl_otg *otg_dev; 715 struct fsl_otg *otg_dev;
716 716
717 if (!otg || otg->phy->state != OTG_STATE_B_IDLE) 717 if (!otg || otg.state != OTG_STATE_B_IDLE)
718 return -ENODEV; 718 return -ENODEV;
719 719
720 otg_dev = container_of(otg->phy, struct fsl_otg, phy); 720 otg_dev = container_of(otg->phy, struct fsl_otg, phy);
@@ -989,10 +989,10 @@ int usb_otg_start(struct platform_device *pdev)
989 * Also: record initial state of ID pin 989 * Also: record initial state of ID pin
990 */ 990 */
991 if (fsl_readl(&p_otg->dr_mem_map->otgsc) & OTGSC_STS_USB_ID) { 991 if (fsl_readl(&p_otg->dr_mem_map->otgsc) & OTGSC_STS_USB_ID) {
992 p_otg->phy.state = OTG_STATE_UNDEFINED; 992 p_otg->phy->otg.state = OTG_STATE_UNDEFINED;
993 p_otg->fsm.id = 1; 993 p_otg->fsm.id = 1;
994 } else { 994 } else {
995 p_otg->phy.state = OTG_STATE_A_IDLE; 995 p_otg->phy->otg.state = OTG_STATE_A_IDLE;
996 p_otg->fsm.id = 0; 996 p_otg->fsm.id = 0;
997 } 997 }
998 998