diff options
| author | avinash philip <avinashphilip@ti.com> | 2013-06-17 14:46:38 -0400 |
|---|---|---|
| committer | Tony Lindgren <tony@atomide.com> | 2013-06-18 06:46:39 -0400 |
| commit | b536dd412b4364df2f9495c6550ee38f6ad3b0fe (patch) | |
| tree | 04cc5bc10a7107e10cf513bded00daca9fac8624 | |
| parent | b3f5525c55ce5cb67af06f04dbbf28358da23a2c (diff) | |
ARM: OMAP2+: gpmc: Low power transition support
GPMC is hardware controller for external memory interfaces.
This patch adds suspend/resume support for GPMC driver.
It also preserves GPMC register configurations across device low-power states
in which GPMC hardware can be powered-off.
gpmc_suspend()/gpmc_resume() are called by default by core PM framework as part
of driver's runtime PM callbacks.
Signed-off-by: Philip Avinash <avinashphilip@ti.com>
Signed-off-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
| -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 bac18b3ebbfb..1c7969e965d7 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) | |||
| 1669 | return 0; | 1669 | return 0; |
| 1670 | } | 1670 | } |
| 1671 | 1671 | ||
| 1672 | #ifdef CONFIG_PM_SLEEP | ||
| 1673 | static int gpmc_suspend(struct device *dev) | ||
| 1674 | { | ||
| 1675 | omap3_gpmc_save_context(); | ||
| 1676 | pm_runtime_put_sync(dev); | ||
| 1677 | return 0; | ||
| 1678 | } | ||
| 1679 | |||
| 1680 | static int gpmc_resume(struct device *dev) | ||
| 1681 | { | ||
| 1682 | pm_runtime_get_sync(dev); | ||
| 1683 | omap3_gpmc_restore_context(); | ||
| 1684 | return 0; | ||
| 1685 | } | ||
| 1686 | #endif | ||
| 1687 | |||
| 1688 | static SIMPLE_DEV_PM_OPS(gpmc_pm_ops, gpmc_suspend, gpmc_resume); | ||
| 1689 | |||
| 1672 | static struct platform_driver gpmc_driver = { | 1690 | static struct platform_driver gpmc_driver = { |
| 1673 | .probe = gpmc_probe, | 1691 | .probe = gpmc_probe, |
| 1674 | .remove = gpmc_remove, | 1692 | .remove = gpmc_remove, |
| @@ -1676,6 +1694,7 @@ static struct platform_driver gpmc_driver = { | |||
| 1676 | .name = DEVICE_NAME, | 1694 | .name = DEVICE_NAME, |
| 1677 | .owner = THIS_MODULE, | 1695 | .owner = THIS_MODULE, |
| 1678 | .of_match_table = of_match_ptr(gpmc_dt_ids), | 1696 | .of_match_table = of_match_ptr(gpmc_dt_ids), |
| 1697 | .pm = &gpmc_pm_ops, | ||
| 1679 | }, | 1698 | }, |
| 1680 | }; | 1699 | }; |
| 1681 | 1700 | ||
| @@ -1738,7 +1757,6 @@ static irqreturn_t gpmc_handle_irq(int irq, void *dev) | |||
| 1738 | return IRQ_HANDLED; | 1757 | return IRQ_HANDLED; |
| 1739 | } | 1758 | } |
| 1740 | 1759 | ||
| 1741 | #ifdef CONFIG_ARCH_OMAP3 | ||
| 1742 | static struct omap3_gpmc_regs gpmc_context; | 1760 | static struct omap3_gpmc_regs gpmc_context; |
| 1743 | 1761 | ||
| 1744 | void omap3_gpmc_save_context(void) | 1762 | void omap3_gpmc_save_context(void) |
| @@ -1803,4 +1821,3 @@ void omap3_gpmc_restore_context(void) | |||
| 1803 | } | 1821 | } |
| 1804 | } | 1822 | } |
| 1805 | } | 1823 | } |
| 1806 | #endif /* CONFIG_ARCH_OMAP3 */ | ||
