diff options
author | Prashant Gaikwad <pgaikwad@nvidia.com> | 2011-07-01 14:27:52 +0530 |
---|---|---|
committer | Manish Tuteja <mtuteja@nvidia.com> | 2011-07-05 10:35:13 -0700 |
commit | 9f5bb3ae0980f8dc71cc2934ca27e53d0b47060d (patch) | |
tree | 7dc4ba0cf9e020f28f517ba45c69519cf4e5a87a /arch | |
parent | 658ae64341f3c23523ac7558e8fcaa95852cf966 (diff) |
ARM: tegra: usb: USB controller set to reset
1. The usb UTMIP controllers are set to reset mode when there is no usb cable.
2. Power down the reciever circuitory.
3. Set the OTG_PD for instances which do not use OTG.
4. Turn off the pad power when hotplug support is not supported.
Bug 829628
Change-Id: Icbf82da7d3f35ea882d8a212a01d04c4d536fd0d
Reviewed-on: http://git-master/r/39352
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-tegra/usb_phy.c | 27 |
2 files changed, 28 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index a05650120254..1e11fa6c7855 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -147,3 +147,7 @@ config TEGRA_STAT_MON default n help Enables support for hardware statistics monitor for AVP. + +config USB_HOTPLUG + bool "Enable USB hotplug" + default n diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index 93310b9f3abd..ee17dffc3d8c 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -667,10 +667,18 @@ static void utmi_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd) writel(val, base + USB_SUSP_CTRL); } - val = readl(base + UTMIP_BAT_CHRG_CFG0); - val |= UTMIP_PD_CHRG; - writel(val, base + UTMIP_BAT_CHRG_CFG0); + if (phy->mode == TEGRA_USB_PHY_MODE_DEVICE) { + val = readl(base + UTMIP_BAT_CHRG_CFG0); + val |= UTMIP_PD_CHRG; + writel(val, base + UTMIP_BAT_CHRG_CFG0); + } + if (phy->instance != 2) { + val = readl(base + UTMIP_XCVR_CFG0); + val |= (UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN | + UTMIP_FORCE_PDZI_POWERDOWN); + writel(val, base + UTMIP_XCVR_CFG0); + } val = readl(base + UTMIP_XCVR_CFG1); val |= UTMIP_FORCE_PDDISC_POWERDOWN | UTMIP_FORCE_PDCHRP_POWERDOWN | UTMIP_FORCE_PDDR_POWERDOWN; @@ -681,6 +689,11 @@ static void utmi_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd) val |= USB_PORTSC1_WKCN; writel(val, base + USB_PORTSC1); } + if (phy->instance != 0) { + val = readl(base + UTMIP_BIAS_CFG0); + val |= UTMIP_OTGPD; + writel(val, base + UTMIP_BIAS_CFG0); + } utmi_phy_clk_disable(phy); @@ -688,8 +701,16 @@ static void utmi_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd) 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); } +#ifdef CONFIG_USB_HOTPLUG utmip_pad_power_off(phy, is_dpd); +#else + utmip_pad_power_off(phy, true); +#endif } static void utmi_phy_preresume(struct tegra_usb_phy *phy, bool is_dpd) |