aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 19:17:35 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:15 -0400
commiteba3bfb4c086ead379430439f7bf710697e62c45 (patch)
treec209abcb092844b8046c7de4c3d4b976f92967a2 /drivers/video/backlight
parentef73e632fe48b97e67cbff339f9e7d30535d682f (diff)
backlight: ld9040: convert ld9040 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>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r--drivers/video/backlight/ld9040.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c
index 1b642f5f381a..1e0a3093ce50 100644
--- a/drivers/video/backlight/ld9040.c
+++ b/drivers/video/backlight/ld9040.c
@@ -775,12 +775,12 @@ static int ld9040_remove(struct spi_device *spi)
775 return 0; 775 return 0;
776} 776}
777 777
778#if defined(CONFIG_PM) 778#ifdef CONFIG_PM_SLEEP
779static int ld9040_suspend(struct spi_device *spi, pm_message_t mesg) 779static int ld9040_suspend(struct device *dev)
780{ 780{
781 struct ld9040 *lcd = spi_get_drvdata(spi); 781 struct ld9040 *lcd = dev_get_drvdata(dev);
782 782
783 dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power); 783 dev_dbg(dev, "lcd->power = %d\n", lcd->power);
784 784
785 /* 785 /*
786 * when lcd panel is suspend, lcd panel becomes off 786 * when lcd panel is suspend, lcd panel becomes off
@@ -789,19 +789,18 @@ static int ld9040_suspend(struct spi_device *spi, pm_message_t mesg)
789 return ld9040_power(lcd, FB_BLANK_POWERDOWN); 789 return ld9040_power(lcd, FB_BLANK_POWERDOWN);
790} 790}
791 791
792static int ld9040_resume(struct spi_device *spi) 792static int ld9040_resume(struct device *dev)
793{ 793{
794 struct ld9040 *lcd = spi_get_drvdata(spi); 794 struct ld9040 *lcd = dev_get_drvdata(dev);
795 795
796 lcd->power = FB_BLANK_POWERDOWN; 796 lcd->power = FB_BLANK_POWERDOWN;
797 797
798 return ld9040_power(lcd, FB_BLANK_UNBLANK); 798 return ld9040_power(lcd, FB_BLANK_UNBLANK);
799} 799}
800#else
801#define ld9040_suspend NULL
802#define ld9040_resume NULL
803#endif 800#endif
804 801
802static SIMPLE_DEV_PM_OPS(ld9040_pm_ops, ld9040_suspend, ld9040_resume);
803
805/* Power down all displays on reboot, poweroff or halt. */ 804/* Power down all displays on reboot, poweroff or halt. */
806static void ld9040_shutdown(struct spi_device *spi) 805static void ld9040_shutdown(struct spi_device *spi)
807{ 806{
@@ -814,12 +813,11 @@ static struct spi_driver ld9040_driver = {
814 .driver = { 813 .driver = {
815 .name = "ld9040", 814 .name = "ld9040",
816 .owner = THIS_MODULE, 815 .owner = THIS_MODULE,
816 .pm = &ld9040_pm_ops,
817 }, 817 },
818 .probe = ld9040_probe, 818 .probe = ld9040_probe,
819 .remove = ld9040_remove, 819 .remove = ld9040_remove,
820 .shutdown = ld9040_shutdown, 820 .shutdown = ld9040_shutdown,
821 .suspend = ld9040_suspend,
822 .resume = ld9040_resume,
823}; 821};
824 822
825module_spi_driver(ld9040_driver); 823module_spi_driver(ld9040_driver);