diff options
Diffstat (limited to 'drivers/video/backlight/da903x_bl.c')
-rw-r--r-- | drivers/video/backlight/da903x_bl.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index 93bb4340cc64..701a1081e199 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c | |||
@@ -154,34 +154,38 @@ static int da903x_backlight_remove(struct platform_device *pdev) | |||
154 | } | 154 | } |
155 | 155 | ||
156 | #ifdef CONFIG_PM | 156 | #ifdef CONFIG_PM |
157 | static int da903x_backlight_suspend(struct platform_device *pdev, | 157 | static int da903x_backlight_suspend(struct device *dev) |
158 | pm_message_t state) | ||
159 | { | 158 | { |
159 | struct platform_device *pdev = to_platform_device(dev); | ||
160 | struct backlight_device *bl = platform_get_drvdata(pdev); | 160 | struct backlight_device *bl = platform_get_drvdata(pdev); |
161 | return da903x_backlight_set(bl, 0); | 161 | return da903x_backlight_set(bl, 0); |
162 | } | 162 | } |
163 | 163 | ||
164 | static int da903x_backlight_resume(struct platform_device *pdev) | 164 | static int da903x_backlight_resume(struct device *dev) |
165 | { | 165 | { |
166 | struct platform_device *pdev = to_platform_device(dev); | ||
166 | struct backlight_device *bl = platform_get_drvdata(pdev); | 167 | struct backlight_device *bl = platform_get_drvdata(pdev); |
167 | 168 | ||
168 | backlight_update_status(bl); | 169 | backlight_update_status(bl); |
169 | return 0; | 170 | return 0; |
170 | } | 171 | } |
171 | #else | 172 | |
172 | #define da903x_backlight_suspend NULL | 173 | static struct dev_pm_ops da903x_backlight_pm_ops = { |
173 | #define da903x_backlight_resume NULL | 174 | .suspend = da903x_backlight_suspend, |
175 | .resume = da903x_backlight_resume, | ||
176 | }; | ||
174 | #endif | 177 | #endif |
175 | 178 | ||
176 | static struct platform_driver da903x_backlight_driver = { | 179 | static struct platform_driver da903x_backlight_driver = { |
177 | .driver = { | 180 | .driver = { |
178 | .name = "da903x-backlight", | 181 | .name = "da903x-backlight", |
179 | .owner = THIS_MODULE, | 182 | .owner = THIS_MODULE, |
183 | #ifdef CONFIG_PM | ||
184 | .pm = &da903x_backlight_pm_ops, | ||
185 | #endif | ||
180 | }, | 186 | }, |
181 | .probe = da903x_backlight_probe, | 187 | .probe = da903x_backlight_probe, |
182 | .remove = da903x_backlight_remove, | 188 | .remove = da903x_backlight_remove, |
183 | .suspend = da903x_backlight_suspend, | ||
184 | .resume = da903x_backlight_resume, | ||
185 | }; | 189 | }; |
186 | 190 | ||
187 | static int __init da903x_backlight_init(void) | 191 | static int __init da903x_backlight_init(void) |