diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:17:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:16 -0400 |
commit | 5a3778e2f57e5fb1f6e060586f5850dd87b5320f (patch) | |
tree | ce676c454ba09d72543afeafe1919549ec7b679b /drivers/video/backlight | |
parent | b079296259c0680b6ad431d611295711576f5ac8 (diff) |
backlight: locomolcd: convert locomolcd 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/locomolcd.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c index 146fea8aa431..6c3ec4259a60 100644 --- a/drivers/video/backlight/locomolcd.c +++ b/drivers/video/backlight/locomolcd.c | |||
@@ -157,25 +157,24 @@ static const struct backlight_ops locomobl_data = { | |||
157 | .update_status = locomolcd_set_intensity, | 157 | .update_status = locomolcd_set_intensity, |
158 | }; | 158 | }; |
159 | 159 | ||
160 | #ifdef CONFIG_PM | 160 | #ifdef CONFIG_PM_SLEEP |
161 | static int locomolcd_suspend(struct locomo_dev *dev, pm_message_t state) | 161 | static int locomolcd_suspend(struct device *dev) |
162 | { | 162 | { |
163 | locomolcd_flags |= LOCOMOLCD_SUSPENDED; | 163 | locomolcd_flags |= LOCOMOLCD_SUSPENDED; |
164 | locomolcd_set_intensity(locomolcd_bl_device); | 164 | locomolcd_set_intensity(locomolcd_bl_device); |
165 | return 0; | 165 | return 0; |
166 | } | 166 | } |
167 | 167 | ||
168 | static int locomolcd_resume(struct locomo_dev *dev) | 168 | static int locomolcd_resume(struct device *dev) |
169 | { | 169 | { |
170 | locomolcd_flags &= ~LOCOMOLCD_SUSPENDED; | 170 | locomolcd_flags &= ~LOCOMOLCD_SUSPENDED; |
171 | locomolcd_set_intensity(locomolcd_bl_device); | 171 | locomolcd_set_intensity(locomolcd_bl_device); |
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | #else | ||
175 | #define locomolcd_suspend NULL | ||
176 | #define locomolcd_resume NULL | ||
177 | #endif | 174 | #endif |
178 | 175 | ||
176 | static SIMPLE_DEV_PM_OPS(locomolcd_pm_ops, locomolcd_suspend, locomolcd_resume); | ||
177 | |||
179 | static int locomolcd_probe(struct locomo_dev *ldev) | 178 | static int locomolcd_probe(struct locomo_dev *ldev) |
180 | { | 179 | { |
181 | struct backlight_properties props; | 180 | struct backlight_properties props; |
@@ -230,13 +229,12 @@ static int locomolcd_remove(struct locomo_dev *dev) | |||
230 | 229 | ||
231 | static struct locomo_driver poodle_lcd_driver = { | 230 | static struct locomo_driver poodle_lcd_driver = { |
232 | .drv = { | 231 | .drv = { |
233 | .name = "locomo-backlight", | 232 | .name = "locomo-backlight", |
233 | .pm = &locomolcd_pm_ops, | ||
234 | }, | 234 | }, |
235 | .devid = LOCOMO_DEVID_BACKLIGHT, | 235 | .devid = LOCOMO_DEVID_BACKLIGHT, |
236 | .probe = locomolcd_probe, | 236 | .probe = locomolcd_probe, |
237 | .remove = locomolcd_remove, | 237 | .remove = locomolcd_remove, |
238 | .suspend = locomolcd_suspend, | ||
239 | .resume = locomolcd_resume, | ||
240 | }; | 238 | }; |
241 | 239 | ||
242 | static int __init locomolcd_init(void) | 240 | static int __init locomolcd_init(void) |