diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:17:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:15 -0400 |
commit | d50d7ac08b8330a6164c2a4b3ecd305f89e1fae8 (patch) | |
tree | d70993cddb4c1db889ecd00978eab0f0960b8087 /drivers/video/backlight/s6e63m0.c | |
parent | 26cd2a440cbe5e0d54b59ab1a3d25cbf15b2cfd5 (diff) |
backlight: s6e63m0: convert s6e63m0 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/s6e63m0.c')
-rw-r--r-- | drivers/video/backlight/s6e63m0.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index 9c2677f0ef7d..b37bb1854bf4 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c | |||
@@ -817,12 +817,12 @@ static int s6e63m0_remove(struct spi_device *spi) | |||
817 | return 0; | 817 | return 0; |
818 | } | 818 | } |
819 | 819 | ||
820 | #if defined(CONFIG_PM) | 820 | #ifdef CONFIG_PM_SLEEP |
821 | static int s6e63m0_suspend(struct spi_device *spi, pm_message_t mesg) | 821 | static int s6e63m0_suspend(struct device *dev) |
822 | { | 822 | { |
823 | struct s6e63m0 *lcd = spi_get_drvdata(spi); | 823 | struct s6e63m0 *lcd = dev_get_drvdata(dev); |
824 | 824 | ||
825 | dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power); | 825 | dev_dbg(dev, "lcd->power = %d\n", lcd->power); |
826 | 826 | ||
827 | /* | 827 | /* |
828 | * when lcd panel is suspend, lcd panel becomes off | 828 | * when lcd panel is suspend, lcd panel becomes off |
@@ -831,19 +831,18 @@ static int s6e63m0_suspend(struct spi_device *spi, pm_message_t mesg) | |||
831 | return s6e63m0_power(lcd, FB_BLANK_POWERDOWN); | 831 | return s6e63m0_power(lcd, FB_BLANK_POWERDOWN); |
832 | } | 832 | } |
833 | 833 | ||
834 | static int s6e63m0_resume(struct spi_device *spi) | 834 | static int s6e63m0_resume(struct device *dev) |
835 | { | 835 | { |
836 | struct s6e63m0 *lcd = spi_get_drvdata(spi); | 836 | struct s6e63m0 *lcd = dev_get_drvdata(dev); |
837 | 837 | ||
838 | lcd->power = FB_BLANK_POWERDOWN; | 838 | lcd->power = FB_BLANK_POWERDOWN; |
839 | 839 | ||
840 | return s6e63m0_power(lcd, FB_BLANK_UNBLANK); | 840 | return s6e63m0_power(lcd, FB_BLANK_UNBLANK); |
841 | } | 841 | } |
842 | #else | ||
843 | #define s6e63m0_suspend NULL | ||
844 | #define s6e63m0_resume NULL | ||
845 | #endif | 842 | #endif |
846 | 843 | ||
844 | static SIMPLE_DEV_PM_OPS(s6e63m0_pm_ops, s6e63m0_suspend, s6e63m0_resume); | ||
845 | |||
847 | /* Power down all displays on reboot, poweroff or halt. */ | 846 | /* Power down all displays on reboot, poweroff or halt. */ |
848 | static void s6e63m0_shutdown(struct spi_device *spi) | 847 | static void s6e63m0_shutdown(struct spi_device *spi) |
849 | { | 848 | { |
@@ -856,12 +855,11 @@ static struct spi_driver s6e63m0_driver = { | |||
856 | .driver = { | 855 | .driver = { |
857 | .name = "s6e63m0", | 856 | .name = "s6e63m0", |
858 | .owner = THIS_MODULE, | 857 | .owner = THIS_MODULE, |
858 | .pm = &s6e63m0_pm_ops, | ||
859 | }, | 859 | }, |
860 | .probe = s6e63m0_probe, | 860 | .probe = s6e63m0_probe, |
861 | .remove = s6e63m0_remove, | 861 | .remove = s6e63m0_remove, |
862 | .shutdown = s6e63m0_shutdown, | 862 | .shutdown = s6e63m0_shutdown, |
863 | .suspend = s6e63m0_suspend, | ||
864 | .resume = s6e63m0_resume, | ||
865 | }; | 863 | }; |
866 | 864 | ||
867 | module_spi_driver(s6e63m0_driver); | 865 | module_spi_driver(s6e63m0_driver); |