Patchwork [v4,2/3] arm: gpmc: Low power transition support

login
register
mail settings
Submitter pekon gupta
Date June 12, 2013, 11 a.m.
Message ID <1371034858-19984-3-git-send-email-pekon@ti.com>
Download mbox | patch
Permalink /patch/250728/
State Not Applicable
Headers show

Comments

pekon gupta - June 12, 2013, 11 a.m.
From: avinash philip <avinashphilip@ti.com>

With GPMC converted to platform driver recently, adds low power
transition support in driver itself.

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
Signed-off-by: Pekon Gupta <pekon@ti.com>
---
 arch/arm/mach-omap2/gpmc.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
Tony Lindgren - June 12, 2013, 5:01 p.m.
* Pekon Gupta <pekon@ti.com> [130612 04:07]:
> From: avinash philip <avinashphilip@ti.com>
> 
> With GPMC converted to platform driver recently, adds low power
> transition support in driver itself.

Applying the first two patches of this series into omap-for-v3.11/gpmc.
Not taking the MTD patch, if it has dependencies to the first two
patches please let me know and also get an ack from Artem if you
want me to take it.

Regards,

Tony
Tony Lindgren - June 12, 2013, 5:38 p.m.
* Tony Lindgren <tony@atomide.com> [130612 10:08]:
> * Pekon Gupta <pekon@ti.com> [130612 04:07]:
> > From: avinash philip <avinashphilip@ti.com>
> > 
> > With GPMC converted to platform driver recently, adds low power
> > transition support in driver itself.
> 
> Applying the first two patches of this series into omap-for-v3.11/gpmc.
> Not taking the MTD patch, if it has dependencies to the first two
> patches please let me know and also get an ack from Artem if you
> want me to take it.

Oops, dropping the second patch in this series as it causes the
following if only omap4 is selected for example:

arch/arm/mach-omap2/built-in.o: In function `gpmc_resume':
dss-common.c:(.text+0x9a8): undefined reference to `omap3_gpmc_restore_context'
arch/arm/mach-omap2/built-in.o: In function `gpmc_suspend':
dss-common.c:(.text+0x9c8): undefined reference to `omap3_gpmc_save_context'

Can you please take a lok and fix that?

Regards,

Tony

Patch

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index 1380cee..b5c4752 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -1655,6 +1655,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,
@@ -1662,6 +1680,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,
 	},
 };