diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-06-20 21:40:15 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2013-06-20 21:40:15 +0200 |
commit | 8fe14e5a74d3f45589c83c06ed63b5c8a376a824 (patch) | |
tree | c8e30fcbc8145a09960ead3ccc17fea5aacebe05 /arch | |
parent | 30d2266c685ce9f560e5023e4add58f890554a46 (diff) | |
parent | b536dd412b4364df2f9495c6550ee38f6ad3b0fe (diff) | |
download | op-kernel-dev-8fe14e5a74d3f45589c83c06ed63b5c8a376a824.zip op-kernel-dev-8fe14e5a74d3f45589c83c06ed63b5c8a376a824.tar.gz |
Merge tag 'omap-for-v3.11/gpmc-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/drivers
From Tony Lindgren:
GPMC suspend patch that was left out of the earlier
omap-for-v3.11/gpmc-signed branch because of a compile error
it caused. The compile error is fixed in this version.
* tag 'omap-for-v3.11/gpmc-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
ARM: OMAP2+: gpmc: Low power transition support
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/gpmc.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index bac18b3..1c7969e 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c @@ -1669,6 +1669,24 @@ static int gpmc_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM_SLEEP +static int gpmc_suspend(struct device *dev) +{ + omap3_gpmc_save_context(); + pm_runtime_put_sync(dev); + return 0; +} + +static int gpmc_resume(struct device *dev) +{ + pm_runtime_get_sync(dev); + omap3_gpmc_restore_context(); + return 0; +} +#endif + +static SIMPLE_DEV_PM_OPS(gpmc_pm_ops, gpmc_suspend, gpmc_resume); + static struct platform_driver gpmc_driver = { .probe = gpmc_probe, .remove = gpmc_remove, @@ -1676,6 +1694,7 @@ static struct platform_driver gpmc_driver = { .name = DEVICE_NAME, .owner = THIS_MODULE, .of_match_table = of_match_ptr(gpmc_dt_ids), + .pm = &gpmc_pm_ops, }, }; @@ -1738,7 +1757,6 @@ static irqreturn_t gpmc_handle_irq(int irq, void *dev) return IRQ_HANDLED; } -#ifdef CONFIG_ARCH_OMAP3 static struct omap3_gpmc_regs gpmc_context; void omap3_gpmc_save_context(void) @@ -1803,4 +1821,3 @@ void omap3_gpmc_restore_context(void) } } } -#endif /* CONFIG_ARCH_OMAP3 */ |