diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:17:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:15 -0400 |
commit | 26cd2a440cbe5e0d54b59ab1a3d25cbf15b2cfd5 (patch) | |
tree | ac4c35d6a066e6b821a81e6ababbd578a6a979de /drivers/video/backlight | |
parent | eba3bfb4c086ead379430439f7bf710697e62c45 (diff) |
backlight: lms501kf03: convert lms501kf03 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/lms501kf03.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/video/backlight/lms501kf03.c b/drivers/video/backlight/lms501kf03.c index b43882abefaf..cf01b9ac8131 100644 --- a/drivers/video/backlight/lms501kf03.c +++ b/drivers/video/backlight/lms501kf03.c | |||
@@ -387,13 +387,12 @@ static int lms501kf03_remove(struct spi_device *spi) | |||
387 | return 0; | 387 | return 0; |
388 | } | 388 | } |
389 | 389 | ||
390 | #if defined(CONFIG_PM) | 390 | #ifdef CONFIG_PM_SLEEP |
391 | 391 | static int lms501kf03_suspend(struct device *dev) | |
392 | static int lms501kf03_suspend(struct spi_device *spi, pm_message_t mesg) | ||
393 | { | 392 | { |
394 | struct lms501kf03 *lcd = spi_get_drvdata(spi); | 393 | struct lms501kf03 *lcd = dev_get_drvdata(dev); |
395 | 394 | ||
396 | dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power); | 395 | dev_dbg(dev, "lcd->power = %d\n", lcd->power); |
397 | 396 | ||
398 | /* | 397 | /* |
399 | * when lcd panel is suspend, lcd panel becomes off | 398 | * when lcd panel is suspend, lcd panel becomes off |
@@ -402,19 +401,19 @@ static int lms501kf03_suspend(struct spi_device *spi, pm_message_t mesg) | |||
402 | return lms501kf03_power(lcd, FB_BLANK_POWERDOWN); | 401 | return lms501kf03_power(lcd, FB_BLANK_POWERDOWN); |
403 | } | 402 | } |
404 | 403 | ||
405 | static int lms501kf03_resume(struct spi_device *spi) | 404 | static int lms501kf03_resume(struct device *dev) |
406 | { | 405 | { |
407 | struct lms501kf03 *lcd = spi_get_drvdata(spi); | 406 | struct lms501kf03 *lcd = dev_get_drvdata(dev); |
408 | 407 | ||
409 | lcd->power = FB_BLANK_POWERDOWN; | 408 | lcd->power = FB_BLANK_POWERDOWN; |
410 | 409 | ||
411 | return lms501kf03_power(lcd, FB_BLANK_UNBLANK); | 410 | return lms501kf03_power(lcd, FB_BLANK_UNBLANK); |
412 | } | 411 | } |
413 | #else | ||
414 | #define lms501kf03_suspend NULL | ||
415 | #define lms501kf03_resume NULL | ||
416 | #endif | 412 | #endif |
417 | 413 | ||
414 | static SIMPLE_DEV_PM_OPS(lms501kf03_pm_ops, lms501kf03_suspend, | ||
415 | lms501kf03_resume); | ||
416 | |||
418 | static void lms501kf03_shutdown(struct spi_device *spi) | 417 | static void lms501kf03_shutdown(struct spi_device *spi) |
419 | { | 418 | { |
420 | struct lms501kf03 *lcd = spi_get_drvdata(spi); | 419 | struct lms501kf03 *lcd = spi_get_drvdata(spi); |
@@ -426,12 +425,11 @@ static struct spi_driver lms501kf03_driver = { | |||
426 | .driver = { | 425 | .driver = { |
427 | .name = "lms501kf03", | 426 | .name = "lms501kf03", |
428 | .owner = THIS_MODULE, | 427 | .owner = THIS_MODULE, |
428 | .pm = &lms501kf03_pm_ops, | ||
429 | }, | 429 | }, |
430 | .probe = lms501kf03_probe, | 430 | .probe = lms501kf03_probe, |
431 | .remove = lms501kf03_remove, | 431 | .remove = lms501kf03_remove, |
432 | .shutdown = lms501kf03_shutdown, | 432 | .shutdown = lms501kf03_shutdown, |
433 | .suspend = lms501kf03_suspend, | ||
434 | .resume = lms501kf03_resume, | ||
435 | }; | 433 | }; |
436 | 434 | ||
437 | module_spi_driver(lms501kf03_driver); | 435 | module_spi_driver(lms501kf03_driver); |