diff options
-rw-r--r-- | drivers/video/backlight/ili9320.c | 24 | ||||
-rw-r--r-- | drivers/video/backlight/ili9320.h | 2 | ||||
-rw-r--r-- | drivers/video/backlight/vgg2432a4.c | 18 |
3 files changed, 18 insertions, 26 deletions
diff --git a/drivers/video/backlight/ili9320.c b/drivers/video/backlight/ili9320.c index c3a529966dd0..f8be90c5dedc 100644 --- a/drivers/video/backlight/ili9320.c +++ b/drivers/video/backlight/ili9320.c | |||
@@ -270,27 +270,21 @@ int ili9320_remove(struct ili9320 *ili) | |||
270 | } | 270 | } |
271 | EXPORT_SYMBOL_GPL(ili9320_remove); | 271 | EXPORT_SYMBOL_GPL(ili9320_remove); |
272 | 272 | ||
273 | #ifdef CONFIG_PM | 273 | #ifdef CONFIG_PM_SLEEP |
274 | int ili9320_suspend(struct ili9320 *lcd, pm_message_t state) | 274 | int ili9320_suspend(struct ili9320 *lcd) |
275 | { | 275 | { |
276 | int ret; | 276 | int ret; |
277 | 277 | ||
278 | dev_dbg(lcd->dev, "%s: event %d\n", __func__, state.event); | 278 | ret = ili9320_power(lcd, FB_BLANK_POWERDOWN); |
279 | 279 | ||
280 | if (state.event == PM_EVENT_SUSPEND) { | 280 | if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) { |
281 | ret = ili9320_power(lcd, FB_BLANK_POWERDOWN); | 281 | ili9320_write(lcd, ILI9320_POWER1, lcd->power1 | |
282 | 282 | ILI9320_POWER1_SLP | | |
283 | if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) { | 283 | ILI9320_POWER1_DSTB); |
284 | ili9320_write(lcd, ILI9320_POWER1, lcd->power1 | | 284 | lcd->initialised = 0; |
285 | ILI9320_POWER1_SLP | | ||
286 | ILI9320_POWER1_DSTB); | ||
287 | lcd->initialised = 0; | ||
288 | } | ||
289 | |||
290 | return ret; | ||
291 | } | 285 | } |
292 | 286 | ||
293 | return 0; | 287 | return ret; |
294 | } | 288 | } |
295 | EXPORT_SYMBOL_GPL(ili9320_suspend); | 289 | EXPORT_SYMBOL_GPL(ili9320_suspend); |
296 | 290 | ||
diff --git a/drivers/video/backlight/ili9320.h b/drivers/video/backlight/ili9320.h index e0db738f7bb9..42329e7aa9a8 100644 --- a/drivers/video/backlight/ili9320.h +++ b/drivers/video/backlight/ili9320.h | |||
@@ -76,5 +76,5 @@ extern void ili9320_shutdown(struct ili9320 *lcd); | |||
76 | 76 | ||
77 | /* PM */ | 77 | /* PM */ |
78 | 78 | ||
79 | extern int ili9320_suspend(struct ili9320 *lcd, pm_message_t state); | 79 | extern int ili9320_suspend(struct ili9320 *lcd); |
80 | extern int ili9320_resume(struct ili9320 *lcd); | 80 | extern int ili9320_resume(struct ili9320 *lcd); |
diff --git a/drivers/video/backlight/vgg2432a4.c b/drivers/video/backlight/vgg2432a4.c index 84d582f591dc..d538947a67d3 100644 --- a/drivers/video/backlight/vgg2432a4.c +++ b/drivers/video/backlight/vgg2432a4.c | |||
@@ -205,18 +205,15 @@ static int vgg2432a4_lcd_init(struct ili9320 *lcd, | |||
205 | return ret; | 205 | return ret; |
206 | } | 206 | } |
207 | 207 | ||
208 | #ifdef CONFIG_PM | 208 | #ifdef CONFIG_PM_SLEEP |
209 | static int vgg2432a4_suspend(struct spi_device *spi, pm_message_t state) | 209 | static int vgg2432a4_suspend(struct device *dev) |
210 | { | 210 | { |
211 | return ili9320_suspend(spi_get_drvdata(spi), state); | 211 | return ili9320_suspend(dev_get_drvdata(dev)); |
212 | } | 212 | } |
213 | static int vgg2432a4_resume(struct spi_device *spi) | 213 | static int vgg2432a4_resume(struct device *dev) |
214 | { | 214 | { |
215 | return ili9320_resume(spi_get_drvdata(spi)); | 215 | return ili9320_resume(dev_get_drvdata(dev)); |
216 | } | 216 | } |
217 | #else | ||
218 | #define vgg2432a4_suspend NULL | ||
219 | #define vgg2432a4_resume NULL | ||
220 | #endif | 217 | #endif |
221 | 218 | ||
222 | static struct ili9320_client vgg2432a4_client = { | 219 | static struct ili9320_client vgg2432a4_client = { |
@@ -249,16 +246,17 @@ static void vgg2432a4_shutdown(struct spi_device *spi) | |||
249 | ili9320_shutdown(spi_get_drvdata(spi)); | 246 | ili9320_shutdown(spi_get_drvdata(spi)); |
250 | } | 247 | } |
251 | 248 | ||
249 | static SIMPLE_DEV_PM_OPS(vgg2432a4_pm_ops, vgg2432a4_suspend, vgg2432a4_resume); | ||
250 | |||
252 | static struct spi_driver vgg2432a4_driver = { | 251 | static struct spi_driver vgg2432a4_driver = { |
253 | .driver = { | 252 | .driver = { |
254 | .name = "VGG2432A4", | 253 | .name = "VGG2432A4", |
255 | .owner = THIS_MODULE, | 254 | .owner = THIS_MODULE, |
255 | .pm = &vgg2432a4_pm_ops, | ||
256 | }, | 256 | }, |
257 | .probe = vgg2432a4_probe, | 257 | .probe = vgg2432a4_probe, |
258 | .remove = vgg2432a4_remove, | 258 | .remove = vgg2432a4_remove, |
259 | .shutdown = vgg2432a4_shutdown, | 259 | .shutdown = vgg2432a4_shutdown, |
260 | .suspend = vgg2432a4_suspend, | ||
261 | .resume = vgg2432a4_resume, | ||
262 | }; | 260 | }; |
263 | 261 | ||
264 | module_spi_driver(vgg2432a4_driver); | 262 | module_spi_driver(vgg2432a4_driver); |