diff options
| author | Doug Zobel <dzobel1@motorola.com> | 2014-09-25 16:44:32 -0500 |
|---|---|---|
| committer | Doug Zobel <dzobel1@motorola.com> | 2014-09-25 16:46:19 -0500 |
| commit | 5fe013f79b93a67e8aa070172bd1ab35c51c3ab4 (patch) | |
| tree | 9bb9f10440423569d957405e576d7a84d216e19d | |
| parent | 4f9af9948ef92869d86447062520b690b7c11d12 (diff) | |
| download | olio-linux-3.10-5fe013f79b93a67e8aa070172bd1ab35c51c3ab4.tar.xz olio-linux-3.10-5fe013f79b93a67e8aa070172bd1ab35c51c3ab4.zip | |
IKXCLOCK-3875 omap: disable offmode by default
Add a module pramater to disable OMAP offmode by default. Can
be overridden by sysfs or kernel cmdline
Change-Id: I7f14a57f951bc104117cc0547c4cda28bcd13f94
| -rw-r--r-- | arch/arm/mach-omap2/pm-debug.c | 18 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/pm34xx.c | 4 |
2 files changed, 19 insertions, 3 deletions
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index b5dff42606c..ea5a306d1f1 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -38,8 +38,16 @@ #include "pm.h" #include "pm-debug-regs.h" +/* enable_off_mode is the runtime flag for enable/disable of offmode */ u32 enable_off_mode; +/* + * global_disable_off_mode supercedes enable_off_mode and keeps + * offmode disabled as long as it is set + */ +bool global_disable_off_mode = 1; +module_param(global_disable_off_mode, bool, 0644); + #ifdef CONFIG_DEBUG_FS #include <linux/debugfs.h> #include <linux/seq_file.h> @@ -236,9 +244,13 @@ static int option_set(void *data, u64 val) { u32 *option = data; - *option = val; - if (option == &enable_off_mode) { + if (global_disable_off_mode) { + pr_warn("Disable global_disable_off_mode " + "before enabling off mode"); + return -EINVAL; + } + if (val) omap_pm_enable_off_mode(); else @@ -247,6 +259,8 @@ static int option_set(void *data, u64 val) omap3_pm_off_mode_enable(val); } + *option = val; + return 0; } diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index cc7a5d5275b..8f5d6c2a2a0 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -61,6 +61,8 @@ #define OMAP3_SECURE_RAM_CTX_ADDR 0x83036000 +extern bool global_disable_off_mode; + /* pm34xx errata defined in pm.h */ u16 pm34xx_errata; bool suspend_debug; @@ -820,7 +822,7 @@ int __init omap3_pm_init(void) omap_pm_suspend = omap3_pm_suspend; #endif - if (omap_pm_get_off_mode()) + if (omap_pm_get_off_mode() && !global_disable_off_mode) omap3_pm_off_mode_enable(true); arm_pm_idle = omap3_pm_idle; |