aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);