diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:17:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:16 -0400 |
commit | bb0747105728fb1e2f0df5875f4ab9be13641ff5 (patch) | |
tree | 413adc157db9fc290cead14e333a14c4fca926ae /drivers/video/backlight | |
parent | 3cd4291aaf4b098d2591a72570a499d1fc9e7e53 (diff) |
backlight: corgi_lcd: convert corgi_lcd 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/corgi_lcd.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index aa782f302983..c97867a717a7 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c | |||
@@ -457,10 +457,10 @@ static const struct backlight_ops corgi_bl_ops = { | |||
457 | .update_status = corgi_bl_update_status, | 457 | .update_status = corgi_bl_update_status, |
458 | }; | 458 | }; |
459 | 459 | ||
460 | #ifdef CONFIG_PM | 460 | #ifdef CONFIG_PM_SLEEP |
461 | static int corgi_lcd_suspend(struct spi_device *spi, pm_message_t state) | 461 | static int corgi_lcd_suspend(struct device *dev) |
462 | { | 462 | { |
463 | struct corgi_lcd *lcd = spi_get_drvdata(spi); | 463 | struct corgi_lcd *lcd = dev_get_drvdata(dev); |
464 | 464 | ||
465 | corgibl_flags |= CORGIBL_SUSPENDED; | 465 | corgibl_flags |= CORGIBL_SUSPENDED; |
466 | corgi_bl_set_intensity(lcd, 0); | 466 | corgi_bl_set_intensity(lcd, 0); |
@@ -468,20 +468,19 @@ static int corgi_lcd_suspend(struct spi_device *spi, pm_message_t state) | |||
468 | return 0; | 468 | return 0; |
469 | } | 469 | } |
470 | 470 | ||
471 | static int corgi_lcd_resume(struct spi_device *spi) | 471 | static int corgi_lcd_resume(struct device *dev) |
472 | { | 472 | { |
473 | struct corgi_lcd *lcd = spi_get_drvdata(spi); | 473 | struct corgi_lcd *lcd = dev_get_drvdata(dev); |
474 | 474 | ||
475 | corgibl_flags &= ~CORGIBL_SUSPENDED; | 475 | corgibl_flags &= ~CORGIBL_SUSPENDED; |
476 | corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK); | 476 | corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK); |
477 | backlight_update_status(lcd->bl_dev); | 477 | backlight_update_status(lcd->bl_dev); |
478 | return 0; | 478 | return 0; |
479 | } | 479 | } |
480 | #else | ||
481 | #define corgi_lcd_suspend NULL | ||
482 | #define corgi_lcd_resume NULL | ||
483 | #endif | 480 | #endif |
484 | 481 | ||
482 | static SIMPLE_DEV_PM_OPS(corgi_lcd_pm_ops, corgi_lcd_suspend, corgi_lcd_resume); | ||
483 | |||
485 | static int setup_gpio_backlight(struct corgi_lcd *lcd, | 484 | static int setup_gpio_backlight(struct corgi_lcd *lcd, |
486 | struct corgi_lcd_platform_data *pdata) | 485 | struct corgi_lcd_platform_data *pdata) |
487 | { | 486 | { |
@@ -611,11 +610,10 @@ static struct spi_driver corgi_lcd_driver = { | |||
611 | .driver = { | 610 | .driver = { |
612 | .name = "corgi-lcd", | 611 | .name = "corgi-lcd", |
613 | .owner = THIS_MODULE, | 612 | .owner = THIS_MODULE, |
613 | .pm = &corgi_lcd_pm_ops, | ||
614 | }, | 614 | }, |
615 | .probe = corgi_lcd_probe, | 615 | .probe = corgi_lcd_probe, |
616 | .remove = corgi_lcd_remove, | 616 | .remove = corgi_lcd_remove, |
617 | .suspend = corgi_lcd_suspend, | ||
618 | .resume = corgi_lcd_resume, | ||
619 | }; | 617 | }; |
620 | 618 | ||
621 | module_spi_driver(corgi_lcd_driver); | 619 | module_spi_driver(corgi_lcd_driver); |