diff options
-rw-r--r-- | arch/arm/mach-ux500/devices-common.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-ux500/pm/pm.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-ux500/pm/runtime.c | 44 |
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, }, |