aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm-debug.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-01-04 19:17:33 -0500
committerTejun Heo <tj@kernel.org>2010-01-04 19:17:33 -0500
commit32032df6c2f6c9c6b2ada2ce42322231824f70c2 (patch)
treeb1ce838a37044bb38dfc128e2116ca35630e629a /arch/arm/mach-omap2/pm-debug.c
parent22b737f4c75197372d64afc6ed1bccd58c00e549 (diff)
parentc5974b835a909ff15c3b7e6cf6789b5eb919f419 (diff)
Merge branch 'master' into percpu
Conflicts: arch/powerpc/platforms/pseries/hvCall.S include/linux/percpu.h
Diffstat (limited to 'arch/arm/mach-omap2/pm-debug.c')
-rw-r--r--arch/arm/mach-omap2/pm-debug.c48
1 files changed, 39 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c
index 1b4c1600f8d8..860b755d2220 100644
--- a/arch/arm/mach-omap2/pm-debug.c
+++ b/arch/arm/mach-omap2/pm-debug.c
@@ -26,10 +26,10 @@
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/module.h> 27#include <linux/module.h>
28 28
29#include <mach/clock.h> 29#include <plat/clock.h>
30#include <mach/board.h> 30#include <plat/board.h>
31#include <mach/powerdomain.h> 31#include <plat/powerdomain.h>
32#include <mach/clockdomain.h> 32#include <plat/clockdomain.h>
33 33
34#include "prm.h" 34#include "prm.h"
35#include "cm.h" 35#include "cm.h"
@@ -51,7 +51,8 @@ int omap2_pm_debug;
51 regs[reg_count++].val = __raw_readl(reg) 51 regs[reg_count++].val = __raw_readl(reg)
52#define DUMP_INTC_REG(reg, off) \ 52#define DUMP_INTC_REG(reg, off) \
53 regs[reg_count].name = #reg; \ 53 regs[reg_count].name = #reg; \
54 regs[reg_count++].val = __raw_readl(OMAP2_IO_ADDRESS(0x480fe000 + (off))) 54 regs[reg_count++].val = \
55 __raw_readl(OMAP2_L4_IO_ADDRESS(0x480fe000 + (off)))
55 56
56static int __init pm_dbg_init(void); 57static int __init pm_dbg_init(void);
57 58
@@ -325,7 +326,7 @@ int pm_dbg_regset_save(int reg_set)
325 return 0; 326 return 0;
326} 327}
327 328
328static const char pwrdm_state_names[][4] = { 329static const char pwrdm_state_names[][PWRDM_MAX_PWRSTS] = {
329 "OFF", 330 "OFF",
330 "RET", 331 "RET",
331 "INA", 332 "INA",
@@ -380,7 +381,7 @@ static int pwrdm_dbg_show_counter(struct powerdomain *pwrdm, void *user)
380 381
381 seq_printf(s, "%s (%s)", pwrdm->name, 382 seq_printf(s, "%s (%s)", pwrdm->name,
382 pwrdm_state_names[pwrdm->state]); 383 pwrdm_state_names[pwrdm->state]);
383 for (i = 0; i < 4; i++) 384 for (i = 0; i < PWRDM_MAX_PWRSTS; i++)
384 seq_printf(s, ",%s:%d", pwrdm_state_names[i], 385 seq_printf(s, ",%s:%d", pwrdm_state_names[i],
385 pwrdm->state_counter[i]); 386 pwrdm->state_counter[i]);
386 387
@@ -526,6 +527,29 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
526 return 0; 527 return 0;
527} 528}
528 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
529static int __init pm_dbg_init(void) 553static int __init pm_dbg_init(void)
530{ 554{
531 int i; 555 int i;
@@ -541,7 +565,7 @@ static int __init pm_dbg_init(void)
541 printk(KERN_ERR "%s: only OMAP3 supported\n", __func__); 565 printk(KERN_ERR "%s: only OMAP3 supported\n", __func__);
542 return -ENODEV; 566 return -ENODEV;
543 } 567 }
544 568
545 d = debugfs_create_dir("pm_debug", NULL); 569 d = debugfs_create_dir("pm_debug", NULL);
546 if (IS_ERR(d)) 570 if (IS_ERR(d))
547 return PTR_ERR(d); 571 return PTR_ERR(d);
@@ -551,7 +575,7 @@ static int __init pm_dbg_init(void)
551 (void) debugfs_create_file("time", S_IRUGO, 575 (void) debugfs_create_file("time", S_IRUGO,
552 d, (void *)DEBUG_FILE_TIMERS, &debug_fops); 576 d, (void *)DEBUG_FILE_TIMERS, &debug_fops);
553 577
554 pwrdm_for_each(pwrdms_setup, (void *)d); 578 pwrdm_for_each_nolock(pwrdms_setup, (void *)d);
555 579
556 pm_dbg_dir = debugfs_create_dir("registers", d); 580 pm_dbg_dir = debugfs_create_dir("registers", d);
557 if (IS_ERR(pm_dbg_dir)) 581 if (IS_ERR(pm_dbg_dir))
@@ -568,6 +592,12 @@ static int __init pm_dbg_init(void)
568 592
569 } 593 }
570 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);
599 (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d,
600 &wakeup_timer_seconds, &pm_dbg_option_fops);
571 pm_dbg_init_done = 1; 601 pm_dbg_init_done = 1;
572 602
573 return 0; 603 return 0;