diff options
author | Wen Yi <wyi@nvidia.com> | 2012-03-12 16:27:02 -0700 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-03-15 09:08:15 -0700 |
commit | 7b0b95383696384c280b90890c5f4ec5a25cb5eb (patch) | |
tree | 065f3bc425d48fc0caa851dfc71a146cef7f7232 /arch/arm/mach-tegra/pm.c | |
parent | 096331bc3f24b9fb1c7da7a8df373d141f53ac62 (diff) |
ARM: tegra: power: Set awake system CPU rate floor
Set CPU rate floor to 100MHz when the system is awake (after boot,
or on late resume). Remove the floor when the system enters early
suspend.
Bug 922351
Change-Id: Ibaca50791a5b04b4b4165ceac5018d4cfd7c1bcf
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/89587
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/pm.c')
-rw-r--r-- | arch/arm/mach-tegra/pm.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/pm.c b/arch/arm/mach-tegra/pm.c index 45b70b895114..6e8b0782e9b9 100644 --- a/arch/arm/mach-tegra/pm.c +++ b/arch/arm/mach-tegra/pm.c @@ -33,6 +33,7 @@ #include <linux/debugfs.h> #include <linux/delay.h> #include <linux/suspend.h> +#include <linux/earlysuspend.h> #include <linux/slab.h> #include <linux/serial_reg.h> #include <linux/seq_file.h> @@ -1298,3 +1299,28 @@ static int tegra_debug_uart_syscore_init(void) return 0; } arch_initcall(tegra_debug_uart_syscore_init); + +#ifdef CONFIG_HAS_EARLYSUSPEND +static void pm_early_suspend(struct early_suspend *h) +{ + pm_qos_update_request(&awake_cpu_freq_req, PM_QOS_DEFAULT_VALUE); +} + +static void pm_late_resume(struct early_suspend *h) +{ + pm_qos_update_request(&awake_cpu_freq_req, (s32)AWAKE_CPU_FREQ_MIN); +} + +static struct early_suspend pm_early_suspender = { + .suspend = pm_early_suspend, + .resume = pm_late_resume, +}; + +static int pm_init_wake_behavior(void) +{ + register_early_suspend(&pm_early_suspender); + return 0; +} + +late_initcall(pm_init_wake_behavior); +#endif |