summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-09-09 17:40:38 +0530
committerUlf Hansson <ulf.hansson@stericsson.com>2011-09-19 16:07:27 +0200
commit531d3313d7b2d9d67c3294ef0412ff99003e4075 (patch)
treed00531bebe2e97a2d0bb5555f60f32fa46c13726
parentddf435ff6e5bc88fa2229ceac799aa0189978257 (diff)
ux500: pm: runtime: upgrade to 3.0
Support for changes in: commit 4d27e9dcff00a6425d779b065ec8892e4f391661 Author: Rafael J. Wysocki <rjw@sisk.pl> Date: Fri Apr 29 00:35:50 2011 +0200 PM: Make power domain callbacks take precedence over subsystem ones Change the PM core's behavior related to power domains in such a way that, if a power domain is defined for a given device, its callbacks will be executed instead of and not in addition to the device subsystem's PM callbacks. The idle->suspend happened earlier via the bus level runtime_idle which called pm_generic_runtime_idle(). We now need a power domain callback to do the same thing because of the above commit. The separate domains for amba and platform are required because the legacy suspend/resume callbacks need to be called via these specific functions. Change-Id: I1214db3e4e68d277bf30c73ef5b8bfbe066172b4 Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
-rw-r--r--arch/arm/mach-ux500/devices-common.c2
-rw-r--r--arch/arm/mach-ux500/pm/pm.h1
-rw-r--r--arch/arm/mach-ux500/pm/runtime.c44
3 files changed, 46 insertions, 1 deletions
diff --git a/arch/arm/mach-ux500/devices-common.c b/arch/arm/mach-ux500/devices-common.c
index 7818d957e7c..b01af37020c 100644
--- a/arch/arm/mach-ux500/devices-common.c
+++ b/arch/arm/mach-ux500/devices-common.c
@@ -44,7 +44,7 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
dev->dma_mask = DMA_BIT_MASK(32);
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
- dev->dev.pwr_domain = &ux500_dev_power_domain;
+ dev->dev.pwr_domain = &ux500_amba_dev_power_domain;
dev->irq[0] = irq;
dev->irq[1] = NO_IRQ;
diff --git a/arch/arm/mach-ux500/pm/pm.h b/arch/arm/mach-ux500/pm/pm.h
index 22625d6dc7d..8b58bd52e18 100644
--- a/arch/arm/mach-ux500/pm/pm.h
+++ b/arch/arm/mach-ux500/pm/pm.h
@@ -100,6 +100,7 @@ enum prcmu_idle_stat ux500_pm_prcmu_idle_stat(void);
struct dev_power_domain;
extern struct dev_power_domain ux500_dev_power_domain;
+extern struct dev_power_domain ux500_amba_dev_power_domain;
#else
u32 ux500_pm_gpio_read_wake_up_status(unsigned int bank_number)
diff --git a/arch/arm/mach-ux500/pm/runtime.c b/arch/arm/mach-ux500/pm/runtime.c
index 40b360b684b..f50d934bd2d 100644
--- a/arch/arm/mach-ux500/pm/runtime.c
+++ b/arch/arm/mach-ux500/pm/runtime.c
@@ -92,6 +92,11 @@ static void platform_pm_runtime_used(struct device *dev,
set_bit(BIT_ONCE, &prd->flags);
}
+static int ux500_pd_runtime_idle(struct device *dev)
+{
+ return pm_runtime_suspend(dev);
+}
+
static int ux500_pd_runtime_suspend(struct device *dev)
{
struct pm_runtime_data *prd = __to_prd(dev);
@@ -274,10 +279,49 @@ static int ux500_pd_bus_notify(struct notifier_block *nb,
#endif /* CONFIG_PM_RUNTIME */
+struct dev_power_domain ux500_amba_dev_power_domain = {
+ .ops = {
+ /* USE_AMBA_PM_SLEEP_OPS minus the two we replace */
+ .prepare = amba_pm_prepare,
+ .complete = amba_pm_complete,
+ .suspend = amba_pm_suspend,
+ .resume = amba_pm_resume,
+ .freeze = amba_pm_freeze,
+ .thaw = amba_pm_thaw,
+ .poweroff = amba_pm_poweroff,
+ .restore = amba_pm_restore,
+ .freeze_noirq = amba_pm_freeze_noirq,
+ .thaw_noirq = amba_pm_thaw_noirq,
+ .poweroff_noirq = amba_pm_poweroff_noirq,
+ .restore_noirq = amba_pm_restore_noirq,
+
+ .suspend_noirq = ux500_pd_suspend_noirq,
+ .resume_noirq = ux500_pd_resume_noirq,
+ .runtime_idle = ux500_pd_runtime_idle,
+ .runtime_suspend = ux500_pd_runtime_suspend,
+ .runtime_resume = ux500_pd_runtime_resume,
+ },
+};
+
struct dev_power_domain ux500_dev_power_domain = {
.ops = {
+ /* USE_PLATFORM_PM_SLEEP_OPS minus the two we replace */
+ .prepare = platform_pm_prepare,
+ .complete = platform_pm_complete,
+ .suspend = platform_pm_suspend,
+ .resume = platform_pm_resume,
+ .freeze = platform_pm_freeze,
+ .thaw = platform_pm_thaw,
+ .poweroff = platform_pm_poweroff,
+ .restore = platform_pm_restore,
+ .freeze_noirq = platform_pm_freeze_noirq,
+ .thaw_noirq = platform_pm_thaw_noirq,
+ .poweroff_noirq = platform_pm_poweroff_noirq,
+ .restore_noirq = platform_pm_restore_noirq,
+
.suspend_noirq = ux500_pd_suspend_noirq,
.resume_noirq = ux500_pd_resume_noirq,
+ .runtime_idle = ux500_pd_runtime_idle,
.runtime_suspend = ux500_pd_runtime_suspend,
.runtime_resume = ux500_pd_runtime_resume,
},