diff options
author | Tero Kristo <tero.kristo@nokia.com> | 2008-11-26 05:26:24 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-09-02 18:08:25 -0400 |
commit | 68d4778c701b7e22ddfd64e3afb6628c92718ad2 (patch) | |
tree | c61556bd625a4c62f4429d00088f7abbae2d5a52 /arch/arm/mach-omap2/pm-debug.c | |
parent | 2811d6b3237c9b77007a6b2b10ee5b576da0574e (diff) |
OMAP: PM: Added suspend target state control to debugfs for OMAP3
Target state can be read / programmed via files under:
[debugfs]/pm_debug/[pwrdm]/suspend
Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
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.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 982aa67f2685..1b4c1600f8d8 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/module.h> | ||
27 | 28 | ||
28 | #include <mach/clock.h> | 29 | #include <mach/clock.h> |
29 | #include <mach/board.h> | 30 | #include <mach/board.h> |
@@ -484,10 +485,28 @@ int pm_dbg_regset_init(int reg_set) | |||
484 | return 0; | 485 | return 0; |
485 | } | 486 | } |
486 | 487 | ||
487 | static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) | 488 | static int pwrdm_suspend_get(void *data, u64 *val) |
489 | { | ||
490 | *val = omap3_pm_get_suspend_state((struct powerdomain *)data); | ||
491 | |||
492 | if (*val >= 0) | ||
493 | return 0; | ||
494 | return *val; | ||
495 | } | ||
496 | |||
497 | static int pwrdm_suspend_set(void *data, u64 val) | ||
498 | { | ||
499 | return omap3_pm_set_suspend_state((struct powerdomain *)data, (int)val); | ||
500 | } | ||
501 | |||
502 | DEFINE_SIMPLE_ATTRIBUTE(pwrdm_suspend_fops, pwrdm_suspend_get, | ||
503 | pwrdm_suspend_set, "%llu\n"); | ||
504 | |||
505 | static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir) | ||
488 | { | 506 | { |
489 | int i; | 507 | int i; |
490 | s64 t; | 508 | s64 t; |
509 | struct dentry *d; | ||
491 | 510 | ||
492 | t = sched_clock(); | 511 | t = sched_clock(); |
493 | 512 | ||
@@ -496,6 +515,14 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) | |||
496 | 515 | ||
497 | pwrdm->timer = t; | 516 | pwrdm->timer = t; |
498 | 517 | ||
518 | if (strncmp(pwrdm->name, "dpll", 4) == 0) | ||
519 | return 0; | ||
520 | |||
521 | d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir); | ||
522 | |||
523 | (void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d, | ||
524 | (void *)pwrdm, &pwrdm_suspend_fops); | ||
525 | |||
499 | return 0; | 526 | return 0; |
500 | } | 527 | } |
501 | 528 | ||
@@ -524,7 +551,7 @@ static int __init pm_dbg_init(void) | |||
524 | (void) debugfs_create_file("time", S_IRUGO, | 551 | (void) debugfs_create_file("time", S_IRUGO, |
525 | d, (void *)DEBUG_FILE_TIMERS, &debug_fops); | 552 | d, (void *)DEBUG_FILE_TIMERS, &debug_fops); |
526 | 553 | ||
527 | pwrdm_for_each(pwrdms_setup, NULL); | 554 | pwrdm_for_each(pwrdms_setup, (void *)d); |
528 | 555 | ||
529 | pm_dbg_dir = debugfs_create_dir("registers", d); | 556 | pm_dbg_dir = debugfs_create_dir("registers", d); |
530 | if (IS_ERR(pm_dbg_dir)) | 557 | if (IS_ERR(pm_dbg_dir)) |