Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256940
b: refs/heads/master
c: 775b8ae
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Rafael J. Wysocki committed Jul 10, 2011
1 parent a9fd85f commit 2dafc72
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 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: 18b4f3f5d058b590e7189027eeb5d897742ade0a
refs/heads/master: 775b8ae8707592af9275b8b216c2bf056b3f5d82
45 changes: 42 additions & 3 deletions trunk/arch/arm/mach-shmobile/pm-sh7372.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,36 @@ static int pd_power_up(struct generic_pm_domain *genpd)
return ret;
}

static int pd_power_up_a3rv(struct generic_pm_domain *genpd)
{
int ret = pd_power_up(genpd);

/* force A4LC on after A3RV has been requested on */
pm_genpd_poweron(&sh7372_a4lc.genpd);

return ret;
}

static int pd_power_down_a3rv(struct generic_pm_domain *genpd)
{
int ret = pd_power_down(genpd);

/* try to power down A4LC after A3RV is requested off */
pm_genpd_poweron(&sh7372_a4lc.genpd);
queue_work(pm_wq, &sh7372_a4lc.genpd.power_off_work);

return ret;
}

static int pd_power_down_a4lc(struct generic_pm_domain *genpd)
{
/* only power down A4LC if A3RV is off */
if (!(__raw_readl(PSTR) & (1 << sh7372_a3rv.bit_shift)))
return pd_power_down(genpd);

return 0;
}

static bool pd_active_wakeup(struct device *dev)
{
return true;
Expand All @@ -115,9 +145,18 @@ void sh7372_init_pm_domain(struct sh7372_pm_domain *sh7372_pd)
genpd->stop_device = pm_clk_suspend;
genpd->start_device = pm_clk_resume;
genpd->active_wakeup = pd_active_wakeup;
genpd->power_off = pd_power_down;
genpd->power_on = pd_power_up;
pd_power_up(&sh7372_pd->genpd);

if (sh7372_pd == &sh7372_a4lc) {
genpd->power_off = pd_power_down_a4lc;
genpd->power_on = pd_power_up;
} else if (sh7372_pd == &sh7372_a3rv) {
genpd->power_off = pd_power_down_a3rv;
genpd->power_on = pd_power_up_a3rv;
} else {
genpd->power_off = pd_power_down;
genpd->power_on = pd_power_up;
}
genpd->power_on(&sh7372_pd->genpd);

shmobile_runtime_pm_late_init = sh7372_late_pm_domain_off;
}
Expand Down

0 comments on commit 2dafc72

Please sign in to comment.