summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRakesh Bodla <rbodla@nvidia.com>2012-07-30 15:16:18 +0530
committerVarun Wadekar <vwadekar@nvidia.com>2012-08-06 14:52:15 +0530
commitba6d399dac88618433353ca044e477110e4247d1 (patch)
tree1f2aa03be23f35a8e5fd08f92cec2f194f3e5cdc /arch
parent85b6920729c579fa6e0db8fe0edd566289069bf3 (diff)
ARM: tegra: usb: keep usb vdd regulator on
Adding the conditions during which USB vdd regulator should be kept ON. Bug 1024425 Bug 1012078 Bug 1018538 Change-Id: I3319c91ecc02891ea4467f73be2b84a3817dab36 Signed-off-by: Rakesh Bodla <rbodla@nvidia.com> Reviewed-on: http://git-master/r/119279 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/usb_phy.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index 962dc7c84e6f..66aca04ab779 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -145,7 +145,7 @@ static irqreturn_t usb_phy_dev_vbus_pmu_irq_thr(int irq, void *pdata)
if (phy->vdd_reg && !phy->vdd_reg_on) {
regulator_enable(phy->vdd_reg);
- phy->vdd_reg_on = 1;
+ phy->vdd_reg_on = true;
/*
* Optimal time to get the regulator turned on
* before detecting vbus interrupt.
@@ -482,26 +482,30 @@ int tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
clk_disable(phy->sys_clk);
if (phy->pdata->op_mode == TEGRA_USB_OPMODE_HOST) {
if (!phy->pdata->u_data.host.hot_plug &&
- !phy->pdata->u_data.host.remote_wakeup_supported)
+ !phy->pdata->u_data.host.remote_wakeup_supported) {
clk_disable(phy->ctrlr_clk);
+ phy->ctrl_clk_on = false;
+ if (phy->vdd_reg && phy->vdd_reg_on) {
+ regulator_disable(phy->vdd_reg);
+ phy->vdd_reg_on = false;
+ }
+ }
} else {
- /* In device mode clock is turned on by pmu irq handler
- * if pmu irq is not available clocks will not be turned off/on
+ /* In device mode clock regulator/clocks will be turned off
+ * only if pmu interrupt is present on the board and host mode
+ * support through OTG is supported on the board.
*/
- if (phy->pdata->u_data.dev.vbus_pmu_irq) {
+ if (phy->pdata->u_data.dev.vbus_pmu_irq &&
+ phy->pdata->builtin_host_disabled) {
clk_disable(phy->ctrlr_clk);
phy->ctrl_clk_on = false;
+ if (phy->vdd_reg && phy->vdd_reg_on) {
+ regulator_disable(phy->vdd_reg);
+ phy->vdd_reg_on = false;
+ }
}
}
-#ifndef CONFIG_ARCH_TEGRA_2x_SOC
- if (phy->vdd_reg && phy->vdd_reg_on)
- if (phy->pdata->has_hostpc || phy->pdata->builtin_host_disabled) {
- regulator_disable(phy->vdd_reg);
- phy->vdd_reg_on = false;
- }
-#endif
-
phy->phy_power_on = false;
return err;