diff mbox

[U-Boot,3/5] TI PHY: Add support to control 2nd USB PHY in DRA7xx/AM57xx

Message ID 1439205778-14343-4-git-send-email-kishon@ti.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Kishon Vijay Abraham I Aug. 10, 2015, 11:22 a.m. UTC
Added support to power on/power off the second USB PHY present in
DRA7xx and AM57xx.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/usb/dwc3/ti_usb_phy.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

Comments

Tom Rini Aug. 11, 2015, 12:33 a.m. UTC | #1
On Mon, Aug 10, 2015 at 04:52:56PM +0530, Kishon Vijay Abraham I wrote:

> Added support to power on/power off the second USB PHY present in
> DRA7xx and AM57xx.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini Aug. 28, 2015, 9:04 p.m. UTC | #2
On Mon, Aug 10, 2015 at 04:52:56PM +0530, Kishon Vijay Abraham I wrote:

> Added support to power on/power off the second USB PHY present in
> DRA7xx and AM57xx.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/drivers/usb/dwc3/ti_usb_phy.c b/drivers/usb/dwc3/ti_usb_phy.c
index e6048eb..4159e5a 100644
--- a/drivers/usb/dwc3/ti_usb_phy.c
+++ b/drivers/usb/dwc3/ti_usb_phy.c
@@ -193,8 +193,11 @@  void ti_usb2_phy_power(struct ti_usb_phy *phy, int on)
 	val = readl(phy->usb2_phy_power);
 
 	if (on) {
-#ifdef CONFIG_DRA7XX
-		val &= ~OMAP_CTRL_DEV_PHY_PD;
+#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX)
+		if (phy->index == 1)
+			val &= ~OMAP_CTRL_USB2_PHY_PD;
+		else
+			val &= ~OMAP_CTRL_DEV_PHY_PD;
 #elif defined(CONFIG_AM43XX)
 		val &= ~(AM437X_CTRL_USB2_PHY_PD |
 			 AM437X_CTRL_USB2_OTG_PD);
@@ -202,8 +205,12 @@  void ti_usb2_phy_power(struct ti_usb_phy *phy, int on)
 			AM437X_CTRL_USB2_OTGSESSEND_EN);
 #endif
 	} else {
-#ifdef CONFIG_DRA7XX
-		val |= OMAP_CTRL_DEV_PHY_PD;
+#if defined(CONFIG_DRA7XX) || defined(CONFIG_AM57XX)
+		if (phy->index == 1)
+			val |= OMAP_CTRL_USB2_PHY_PD;
+		else
+			val |= OMAP_CTRL_DEV_PHY_PD;
+
 #elif defined(CONFIG_AM43XX)
 		val &= ~(AM437X_CTRL_USB2_OTGVDET_EN |
 			 AM437X_CTRL_USB2_OTGSESSEND_EN);