From c5436143600aadf50375658894c258fb74435b37 Mon Sep 17 00:00:00 2001 From: Jay Cheng Date: Mon, 22 Nov 2010 11:03:52 -0500 Subject: [PATCH] ARM: tegra: usb_phy: Disable disconnect detection during resume Change-Id: I30a45dc7e7a87773a93c128877d0f0827e5d44b7 Signed-off-by: Jay Cheng --- arch/arm/mach-tegra/include/mach/usb_phy.h | 4 +++ arch/arm/mach-tegra/usb_phy.c | 36 ++++++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h index 71f1b9fa76db..8b4beae773a7 100644 --- a/arch/arm/mach-tegra/include/mach/usb_phy.h +++ b/arch/arm/mach-tegra/include/mach/usb_phy.h @@ -79,6 +79,10 @@ int tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy); int tegra_usb_phy_power_off(struct tegra_usb_phy *phy); +int tegra_usb_phy_preresume(struct tegra_usb_phy *phy); + +int tegra_usb_phy_postresume(struct tegra_usb_phy *phy); + int tegra_usb_phy_close(struct tegra_usb_phy *phy); #endif //__MACH_USB_PHY_H diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index dffabc3ec063..26605d9c2c0f 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -347,8 +347,6 @@ static void utmi_phy_power_on(struct tegra_usb_phy *phy) val = readl(base + UTMIP_TX_CFG0); val &= ~UTMIP_FS_PREABMLE_J; - if (phy->instance == 2) - val |= UTMIP_HS_DISCON_DISABLE; writel(val, base + UTMIP_TX_CFG0); val = readl(base + UTMIP_HSRX_CFG0); @@ -481,6 +479,26 @@ static void utmi_phy_power_off(struct tegra_usb_phy *phy) utmip_pad_power_off(phy); } +static void utmi_phy_preresume(struct tegra_usb_phy *phy) +{ + unsigned long val; + void __iomem *base = phy->regs; + + val = readl(base + UTMIP_TX_CFG0); + val |= UTMIP_HS_DISCON_DISABLE; + writel(val, base + UTMIP_TX_CFG0); +} + +static void utmi_phy_postresume(struct tegra_usb_phy *phy) +{ + unsigned long val; + void __iomem *base = phy->regs; + + val = readl(base + UTMIP_TX_CFG0); + val &= ~UTMIP_HS_DISCON_DISABLE; + writel(val, base + UTMIP_TX_CFG0); +} + static void ulpi_viewport_write(struct tegra_usb_phy *phy, u8 addr, u8 data) { unsigned long val; @@ -672,6 +690,20 @@ int tegra_usb_phy_power_off(struct tegra_usb_phy *phy) return 0; } +int tegra_usb_phy_preresume(struct tegra_usb_phy *phy) +{ + if (phy->instance == 2) + utmi_phy_preresume(phy); + return 0; +} + +int tegra_usb_phy_postresume(struct tegra_usb_phy *phy) +{ + if (phy->instance == 2) + utmi_phy_postresume(phy); + return 0; +} + int tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy) { if (phy->instance != 1) -- 2.34.1