aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-fsl-usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/phy/phy-fsl-usb.c')
-rw-r--r--drivers/usb/phy/phy-fsl-usb.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index f1ea5990a50a..ab38aa32a6c1 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -274,7 +274,7 @@ void b_srp_end(unsigned long foo)
274 fsl_otg_dischrg_vbus(0); 274 fsl_otg_dischrg_vbus(0);
275 srp_wait_done = 1; 275 srp_wait_done = 1;
276 276
277 if ((fsl_otg_dev->phy.state == OTG_STATE_B_SRP_INIT) && 277 if ((fsl_otg_dev->phy.otg->state == OTG_STATE_B_SRP_INIT) &&
278 fsl_otg_dev->fsm.b_sess_vld) 278 fsl_otg_dev->fsm.b_sess_vld)
279 fsl_otg_dev->fsm.b_srp_done = 1; 279 fsl_otg_dev->fsm.b_srp_done = 1;
280} 280}
@@ -499,7 +499,8 @@ int fsl_otg_start_host(struct otg_fsm *fsm, int on)
499{ 499{
500 struct usb_otg *otg = fsm->otg; 500 struct usb_otg *otg = fsm->otg;
501 struct device *dev; 501 struct device *dev;
502 struct fsl_otg *otg_dev = container_of(otg->phy, struct fsl_otg, phy); 502 struct fsl_otg *otg_dev =
503 container_of(otg->usb_phy, struct fsl_otg, phy);
503 u32 retval = 0; 504 u32 retval = 0;
504 505
505 if (!otg->host) 506 if (!otg->host)
@@ -594,7 +595,7 @@ static int fsl_otg_set_host(struct usb_otg *otg, struct usb_bus *host)
594 if (!otg) 595 if (!otg)
595 return -ENODEV; 596 return -ENODEV;
596 597
597 otg_dev = container_of(otg->phy, struct fsl_otg, phy); 598 otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
598 if (otg_dev != fsl_otg_dev) 599 if (otg_dev != fsl_otg_dev)
599 return -ENODEV; 600 return -ENODEV;
600 601
@@ -623,7 +624,7 @@ static int fsl_otg_set_host(struct usb_otg *otg, struct usb_bus *host)
623 /* Mini-A cable connected */ 624 /* Mini-A cable connected */
624 struct otg_fsm *fsm = &otg_dev->fsm; 625 struct otg_fsm *fsm = &otg_dev->fsm;
625 626
626 otg->phy->state = OTG_STATE_UNDEFINED; 627 otg->state = OTG_STATE_UNDEFINED;
627 fsm->protocol = PROTO_UNDEF; 628 fsm->protocol = PROTO_UNDEF;
628 } 629 }
629 } 630 }
@@ -644,7 +645,7 @@ static int fsl_otg_set_peripheral(struct usb_otg *otg,
644 if (!otg) 645 if (!otg)
645 return -ENODEV; 646 return -ENODEV;
646 647
647 otg_dev = container_of(otg->phy, struct fsl_otg, phy); 648 otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
648 VDBG("otg_dev 0x%x\n", (int)otg_dev); 649 VDBG("otg_dev 0x%x\n", (int)otg_dev);
649 VDBG("fsl_otg_dev 0x%x\n", (int)fsl_otg_dev); 650 VDBG("fsl_otg_dev 0x%x\n", (int)fsl_otg_dev);
650 if (otg_dev != fsl_otg_dev) 651 if (otg_dev != fsl_otg_dev)
@@ -681,7 +682,7 @@ static int fsl_otg_set_power(struct usb_phy *phy, unsigned mA)
681{ 682{
682 if (!fsl_otg_dev) 683 if (!fsl_otg_dev)
683 return -ENODEV; 684 return -ENODEV;
684 if (phy->state == OTG_STATE_B_PERIPHERAL) 685 if (phy->otg->state == OTG_STATE_B_PERIPHERAL)
685 pr_info("FSL OTG: Draw %d mA\n", mA); 686 pr_info("FSL OTG: Draw %d mA\n", mA);
686 687
687 return 0; 688 return 0;
@@ -714,10 +715,10 @@ static int fsl_otg_start_srp(struct usb_otg *otg)
714{ 715{
715 struct fsl_otg *otg_dev; 716 struct fsl_otg *otg_dev;
716 717
717 if (!otg || otg->phy->state != OTG_STATE_B_IDLE) 718 if (!otg || otg->state != OTG_STATE_B_IDLE)
718 return -ENODEV; 719 return -ENODEV;
719 720
720 otg_dev = container_of(otg->phy, struct fsl_otg, phy); 721 otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
721 if (otg_dev != fsl_otg_dev) 722 if (otg_dev != fsl_otg_dev)
722 return -ENODEV; 723 return -ENODEV;
723 724
@@ -735,7 +736,7 @@ static int fsl_otg_start_hnp(struct usb_otg *otg)
735 if (!otg) 736 if (!otg)
736 return -ENODEV; 737 return -ENODEV;
737 738
738 otg_dev = container_of(otg->phy, struct fsl_otg, phy); 739 otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy);
739 if (otg_dev != fsl_otg_dev) 740 if (otg_dev != fsl_otg_dev)
740 return -ENODEV; 741 return -ENODEV;
741 742
@@ -857,7 +858,7 @@ static int fsl_otg_conf(struct platform_device *pdev)
857 fsl_otg_tc->phy.dev = &pdev->dev; 858 fsl_otg_tc->phy.dev = &pdev->dev;
858 fsl_otg_tc->phy.set_power = fsl_otg_set_power; 859 fsl_otg_tc->phy.set_power = fsl_otg_set_power;
859 860
860 fsl_otg_tc->phy.otg->phy = &fsl_otg_tc->phy; 861 fsl_otg_tc->phy.otg->usb_phy = &fsl_otg_tc->phy;
861 fsl_otg_tc->phy.otg->set_host = fsl_otg_set_host; 862 fsl_otg_tc->phy.otg->set_host = fsl_otg_set_host;
862 fsl_otg_tc->phy.otg->set_peripheral = fsl_otg_set_peripheral; 863 fsl_otg_tc->phy.otg->set_peripheral = fsl_otg_set_peripheral;
863 fsl_otg_tc->phy.otg->start_hnp = fsl_otg_start_hnp; 864 fsl_otg_tc->phy.otg->start_hnp = fsl_otg_start_hnp;
@@ -989,10 +990,10 @@ int usb_otg_start(struct platform_device *pdev)
989 * Also: record initial state of ID pin 990 * Also: record initial state of ID pin
990 */ 991 */
991 if (fsl_readl(&p_otg->dr_mem_map->otgsc) & OTGSC_STS_USB_ID) { 992 if (fsl_readl(&p_otg->dr_mem_map->otgsc) & OTGSC_STS_USB_ID) {
992 p_otg->phy.state = OTG_STATE_UNDEFINED; 993 p_otg->phy.otg->state = OTG_STATE_UNDEFINED;
993 p_otg->fsm.id = 1; 994 p_otg->fsm.id = 1;
994 } else { 995 } else {
995 p_otg->phy.state = OTG_STATE_A_IDLE; 996 p_otg->phy.otg->state = OTG_STATE_A_IDLE;
996 p_otg->fsm.id = 0; 997 p_otg->fsm.id = 0;
997 } 998 }
998 999
@@ -1047,7 +1048,7 @@ static int show_fsl_usb2_otg_state(struct device *dev,
1047 /* State */ 1048 /* State */
1048 t = scnprintf(next, size, 1049 t = scnprintf(next, size,
1049 "OTG state: %s\n\n", 1050 "OTG state: %s\n\n",
1050 usb_otg_state_string(fsl_otg_dev->phy.state)); 1051 usb_otg_state_string(fsl_otg_dev->phy.otg->state));
1051 size -= t; 1052 size -= t;
1052 next += t; 1053 next += t;
1053 1054