linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [v4 0/3] suspend/resume support for OMAP nand driver
@ 2013-06-12 10:25 Pekon Gupta
  2013-06-12 10:25 ` [v4 1/3] arm: gpmc: Converts GPMC driver to pm_runtime capable Pekon Gupta
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Pekon Gupta @ 2013-06-12 10:25 UTC (permalink / raw)
  To: linux-mtd, linux-omap, tony; +Cc: Pekon Gupta

This patch series adds low power transition support for OMAP NAND driver.
[Patch 1/3]: Adds pm_runtime calls to handle GPMC module probe and remove
[Patch 2/3]: Adds GPMC suspend/resume support.
[Patch 3/3]: Adds ELM suspend/resume support.

Tested on am335x-evm with NAND flash support, using following:
	echo devices 	> /sys/power/pm_test
	echo mem	> /sys/power/state

	echo core	> /sys/power/pm_test
	echo mem	> /sys/power/state

Changes Since v3:
- CONFIG_PM -> CONFIG_PM_SLEEP
- using struct dev_pm_ops via driver->pm, instead of struct platform_driver
- rebased to 3.10-rc5

Changes Since v2:
- Remove calll back of nand_suspend from omap2 nand driver, as the same call
  already done from suspend activity mtd class driver.

[1] http://comments.gmane.org/gmane.linux.ports.arm.omap/91405


avinash philip (3):
  arm: gpmc: Converts GPMC driver to pm_runtime capable
  arm: gpmc: Low power transition support
  mtd: devices: elm: Low power transition support

 arch/arm/mach-omap2/gpmc.c | 27 +++++++++++++++++++++++++--
 drivers/mtd/devices/elm.c  | 19 +++++++++++++++++++
 2 files changed, 44 insertions(+), 2 deletions(-)

-- 
1.8.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [v4 1/3] arm: gpmc: Converts GPMC driver to pm_runtime capable
  2013-06-12 10:25 [v4 0/3] suspend/resume support for OMAP nand driver Pekon Gupta
@ 2013-06-12 10:25 ` Pekon Gupta
  2013-06-12 10:25 ` [v4 2/3] arm: gpmc: Low power transition support Pekon Gupta
  2013-06-12 10:25 ` [v4 3/3] mtd: devices: elm: " Pekon Gupta
  2 siblings, 0 replies; 6+ messages in thread
From: Pekon Gupta @ 2013-06-12 10:25 UTC (permalink / raw)
  To: linux-mtd, linux-omap, tony; +Cc: avinash philip, Pekon Gupta

From: avinash philip <avinashphilip@ti.com>

Support for pm_runtime add to GPMC driver.

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
Signed-off-by: Pekon Gupta <pekon@ti.com>
---
 arch/arm/mach-omap2/gpmc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
index fb6f241..1380cee 100644
--- a/arch/arm/mach-omap2/gpmc.c
+++ b/arch/arm/mach-omap2/gpmc.c
@@ -30,6 +30,7 @@
 #include <linux/of_mtd.h>
 #include <linux/of_device.h>
 #include <linux/mtd/nand.h>
+#include <linux/pm_runtime.h>
 
 #include <linux/platform_data/mtd-nand-omap2.h>
 
@@ -1594,7 +1595,8 @@ static int gpmc_probe(struct platform_device *pdev)
 		return PTR_ERR(gpmc_l3_clk);
 	}
 
-	clk_prepare_enable(gpmc_l3_clk);
+	pm_runtime_enable(&pdev->dev);
+	pm_runtime_get_sync(&pdev->dev);
 
 	gpmc_dev = &pdev->dev;
 
@@ -1634,7 +1636,7 @@ static int gpmc_probe(struct platform_device *pdev)
 
 	rc = gpmc_probe_dt(pdev);
 	if (rc < 0) {
-		clk_disable_unprepare(gpmc_l3_clk);
+		pm_runtime_put_sync(&pdev->dev);
 		clk_put(gpmc_l3_clk);
 		dev_err(gpmc_dev, "failed to probe DT parameters\n");
 		return rc;
@@ -1647,6 +1649,8 @@ static int gpmc_remove(struct platform_device *pdev)
 {
 	gpmc_free_irq();
 	gpmc_mem_exit();
+	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_disable(&pdev->dev);
 	gpmc_dev = NULL;
 	return 0;
 }
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [v4 2/3] arm: gpmc: Low power transition support
  2013-06-12 10:25 [v4 0/3] suspend/resume support for OMAP nand driver Pekon Gupta
  2013-06-12 10:25 ` [v4 1/3] arm: gpmc: Converts GPMC driver to pm_runtime capable Pekon Gupta
@ 2013-06-12 10:25 ` Pekon Gupta
  2013-06-13 20:19   ` Kevin Hilman
  2013-06-12 10:25 ` [v4 3/3] mtd: devices: elm: " Pekon Gupta
  2 siblings, 1 reply; 6+ messages in thread
From: Pekon Gupta @ 2013-06-12 10:25 UTC (permalink / raw)
  To: linux-mtd, linux-omap, tony; +Cc: avinash philip, Pekon Gupta

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(+)

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,
 	},
 };
 
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [v4 3/3] mtd: devices: elm: Low power transition support
  2013-06-12 10:25 [v4 0/3] suspend/resume support for OMAP nand driver Pekon Gupta
  2013-06-12 10:25 ` [v4 1/3] arm: gpmc: Converts GPMC driver to pm_runtime capable Pekon Gupta
  2013-06-12 10:25 ` [v4 2/3] arm: gpmc: Low power transition support Pekon Gupta
