summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/tosa_lcd.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-29 16:18:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:28:18 -0700
commit1dde37d4574cce3c0c99ddffc3623b533578be49 (patch)
tree5dd8309f161d166e3dc375201d5a8a784580b35c /drivers/video/backlight/tosa_lcd.c
parent07cac9d78fcc9a0a3dd7c5b8523371f4d8cae591 (diff)
downloadlinux-sh-1dde37d4574cce3c0c99ddffc3623b533578be49.tar.gz
backlight: tosa: convert tosa 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/tosa_lcd.c')
-rw-r--r--drivers/video/backlight/tosa_lcd.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c
index 666fe2593ea4..bf081573e5b5 100644
--- a/drivers/video/backlight/tosa_lcd.c
+++ b/drivers/video/backlight/tosa_lcd.c
@@ -240,19 +240,19 @@ static int tosa_lcd_remove(struct spi_device *spi)
return 0;
}
-#ifdef CONFIG_PM
-static int tosa_lcd_suspend(struct spi_device *spi, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int tosa_lcd_suspend(struct device *dev)
{
- struct tosa_lcd_data *data = spi_get_drvdata(spi);
+ struct tosa_lcd_data *data = dev_get_drvdata(dev);
tosa_lcd_tg_off(data);
return 0;
}
-static int tosa_lcd_resume(struct spi_device *spi)
+static int tosa_lcd_resume(struct device *dev)
{
- struct tosa_lcd_data *data = spi_get_drvdata(spi);
+ struct tosa_lcd_data *data = dev_get_drvdata(dev);
tosa_lcd_tg_init(data);
if (POWER_IS_ON(data->lcd_power))
@@ -262,20 +262,18 @@ static int tosa_lcd_resume(struct spi_device *spi)
return 0;
}
-#else
-#define tosa_lcd_suspend NULL
-#define tosa_lcd_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(tosa_lcd_pm_ops, tosa_lcd_suspend, tosa_lcd_resume);
+
static struct spi_driver tosa_lcd_driver = {
.driver = {
.name = "tosa-lcd",
.owner = THIS_MODULE,
+ .pm = &tosa_lcd_pm_ops,
},
.probe = tosa_lcd_probe,
.remove = tosa_lcd_remove,
- .suspend = tosa_lcd_suspend,
- .resume = tosa_lcd_resume,
};
module_spi_driver(tosa_lcd_driver);