aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 19:17:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:14 -0400
commitba3601a99fde549707f5f869c977c0072fee04e1 (patch)
treef30dfc56116ebb592f9021f26e468ccfdcac8de5
parenta16b945c3248b4cffbc63c9df61b293af84ab94d (diff)
drivers/video/backlight/ams369fg06.c: convert ams369fg06 to dev_pm_ops
Instead of using legacy suspend/resume methods, using newer dev_pm_ops structure allows better control over power management. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/video/backlight/ams369fg06.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c
index c02aa2c2575a..319fef6cb422 100644
--- a/drivers/video/backlight/ams369fg06.c
+++ b/drivers/video/backlight/ams369fg06.c
@@ -533,12 +533,12 @@ static int ams369fg06_remove(struct spi_device *spi)
533 return 0; 533 return 0;
534} 534}
535 535
536#if defined(CONFIG_PM) 536#ifdef CONFIG_PM_SLEEP
537static int ams369fg06_suspend(struct spi_device *spi, pm_message_t mesg) 537static int ams369fg06_suspend(struct device *dev)
538{ 538{
539 struct ams369fg06 *lcd = spi_get_drvdata(spi); 539 struct ams369fg06 *lcd = dev_get_drvdata(dev);
540 540
541 dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power); 541 dev_dbg(dev, "lcd->power = %d\n", lcd->power);
542 542
543 /* 543 /*
544 * when lcd panel is suspend, lcd panel becomes off 544 * when lcd panel is suspend, lcd panel becomes off
@@ -547,19 +547,19 @@ static int ams369fg06_suspend(struct spi_device *spi, pm_message_t mesg)
547 return ams369fg06_power(lcd, FB_BLANK_POWERDOWN); 547 return ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
548} 548}
549 549
550static int ams369fg06_resume(struct spi_device *spi) 550static int ams369fg06_resume(struct device *dev)
551{ 551{
552 struct ams369fg06 *lcd = spi_get_drvdata(spi); 552 struct ams369fg06 *lcd = dev_get_drvdata(dev);
553 553
554 lcd->power = FB_BLANK_POWERDOWN; 554 lcd->power = FB_BLANK_POWERDOWN;
555 555
556 return ams369fg06_power(lcd, FB_BLANK_UNBLANK); 556 return ams369fg06_power(lcd, FB_BLANK_UNBLANK);
557} 557}
558#else
559#define ams369fg06_suspend NULL
560#define ams369fg06_resume NULL
561#endif 558#endif
562 559
560static SIMPLE_DEV_PM_OPS(ams369fg06_pm_ops, ams369fg06_suspend,
561 ams369fg06_resume);
562
563static void ams369fg06_shutdown(struct spi_device *spi) 563static void ams369fg06_shutdown(struct spi_device *spi)
564{ 564{
565 struct ams369fg06 *lcd = spi_get_drvdata(spi); 565 struct ams369fg06 *lcd = spi_get_drvdata(spi);
@@ -571,12 +571,11 @@ static struct spi_driver ams369fg06_driver = {
571 .driver = { 571 .driver = {
572 .name = "ams369fg06", 572 .name = "ams369fg06",
573 .owner = THIS_MODULE, 573 .owner = THIS_MODULE,
574 .pm = &ams369fg06_pm_ops,
574 }, 575 },
575 .probe = ams369fg06_probe, 576 .probe = ams369fg06_probe,
576 .remove = ams369fg06_remove, 577 .remove = ams369fg06_remove,
577 .shutdown = ams369fg06_shutdown, 578 .shutdown = ams369fg06_shutdown,
578 .suspend = ams369fg06_suspend,
579 .resume = ams369fg06_resume,
580}; 579};
581 580
582module_spi_driver(ams369fg06_driver); 581module_spi_driver(ams369fg06_driver);