summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenkat Moganty <vmoganty@nvidia.com>2010-04-28 12:29:02 +0530
committerYu-Huan Hsu <yhsu@nvidia.com>2010-05-02 18:02:49 -0700
commitfd0894b82c9ac8bc051f3291849370eabc193ca8 (patch)
treeb1743f730a744f33575f646e9ae2d8b8900d67b2
parent1b8406f6f9556f8d205ebf01035350e587c11764 (diff)
tegra pmu: Add USB-VBUS detection through pmu.
Added functionality to detect the VBUS and turn on/off the USB power rail. Bug 667912: AVDD_USB_Power is consuming 3.82mW of power in OSIdle and ULP audio playback case. Change-Id: Ia64e5a04eff16c1ebec2afe1c7bc1e8f72f9da30 Reviewed-on: http://git-master/r/1224 Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Tested-by: Dara Ramesh <dramesh@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Tested-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
-rwxr-xr-x[-rw-r--r--]arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu.c3
-rwxr-xr-x[-rw-r--r--]arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_interrupt.c17
2 files changed, 18 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu.c b/arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu.c
index f22650ce9b0c..d00fc4b1083b 100644..100755
--- a/arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu.c
+++ b/arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu.c
@@ -214,8 +214,7 @@ void NvRmPrivPmuInterruptMask(NvRmDeviceHandle hRmDevice, NvBool mask)
s_Pmu.IntrMasked = mask;
NvOsMutexUnlock(s_Pmu.hMutex);
- if (!mask)
- NvRmInterruptDone(s_Pmu.hInterrupt);
+ NvOsInterruptMask(s_Pmu.hInterrupt, mask);
}
}
diff --git a/arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_interrupt.c b/arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_interrupt.c
index f84bb14a4a88..38110f83c5a0 100644..100755
--- a/arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_interrupt.c
+++ b/arch/arm/mach-tegra/odm_kit/adaptations/pmu/max8907b/max8907b_interrupt.c
@@ -35,6 +35,7 @@
#include "max8907b_i2c.h"
#include "max8907b_reg.h"
#include "max8907b_batterycharger.h"
+#include "nvodm_services.h"
NvBool
Max8907bSetupInterrupt(
@@ -106,6 +107,22 @@ Max8907bInterruptHandler_int(
return;
}
+ if (data)
+ {
+ // VBUS connect interrupt
+ if (data &
+ (MAX8907B_CHG_IRQ1_VCHG_R_MASK << MAX8907B_CHG_IRQ1_VCHG_R_SHIFT))
+ {
+ NvOdmEnableOtgCircuitry(NV_TRUE);
+ }
+ // VBUS dis-connect interrupt
+ else if (data &
+ (MAX8907B_CHG_IRQ1_VCHG_F_MASK << MAX8907B_CHG_IRQ1_VCHG_F_SHIFT))
+ {
+ NvOdmEnableOtgCircuitry(NV_FALSE);
+ }
+ }
+
// CHG_IRQ2
if (!Max8907bI2cRead8(hDevice, MAX8907B_CHG_IRQ2, &data))
{