aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm-debug.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@deeprootsystems.com>2009-10-06 17:25:09 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-11 17:42:27 -0500
commitc40552bc82166adb21a1a7fcb1dc4e76352b1b79 (patch)
tree3625838f286478e88ccc3a3be09b1c330149106c /arch/arm/mach-omap2/pm-debug.c
parent89139dce8a0060d97a46cebde570a8f55c314712 (diff)
OMAP3: PM debug: allow runtime toggle of PM features
Allow enable/disable of low-power states during idle. To enable low-power idle: echo 1 > /debug/pm_debug/sleep_while_idle to disable: echo 0 > /debug/pm_debug/sleep_while_idle Also allow enable/disable of OFF-mode. To enable: echo 1 > /debug/pm_debug/enable_off_mode to disable: echo 0 > /debug/pm_debug/enable_off_mode Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm-debug.c')
-rw-r--r--arch/arm/mach-omap2/pm-debug.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 7eb2c12c8b7c..1725da3f4e18 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -527,6 +527,29 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
527 return 0; 527 return 0;
528} 528}
529 529
530static int option_get(void *data, u64 *val)
531{
532 u32 *option = data;
533
534 *val = *option;
535
536 return 0;
537}
538
539static int option_set(void *data, u64 val)
540{
541 u32 *option = data;
542
543 *option = val;
544
545 if (option == &enable_off_mode)
546 omap3_pm_off_mode_enable(val);
547
548 return 0;
549}
550
551DEFINE_SIMPLE_ATTRIBUTE(pm_dbg_option_fops, option_get, option_set, "%llu\n");
552
530static int __init pm_dbg_init(void) 553static int __init pm_dbg_init(void)
531{ 554{
532 int i; 555 int i;
@@ -569,6 +592,10 @@ static int __init pm_dbg_init(void)
569 592
570 } 593 }
571 594
595 (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d,
596 &enable_off_mode, &pm_dbg_option_fops);
597 (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d,
598 &sleep_while_idle, &pm_dbg_option_fops);
572 pm_dbg_init_done = 1; 599 pm_dbg_init_done = 1;
573 600
574 return 0; 601 return 0;