aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/tdo24m.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 19:17:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 21:28:17 -0400
commit3e14e689496a36cfa4d034cb4fcf98deee363d7c (patch)
tree4e2fe5cb213c6cf8edae47351675cac040633967 /drivers/video/backlight/tdo24m.c
parenta71ed77b3ac5bb6ce3515fa9d0b9ad2c84919a2c (diff)
backlight: tdo24m: convert tdo24m 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/tdo24m.c')
-rw-r--r--drivers/video/backlight/tdo24m.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c
index 00162085eec0..18cdf466d50a 100644
--- a/drivers/video/backlight/tdo24m.c
+++ b/drivers/video/backlight/tdo24m.c
@@ -412,25 +412,24 @@ static int tdo24m_remove(struct spi_device *spi)
412 return 0; 412 return 0;
413} 413}
414 414
415#ifdef CONFIG_PM 415#ifdef CONFIG_PM_SLEEP
416static int tdo24m_suspend(struct spi_device *spi, pm_message_t state) 416static int tdo24m_suspend(struct device *dev)
417{ 417{
418 struct tdo24m *lcd = spi_get_drvdata(spi); 418 struct tdo24m *lcd = dev_get_drvdata(dev);
419 419
420 return tdo24m_power(lcd, FB_BLANK_POWERDOWN); 420 return tdo24m_power(lcd, FB_BLANK_POWERDOWN);
421} 421}
422 422
423static int tdo24m_resume(struct spi_device *spi) 423static int tdo24m_resume(struct device *dev)
424{ 424{
425 struct tdo24m *lcd = spi_get_drvdata(spi); 425 struct tdo24m *lcd = dev_get_drvdata(dev);
426 426
427 return tdo24m_power(lcd, FB_BLANK_UNBLANK); 427 return tdo24m_power(lcd, FB_BLANK_UNBLANK);
428} 428}
429#else
430#define tdo24m_suspend NULL
431#define tdo24m_resume NULL
432#endif 429#endif
433 430
431static SIMPLE_DEV_PM_OPS(tdo24m_pm_ops, tdo24m_suspend, tdo24m_resume);
432
434/* Power down all displays on reboot, poweroff or halt */ 433/* Power down all displays on reboot, poweroff or halt */
435static void tdo24m_shutdown(struct spi_device *spi) 434static void tdo24m_shutdown(struct spi_device *spi)
436{ 435{
@@ -443,12 +442,11 @@ static struct spi_driver tdo24m_driver = {
443 .driver = { 442 .driver = {
444 .name = "tdo24m", 443 .name = "tdo24m",
445 .owner = THIS_MODULE, 444 .owner = THIS_MODULE,
445 .pm = &tdo24m_pm_ops,
446 }, 446 },
447 .probe = tdo24m_probe, 447 .probe = tdo24m_probe,
448 .remove = tdo24m_remove, 448 .remove = tdo24m_remove,
449 .shutdown = tdo24m_shutdown, 449 .shutdown = tdo24m_shutdown,
450 .suspend = tdo24m_suspend,
451 .resume = tdo24m_resume,
452}; 450};
453 451
454module_spi_driver(tdo24m_driver); 452module_spi_driver(tdo24m_driver);