From ac64f7716cc7afbb57a3c7c70aa9214e2279624e Mon Sep 17 00:00:00 2001 From: Krishna Yarlagadda Date: Fri, 18 Nov 2011 15:02:17 +0530 Subject: ARM: tegra: usb: check for valid phy clock Check for valid clock after setting up phy in UTMIP reset Bug 853708 Bug 886080 (reviewed on http://git-master/r/51555) (cherry picked from commit 25b340b64ca27971f6d2d555299a749f0394e77e) Change-Id: I98c79fb1e8961b9af19f3001fe6fbde2b28509a0 Reviewed-on: http://git-master/r/75502 Reviewed-by: Simone Willett Signed-off-by: Ken Chang Signed-off-by: Varun Wadekar Reviewed-on: http://git-master/r/76468 Reviewed-by: Automatic_Commit_Validation_User --- arch/arm/mach-tegra/usb_phy.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index 8c2990b00752..5eab7ccd3dc8 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -790,6 +790,7 @@ static void utmi_phy_clk_disable(struct tegra_usb_phy *phy) { unsigned long val; void __iomem *base = phy->regs; + #ifdef CONFIG_ARCH_TEGRA_2x_SOC if (phy->instance == 0) { val = readl(base + USB_SUSP_CTRL); @@ -813,6 +814,15 @@ static void utmi_phy_clk_disable(struct tegra_usb_phy *phy) val |= HOSTPC1_DEVLC_PHCD; writel(val, base + HOSTPC1_DEVLC); #endif + if (phy->instance == 2) { + val = readl(base + USB_SUSP_CTRL); + val |= USB_PHY_CLK_VALID_INT_ENB; + writel(val, base + USB_SUSP_CTRL); + } else { + val = readl(base + USB_SUSP_CTRL); + val |= UTMIP_RESET; + writel(val, base + USB_SUSP_CTRL); + } if (utmi_wait_register(base + USB_SUSP_CTRL, USB_PHY_CLK_VALID, 0) < 0) pr_err("%s: timeout waiting for phy to stabilize\n", __func__); @@ -1360,15 +1370,6 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd) utmi_phy_clk_disable(phy); - if (phy->hotplug) { - val = readl(base + USB_SUSP_CTRL); - val |= USB_PHY_CLK_VALID_INT_ENB; - writel(val, base + USB_SUSP_CTRL); - } else { - val = readl(base + USB_SUSP_CTRL); - val |= UTMIP_RESET; - writel(val, base + USB_SUSP_CTRL); - } utmip_pad_power_off(phy, true); return 0; } -- cgit v1.2.3