[PATCH 7/8] arm: omap: am335x: enable phy controls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Switch on the phy for am335x.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@xxxxxx>
---
Changes from v1:
	- Added ioremap for AM33x SCM base.

 arch/arm/mach-omap2/omap_phy_internal.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index 4c90477..7129408 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -266,7 +266,11 @@ void ti81xx_musb_phy_power(u8 on)
 	void __iomem *scm_base = NULL;
 	u32 usbphycfg;
 
-	scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K);
+	if (cpu_is_ti81xx())
+		scm_base = ioremap(TI81XX_SCM_BASE, SZ_2K);
+	else if (cpu_is_am33xx())
+		scm_base = ioremap(AM33XX_SCM_BASE, SZ_2K);
+
 	if (!scm_base) {
 		pr_err("system control module ioremap failed\n");
 		return;
@@ -278,16 +282,19 @@ void ti81xx_musb_phy_power(u8 on)
 		if (cpu_is_ti816x()) {
 			usbphycfg |= TI816X_USBPHY0_NORMAL_MODE;
 			usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC;
-		} else if (cpu_is_ti814x()) {
-			usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN
-				| USBPHY_DPINPUT | USBPHY_DMINPUT);
-			usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN
-				| USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL);
+		} else if (cpu_is_ti814x() || cpu_is_am33xx()) {
+			usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN);
+			usbphycfg |= USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN;
+			if (cpu_is_ti814x()) {
+				usbphycfg &= ~(USBPHY_DPINPUT | USBPHY_DMINPUT);
+				usbphycfg |= USBPHY_DPOPBUFCTL
+					| USBPHY_DMOPBUFCTL;
+			}
 		}
 	} else {
 		if (cpu_is_ti816x())
 			usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE;
-		else if (cpu_is_ti814x())
+		else if (cpu_is_ti814x() || cpu_is_am33xx())
 			usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN;
 
 	}
-- 
1.6.2.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux