summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/pm-debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/pm-debug.c')
-rw-r--r--arch/arm/mach-omap2/pm-debug.c18
1 files changed, 16 insertions, 2 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;
}