diff options
Diffstat (limited to 'arch/arm/mach-omap2/pm-debug.c')
-rw-r--r-- | arch/arm/mach-omap2/pm-debug.c | 48 |
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 | ||
56 | static int __init pm_dbg_init(void); | 57 | static 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 | ||
328 | static const char pwrdm_state_names[][4] = { | 329 | static 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 | ||
530 | static int option_get(void *data, u64 *val) | ||
531 | { | ||
532 | u32 *option = data; | ||
533 | |||
534 | *val = *option; | ||
535 | |||
536 | return 0; | ||
537 | } | ||
538 | |||
539 | static 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 | |||
551 | DEFINE_SIMPLE_ATTRIBUTE(pm_dbg_option_fops, option_get, option_set, "%llu\n"); | ||
552 | |||
529 | static int __init pm_dbg_init(void) | 553 | static 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; |