suspend/resume support for OMAP nand driver
Subsystems (6)
PATCH v4 2/3 arm: gpmc: Low power transition support
In reply to Pekon GuptaFrom: avinash philip <[email protected]>
With GPMC converted to platform driver recently, adds low power transition support in driver itself.
--- arch/arm/mach-omap2/gpmc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/arm/mach-omap2/gpmc.c +19 -0
@@ -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, }, };
Signature · 1 line
1.8.1
v4 cover suspend/resume support for OMAP nand driver
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(-)
Signature · 1 line
1.8.1
PATCH v4 1/3 arm: gpmc: Converts GPMC driver to pm_runtime capable
From: avinash philip <[email protected]>
Support for pm_runtime add to GPMC driver.
--- arch/arm/mach-omap2/gpmc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/gpmc.c +6 -2
@@ -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 ; }
Signature · 1 line
1.8.1
PATCH v4 3/3 mtd: devices: elm: Low power transition support
In reply to Pekon GuptaFrom: avinash philip <[email protected]>
In low power modes of AM335X platforms, peripherals power is cut off. This patch supports low power sleep transition support for ELM driver.
--- drivers/mtd/devices/elm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/mtd/devices/elm.c +19 -0
@@ -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,
Signature · 1 line
1.8.1
Tony Lindgren
maintainerRe: [PATCH v4 2/3] arm: gpmc: Low power transition support
In reply to Pekon GuptaQuoted 4 lines · Pekon Gupta
From: avinash philip <[email protected]>
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
maintainerRe: [PATCH v4 2/3] arm: gpmc: Low power transition support
Quoted 10 lines · Tony Lindgren
Quoted 4 lines · Pekon Gupta
From: avinash philip <[email protected]>
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