@ 2013-06-12 10:25 ` Pekon Gupta
  2013-06-13 21:03   ` Kevin Hilman
  2 siblings, 1 reply; 6+ messages in thread
From: Pekon Gupta @ 2013-06-12 10:25 UTC (permalink / raw)
  To: linux-mtd, linux-omap, tony; +Cc: avinash philip, Pekon Gupta

From: avinash philip <avinashphilip@ti.com>

In low power modes of AM335X platforms, peripherals power is cut off.
This patch supports low power sleep transition support for ELM driver.

Signed-off-by: Philip Avinash <avinashphilip@ti.com>
Signed-off-by: Pekon Gupta <pekon@ti.com>
---
 drivers/mtd/devices/elm.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
index dccef9f..171efcd 100644
--- a/drivers/mtd/devices/elm.c
+++ b/drivers/mtd/devices/elm.c
@@ -20,6 +20,7 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/of.h>
+#include <linux/sched.h>
 #include <linux/pm_runtime.h>
 #include <linux/platform_data/elm.h>
 
@@ -385,6 +386,23 @@ static int elm_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static int elm_suspend(struct device *dev)
+{
+	pm_runtime_put_sync(dev);
+	return 0;
+}
+
+static int elm_resume(struct device *dev)
+{
+	struct elm_info *info = dev_get_drvdata(dev);
+
+	pm_runtime_get_sync(dev);
+	elm_config(dev, info->bch_type);
+	return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(elm_pm_ops, elm_suspend, elm_resume);
+
 #ifdef CONFIG_OF
 static const struct of_device_id elm_of_match[] = {
 	{ .compatible = "ti,am3352-elm" },
@@ -398,6 +416,7 @@ static struct platform_driver elm_driver = {
 		.name	= "elm",
 		.owner	= THIS_MODULE,
 		.of_match_table = of_match_ptr(elm_of_match),
+		.pm	= &elm_pm_ops,
 	},
 	.probe	= elm_probe,
 	.remove	= elm_remove,
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [v4 2/3] arm: gpmc: Low power transition support
  2013-06-12 10:25 ` [v4 2/3] arm: gpmc: Low power transition support Pekon Gupta
@ 2013-06-13 20:19   ` Kevin Hilman
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2013-06-13 20:19 UTC (permalink / raw)
  To: Pekon Gupta; +Cc: linux-mtd, linux-omap, tony, avinash philip

Pekon Gupta <pekon@ti.com> writes:

> From: avinash philip <avinashphilip@ti.com>
>
> With GPMC converted to platform driver recently, adds low power
> transition support in driver itself.

The subject/changelog should be clear that this is support for
suspend/resume.

Kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [v4 3/3] mtd: devices: elm: Low power transition support
  2013-06-12 10:25 ` [v4 3/3] mtd: devices: elm: " Pekon Gupta
@ 2013-06-13 21:03   ` Kevin Hilman
  0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2013-06-13 21:03 UTC (permalink / raw)
  To: Pekon Gupta; +Cc: linux-mtd, linux-omap, tony, avinash philip

Pekon Gupta <pekon@ti.com> writes:

> From: avinash philip <avinashphilip@ti.com>
>
> In low power modes of AM335X platforms, peripherals power is cut off.
> This patch supports low power sleep transition support for ELM driver.

This series needs a bit more description about what "low power sleep
transition" is, and how adding runtime PM calls makes this transition
happen.

Kevin

> Signed-off-by: Philip Avinash <avinashphilip@ti.com>
> Signed-off-by: Pekon Gupta <pekon@ti.com>
> ---
>  drivers/mtd/devices/elm.c | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/drivers/mtd/devices/elm.c b/drivers/mtd/devices/elm.c
> index dccef9f..171efcd 100644
> --- a/drivers/mtd/devices/elm.c
> +++ b/drivers/mtd/devices/elm.c
> @@ -20,6 +20,7 @@
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
>  #include <linux/of.h>
> +#include <linux/sched.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/platform_data/elm.h>
>  
> @@ -385,6 +386,23 @@ static int elm_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static int elm_suspend(struct device *dev)
> +{
> +	pm_runtime_put_sync(dev);
> +	return 0;
> +}
> +
> +static int elm_resume(struct device *dev)
> +{
> +	struct elm_info *info = dev_get_drvdata(dev);
> +
> +	pm_runtime_get_sync(dev);
> +	elm_config(dev, info->bch_type);
> +	return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(elm_pm_ops, elm_suspend, elm_resume);
> +
>  #ifdef CONFIG_OF
>  static const struct of_device_id elm_of_match[] = {
>  	{ .compatible = "ti,am3352-elm" },
> @@ -398,6 +416,7 @@ static struct platform_driver elm_driver = {
>  		.name	= "elm",
>  		.owner	= THIS_MODULE,
>  		.of_match_table = of_match_ptr(elm_of_match),
> +		.pm	= &elm_pm_ops,
>  	},
>  	.probe	= elm_probe,
>  	.remove	= elm_remove,

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-13 21:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-12 10:25 [v4 0/3] suspend/resume support for OMAP nand driver Pekon Gupta
2013-06-12 10:25 ` [v4 1/3] arm: gpmc: Converts GPMC driver to pm_runtime capable Pekon Gupta
2013-06-12 10:25 ` [v4 2/3] arm: gpmc: Low power transition support Pekon Gupta
2013-06-13 20:19   ` Kevin Hilman
2013-06-12 10:25 ` [v4 3/3] mtd: devices: elm: " Pekon Gupta
2013-06-13 21:03   ` Kevin Hilman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).