diff options
author | Vinayak Pane <vpane@nvidia.com> | 2012-07-20 19:02:29 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-07-31 14:58:18 -0700 |
commit | 5791cf051fa1c520c29100b5c76d38d52ac3fd41 (patch) | |
tree | bff78fb48c322f96e70aa1e87a23958ca0129e16 /arch/arm/mach-tegra/tegra3_usb_phy.c | |
parent | 3e34666ada220c17362c25e0c19d2319db449662 (diff) |
arm: tegra: usb_phy: add close operation for hsic
hsic phy_power_off keeps hsic bus in suspend state
through PMC interface. The bus should go in reset
state at phy_close otherwise the connected device
will not enumerate after ehci-remove.
Bug 1003141
Change-Id: Ifa91d06a3c10221e74de67c68ea1f930d843d19f
Signed-off-by: Vinayak Pane <vpane@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra3_usb_phy.c')
-rw-r--r-- | arch/arm/mach-tegra/tegra3_usb_phy.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra3_usb_phy.c b/arch/arm/mach-tegra/tegra3_usb_phy.c index b47166387aa2..f164b409d29b 100644 --- a/arch/arm/mach-tegra/tegra3_usb_phy.c +++ b/arch/arm/mach-tegra/tegra3_usb_phy.c @@ -1810,6 +1810,31 @@ static void uhsic_powerup_pmc_wake_detect(struct tegra_usb_phy *phy) mdelay(1); } +static void uhsic_powerdown_pmc_wake_detect(struct tegra_usb_phy *phy) +{ + unsigned long val; + void __iomem *pmc_base = IO_ADDRESS(TEGRA_PMC_BASE); + + DBG("%s:%d\n", __func__, __LINE__); + + /* turn off pad detectors for HSIC*/ + val = readl(pmc_base + PMC_USB_AO); + val |= (HSIC_RESERVED_P0 | STROBE_VAL_PD_P0 | DATA_VAL_PD_P0); + writel(val, pmc_base + PMC_USB_AO); + + /* enable pull downs on HSIC PMC */ + val = UHSIC_STROBE_RPD_A | UHSIC_DATA_RPD_A | UHSIC_STROBE_RPD_B | + UHSIC_DATA_RPD_B | UHSIC_STROBE_RPD_C | UHSIC_DATA_RPD_C | + UHSIC_STROBE_RPD_D | UHSIC_DATA_RPD_D; + writel(val, pmc_base + PMC_SLEEPWALK_UHSIC); + + /* Turn over pad configuration to PMC */ + val = readl(pmc_base + PMC_SLEEP_CFG); + val &= ~UHSIC_WAKE_VAL_P0(~0); + val |= UHSIC_WAKE_VAL_P0(WAKE_VAL_NONE) | UHSIC_MASTER_ENABLE_P0; + writel(val, pmc_base + PMC_SLEEP_CFG); +} + static void uhsic_setup_pmc_wake_detect(struct tegra_usb_phy *phy) { unsigned long val; @@ -2142,6 +2167,9 @@ static void uhsic_phy_close(struct tegra_usb_phy *phy) { int ret; + DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst); + uhsic_powerdown_pmc_wake_detect(phy); + ret = hsic_rail_disable(phy); if (ret < 0) pr_err("%s avdd_hsic could not be disabled\n", __func__); |