Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163147
b: refs/heads/master
c: 68d4778
h: refs/heads/master
i:
  163145: 477170a
  163143: d4c6b85
v: v3
  • Loading branch information
Tero Kristo authored and Kevin Hilman committed Sep 2, 2009
1 parent 845416a commit ff1fab5
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2811d6b3237c9b77007a6b2b10ee5b576da0574e
refs/heads/master: 68d4778c701b7e22ddfd64e3afb6628c92718ad2
31 changes: 29 additions & 2 deletions trunk/arch/arm/mach-omap2/pm-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/module.h>

#include <mach/clock.h>
#include <mach/board.h>
Expand Down Expand Up @@ -484,10 +485,28 @@ int pm_dbg_regset_init(int reg_set)
return 0;
}

static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
static int pwrdm_suspend_get(void *data, u64 *val)
{
*val = omap3_pm_get_suspend_state((struct powerdomain *)data);

if (*val >= 0)
return 0;
return *val;
}

static int pwrdm_suspend_set(void *data, u64 val)
{
return omap3_pm_set_suspend_state((struct powerdomain *)data, (int)val);
}

DEFINE_SIMPLE_ATTRIBUTE(pwrdm_suspend_fops, pwrdm_suspend_get,
pwrdm_suspend_set, "%llu\n");

static int __init pwrdms_setup(struct powerdomain *pwrdm, void *dir)
{
int i;
s64 t;
struct dentry *d;

t = sched_clock();

Expand All @@ -496,6 +515,14 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)

pwrdm->timer = t;

if (strncmp(pwrdm->name, "dpll", 4) == 0)
return 0;

d = debugfs_create_dir(pwrdm->name, (struct dentry *)dir);

(void) debugfs_create_file("suspend", S_IRUGO|S_IWUSR, d,
(void *)pwrdm, &pwrdm_suspend_fops);

return 0;
}

Expand Down Expand Up @@ -524,7 +551,7 @@ static int __init pm_dbg_init(void)
(void) debugfs_create_file("time", S_IRUGO,
d, (void *)DEBUG_FILE_TIMERS, &debug_fops);

pwrdm_for_each(pwrdms_setup, NULL);
pwrdm_for_each(pwrdms_setup, (void *)d);

pm_dbg_dir = debugfs_create_dir("registers", d);
if (IS_ERR(pm_dbg_dir))
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/mach-omap2/pm.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

#include <mach/powerdomain.h>

extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm);
extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state);

#ifdef CONFIG_PM_DEBUG
extern void omap2_pm_dump(int mode, int resume, unsigned int us);
extern int omap2_pm_debug;
Expand Down
24 changes: 24 additions & 0 deletions trunk/arch/arm/mach-omap2/pm34xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,30 @@ static void __init prcm_setup_regs(void)
omap3_d2d_idle();
}

int omap3_pm_get_suspend_state(struct powerdomain *pwrdm)
{
struct power_state *pwrst;

list_for_each_entry(pwrst, &pwrst_list, node) {
if (pwrst->pwrdm == pwrdm)
return pwrst->next_state;
}
return -EINVAL;
}

int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state)
{
struct power_state *pwrst;

list_for_each_entry(pwrst, &pwrst_list, node) {
if (pwrst->pwrdm == pwrdm) {
pwrst->next_state = state;
return 0;
}
}
return -EINVAL;
}

static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
{
struct power_state *pwrst;
Expand Down

0 comments on commit ff1fab5

Please sign in to comment.