Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272720
b: refs/heads/master
c: 048a703
h: refs/heads/master
v: v3
  • Loading branch information
Kevin Hilman committed Sep 15, 2011
1 parent a28afa0 commit 53236ec
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e1b94059cea39218071fdb78c4075b83d52e222
refs/heads/master: 048a7034f1044e69868df70bff32d8d67974e1b8
21 changes: 21 additions & 0 deletions trunk/arch/arm/mach-omap2/powerdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static struct powerdomain *_pwrdm_lookup(const char *name)
static int _pwrdm_register(struct powerdomain *pwrdm)
{
int i;
struct voltagedomain *voltdm;

if (!pwrdm || !pwrdm->name)
return -EINVAL;
Expand All @@ -91,6 +92,14 @@ static int _pwrdm_register(struct powerdomain *pwrdm)
if (_pwrdm_lookup(pwrdm->name))
return -EEXIST;

voltdm = voltdm_lookup(pwrdm->voltdm.name);
if (!voltdm) {
pr_err("powerdomain: %s: voltagedomain %s does not exist\n",
pwrdm->name, pwrdm->voltdm.name);
return -EINVAL;
}
pwrdm->voltdm.ptr = voltdm;

list_add(&pwrdm->node, &pwrdm_list);

/* Initialize the powerdomain's state counter */
Expand Down Expand Up @@ -426,6 +435,18 @@ int pwrdm_for_each_clkdm(struct powerdomain *pwrdm,
return ret;
}

/**
* pwrdm_get_voltdm - return a ptr to the voltdm that this pwrdm resides in
* @pwrdm: struct powerdomain *
*
* Return a pointer to the struct voltageomain that the specified powerdomain
* @pwrdm exists in.
*/
struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm)
{
return pwrdm->voltdm.ptr;
}

/**
* pwrdm_get_mem_bank_count - get number of memory banks in this powerdomain
* @pwrdm: struct powerdomain *
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-omap2/powerdomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ int pwrdm_del_clkdm(struct powerdomain *pwrdm, struct clockdomain *clkdm);
int pwrdm_for_each_clkdm(struct powerdomain *pwrdm,
int (*fn)(struct powerdomain *pwrdm,
struct clockdomain *clkdm));
struct voltagedomain *pwrdm_get_voltdm(struct powerdomain *pwrdm);

int pwrdm_get_mem_bank_count(struct powerdomain *pwrdm);

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-omap2/voltage.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,5 @@ extern void omap44xx_voltagedomains_init(void);

struct voltagedomain *voltdm_lookup(const char *name);
void voltdm_init(struct voltagedomain **voltdm_list);
int voltdm_add_pwrdm(struct voltagedomain *voltdm, struct powerdomain *pwrdm);
#endif

0 comments on commit 53236ec

Please sign in to comment.