aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMagnus Damm <damm@igel.co.jp>2009-07-08 07:22:04 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2009-07-21 18:28:38 -0400
commit79ee031ff6fd23a1a2a4f783cfc3421885304ce3 (patch)
tree085ba3d5839af93bcda7c10c67906b58db4f14cd /arch
parentd7aacaddcac3971e33cf52d7e610c06696cb347f (diff)
ARM: Rework omap suspend_late()/resume_early()
This patch reworks platform driver power management code for omap drivers using late/early legacy callbacks. The callbacks are converted for CONFIG_SUSPEND like this: suspend_late() -> suspend_noirq() resume_early() -> resume_noirq() Signed-off-by: Magnus Damm <damm@igel.co.jp> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-omap/debug-leds.c11
-rw-r--r--arch/arm/plat-omap/gpio.c14
2 files changed, 17 insertions, 8 deletions
diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c
index be4eefda4767..9395898dd49a 100644
--- a/arch/arm/plat-omap/debug-leds.c
+++ b/arch/arm/plat-omap/debug-leds.c
@@ -281,24 +281,27 @@ static int /* __init */ fpga_probe(struct platform_device *pdev)
281 return 0; 281 return 0;
282} 282}
283 283
284static int fpga_suspend_late(struct platform_device *pdev, pm_message_t mesg) 284static int fpga_suspend_noirq(struct device *dev)
285{ 285{
286 __raw_writew(~0, &fpga->leds); 286 __raw_writew(~0, &fpga->leds);
287 return 0; 287 return 0;
288} 288}
289 289
290static int fpga_resume_early(struct platform_device *pdev) 290static int fpga_resume_noirq(struct device *dev)
291{ 291{
292 __raw_writew(~hw_led_state, &fpga->leds); 292 __raw_writew(~hw_led_state, &fpga->leds);
293 return 0; 293 return 0;
294} 294}
295 295
296static struct dev_pm_ops fpga_dev_pm_ops = {
297 .suspend_noirq = fpga_suspend_noirq,
298 .resume_noirq = fpga_resume_noirq,
299};
296 300
297static struct platform_driver led_driver = { 301static struct platform_driver led_driver = {
298 .driver.name = "omap_dbg_led", 302 .driver.name = "omap_dbg_led",
303 .driver.pm = &fpga_dev_pm_ops,
299 .probe = fpga_probe, 304 .probe = fpga_probe,
300 .suspend_late = fpga_suspend_late,
301 .resume_early = fpga_resume_early,
302}; 305};
303 306
304static int __init fpga_init(void) 307static int __init fpga_init(void)
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index 26b387c12423..3d03337ad422 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -1264,8 +1264,9 @@ static struct irq_chip mpuio_irq_chip = {
1264 1264
1265#include <linux/platform_device.h> 1265#include <linux/platform_device.h>
1266 1266
1267static int omap_mpuio_suspend_late(struct platform_device *pdev, pm_message_t mesg) 1267static int omap_mpuio_suspend_noirq(struct device *dev)
1268{ 1268{
1269 struct platform_device *pdev = to_platform_device(dev);
1269 struct gpio_bank *bank = platform_get_drvdata(pdev); 1270 struct gpio_bank *bank = platform_get_drvdata(pdev);
1270 void __iomem *mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT; 1271 void __iomem *mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT;
1271 unsigned long flags; 1272 unsigned long flags;
@@ -1278,8 +1279,9 @@ static int omap_mpuio_suspend_late(struct platform_device *pdev, pm_message_t me
1278 return 0; 1279 return 0;
1279} 1280}
1280 1281
1281static int omap_mpuio_resume_early(struct platform_device *pdev) 1282static int omap_mpuio_resume_noirq(struct device *dev)
1282{ 1283{
1284 struct platform_device *pdev = to_platform_device(dev);
1283 struct gpio_bank *bank = platform_get_drvdata(pdev); 1285 struct gpio_bank *bank = platform_get_drvdata(pdev);
1284 void __iomem *mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT; 1286 void __iomem *mask_reg = bank->base + OMAP_MPUIO_GPIO_MASKIT;
1285 unsigned long flags; 1287 unsigned long flags;
@@ -1291,14 +1293,18 @@ static int omap_mpuio_resume_early(struct platform_device *pdev)
1291 return 0; 1293 return 0;
1292} 1294}
1293 1295
1296static struct dev_pm_ops omap_mpuio_dev_pm_ops = {
1297 .suspend_noirq = omap_mpuio_suspend_noirq,
1298 .resume_noirq = omap_mpuio_resume_noirq,
1299};
1300
1294/* use platform_driver for this, now that there's no longer any 1301/* use platform_driver for this, now that there's no longer any
1295 * point to sys_device (other than not disturbing old code). 1302 * point to sys_device (other than not disturbing old code).
1296 */ 1303 */
1297static struct platform_driver omap_mpuio_driver = { 1304static struct platform_driver omap_mpuio_driver = {
1298 .suspend_late = omap_mpuio_suspend_late,
1299 .resume_early = omap_mpuio_resume_early,
1300 .driver = { 1305 .driver = {
1301 .name = "mpuio", 1306 .name = "mpuio",
1307 .pm = &omap_mpuio_dev_pm_ops,
1302 }, 1308 },
1303}; 1309};
1304 1310