From c68b47058aac2bb396dada7c7fd02a97b339c44d Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Wed, 3 Aug 2011 19:44:54 +0530 Subject: arm: tegra: usb_phy: vddio_hsic power rail control Switching off vddio_hsic power rail when hsic interface is not getting used. BUG 856606 Change-Id: I804303a933a63e6af0faa035da889ebc65769137 Reviewed-on: http://git-master/r/44773 Reviewed-by: Varun Colbert Tested-by: Varun Colbert --- arch/arm/mach-tegra/usb_phy.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'arch') diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index 5f6497e7f205..48feb5adf6e4 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -1424,6 +1424,12 @@ static int uhsic_phy_power_on(struct tegra_usb_phy *phy, bool is_dpd) void __iomem *base = phy->regs; struct tegra_uhsic_config *uhsic_config = phy->config; + if (uhsic_config->enable_gpio != -1) { + gpio_set_value_cansleep(uhsic_config->enable_gpio, 1); + /* keep hsic reset asserted for 1 ms */ + udelay(1000); + } + val = readl(base + UHSIC_PADS_CFG1); val &= ~(UHSIC_PD_BG | UHSIC_PD_TX | UHSIC_PD_TRK | UHSIC_PD_RX | UHSIC_PD_ZI | UHSIC_RPD_DATA | UHSIC_RPD_STROBE); @@ -1503,6 +1509,7 @@ static int uhsic_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd) { unsigned long val; void __iomem *base = phy->regs; + struct tegra_uhsic_config *uhsic_config = phy->config; val = readl(base + UHSIC_PADS_CFG1); val &= ~UHSIC_RPU_STROBE; @@ -1518,6 +1525,12 @@ static int uhsic_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd) val &= ~UHSIC_PHY_ENABLE; writel(val, base + USB_SUSP_CTRL); + if (uhsic_config->enable_gpio != -1) { + gpio_set_value_cansleep(uhsic_config->enable_gpio, 0); + /* keep hsic reset de-asserted for 1 ms */ + udelay(1000); + } + return 0; } -- cgit v1.2.3