summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2010-06-25 12:11:59 -0700
committerGary King <gking@nvidia.com>2010-06-25 13:30:38 -0700
commit76b4d194644caff4a511befbf2586bcf4350882f (patch)
tree6084a5f77ff1b4d898a08ebbbb5c9ebe08111757
parent5e252bf65a356d960e650f61ab9d446bac8f5872 (diff)
[ARM/tegra] RM: Moved PMU related RM suspend/resume.
Moved PMU related suspend procedures from RM kernel suspend to the PM_SUSPEND_PREPARE pm_notifier callback. This is necessary as RM kernel suspend is invoked after interrupts are disabled, and no interrupt based transactions can be used. Similarly, moved PMU resume configuration to the PM_POST_SUSPEND pm_notifier callback. Bug 701894 Change-Id: I1614a968cc1b039f809b165877fcf1595c7cc596 Reviewed-on: http://git-master/r/3221 Tested-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Trivikram Kasivajhula <tkasivajhula@nvidia.com> Reviewed-by: Gary King <gking@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/include/nvrm_power_private.h12
-rw-r--r--arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu_private.h12
-rw-r--r--arch/arm/mach-tegra/nvrm/core/common/nvrm_power.c5
-rw-r--r--arch/arm/mach-tegra/nvrm_user.c16
4 files changed, 24 insertions, 21 deletions
diff --git a/arch/arm/mach-tegra/include/nvrm_power_private.h b/arch/arm/mach-tegra/include/nvrm_power_private.h
index efe44391662e..bd0fe6e0ef88 100644
--- a/arch/arm/mach-tegra/include/nvrm_power_private.h
+++ b/arch/arm/mach-tegra/include/nvrm_power_private.h
@@ -445,6 +445,18 @@ void NvRmPrivPowerGroupSuspend(NvRmDeviceHandle hRmDeviceHandle);
void NvRmPrivPowerGroupResume(NvRmDeviceHandle hRmDeviceHandle);
/**
+ * Configures PMU on entry/exit to/from low power state.
+ *
+ * @param hRmDevice The RM device handle
+ * @param state - Low Power state the SoC is entering to, or exiting from
+ * @param enter - Set NV_TRUE on entry, and NV_FALSE on exit
+ */
+void NvRmPrivPmuLPxStateConfig(
+ NvRmDeviceHandle hRmDevice,
+ NvOdmSocPowerState state,
+ NvBool enter);
+
+/**
* Controls power state and clamping for PCIEXCLK/PLLE (chip-specific).
*
* @param hRmDevice The RM device handle.
diff --git a/arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu_private.h b/arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu_private.h
index 6a16c5e4de02..79c818d21838 100644
--- a/arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu_private.h
+++ b/arch/arm/mach-tegra/nvrm/core/common/nvrm_pmu_private.h
@@ -82,18 +82,6 @@ void
NvRmPrivPmuDeinit(NvRmDeviceHandle hRmDevice);
/**
- * Configures PMU on entry/exit to/from low power state.
- *
- * @param hRmDevice The RM device handle
- * @param state - Low Power state the SoC is entering to, or exiting from
- * @param enter - Set NV_TRUE on entry, and NV_FALSE on exit
- */
-void NvRmPrivPmuLPxStateConfig(
- NvRmDeviceHandle hRmDevice,
- NvOdmSocPowerState state,
- NvBool enter);
-
-/**
* Sets new voltage level for the specified PMU voltage rail.
* Private interface for diagnostic mode only.
*
diff --git a/arch/arm/mach-tegra/nvrm/core/common/nvrm_power.c b/arch/arm/mach-tegra/nvrm/core/common/nvrm_power.c
index 6ba6db9dceb5..cb6f9745a00a 100644
--- a/arch/arm/mach-tegra/nvrm/core/common/nvrm_power.c
+++ b/arch/arm/mach-tegra/nvrm/core/common/nvrm_power.c
@@ -1518,10 +1518,8 @@ NvRmKernelPowerSuspend( NvRmDeviceHandle hRmDeviceHandle )
NvOdmSocPowerState state =
NvOdmQueryLowestSocPowerState()->LowestPowerState;
- NvRmPrivDfsSuspend(state);
if (state == NvOdmSocPowerState_Suspend)
NvRmPrivPowerGroupSuspend(hRmDeviceHandle);
- NvRmPrivPmuLPxStateConfig(hRmDeviceHandle, state, NV_TRUE);
#if NVRM_POWER_DEBUG_SUSPEND_ENTRY
NvOsMutexLock(s_hPowerClientMutex);
@@ -1549,7 +1547,7 @@ NvRmKernelPowerSuspend( NvRmDeviceHandle hRmDeviceHandle )
if (pVoltageReq->MaxVolts != NvRmVoltsOff)
{
// could also set some bad e = NvError_Bad???
- NvOsDebugPrintf("Active Module: 0x%x",
+ NvOsDebugPrintf("Active Module: 0x%x\n",
pVoltageReq->ModuleId);
}
pVoltageReq = pVoltageReq->pNext;
@@ -1574,7 +1572,6 @@ NvRmKernelPowerResume( NvRmDeviceHandle hRmDeviceHandle )
ReportRmPowerState(hRmDeviceHandle);
NvOsMutexUnlock(s_hPowerClientMutex);
- NvRmPrivPmuLPxStateConfig(hRmDeviceHandle, state, NV_FALSE);
if (state == NvOdmSocPowerState_Suspend)
NvRmPrivPowerGroupResume(hRmDeviceHandle);
return NvSuccess;
diff --git a/arch/arm/mach-tegra/nvrm_user.c b/arch/arm/mach-tegra/nvrm_user.c
index c88bd20b0f15..4125769b1e59 100644
--- a/arch/arm/mach-tegra/nvrm_user.c
+++ b/arch/arm/mach-tegra/nvrm_user.c
@@ -545,22 +545,28 @@ static void notify_daemon(const char* notice)
int tegra_pm_notifier(struct notifier_block *nb,
unsigned long event, void *nouse)
{
+ NvOdmSocPowerState state =
+ NvOdmQueryLowestSocPowerState()->LowestPowerState;
printk(KERN_INFO "%s: start processing event=%lx\n", __func__, event);
// Notify the event to nvrm_daemon.
- if (event == PM_SUSPEND_PREPARE) {
+ switch (event) {
+ case PM_SUSPEND_PREPARE:
#ifndef CONFIG_HAS_EARLYSUSPEND
notify_daemon(STRING_PM_DISPLAY_OFF);
#endif
notify_daemon(STRING_PM_SUSPEND_PREPARE);
- }
- else if (event == PM_POST_SUSPEND) {
+ NvRmPrivDfsSuspend(state);
+ NvRmPrivPmuLPxStateConfig(s_hRmGlobal, state, NV_TRUE);
+ break;
+ case PM_POST_SUSPEND:
+ NvRmPrivPmuLPxStateConfig(s_hRmGlobal, state, NV_FALSE);
notify_daemon(STRING_PM_POST_SUSPEND);
#ifndef CONFIG_HAS_EARLYSUSPEND
notify_daemon(STRING_PM_DISPLAY_ON);
#endif
- }
- else {
+ break;
+ default:
printk(KERN_ERR "%s: unknown event %ld\n", __func__, event);
return NOTIFY_DONE;
}