diff options
| -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; |