diff options
Diffstat (limited to 'arch/arm/mach-omap2/pm-debug.c')
| -rw-r--r-- | arch/arm/mach-omap2/pm-debug.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 0b339861d75..119e6756883 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -36,8 +36,17 @@ #include "cm2xxx_3xxx.h" #include "prm2xxx_3xxx.h" #include "pm.h" +#include "pm-debug-regs.h" -u32 enable_off_mode; +/* enable_off_mode is the runtime flag for enable/disable of offmode */ +u32 enable_off_mode = 1; + +/* + * global_disable_off_mode supercedes enable_off_mode and keeps + * offmode disabled as long as it is set + */ +bool global_disable_off_mode = 0; +module_param(global_disable_off_mode, bool, 0644); #ifdef CONFIG_DEBUG_FS #include <linux/debugfs.h> @@ -226,9 +235,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir) static int option_get(void *data, u64 *val) { - u32 *option = data; - - *val = *option; + *val = omap_pm_get_off_mode(); return 0; } @@ -237,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 @@ -248,6 +259,8 @@ static int option_set(void *data, u64 val) omap3_pm_off_mode_enable(val); } + *option = val; + return 0; } @@ -273,6 +286,9 @@ static int __init pm_dbg_init(void) (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d, &enable_off_mode, &pm_dbg_option_fops); + + pm_dbg_regs_init(d); + pm_dbg_init_done = 1; return 0; |