aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/displays/panel-tpo-td043mtea1.c')
-rw-r--r--drivers/video/omap2/displays/panel-tpo-td043mtea1.c61
1 files changed, 50 insertions, 11 deletions
diff --git a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
index f297a46f2b1a..c6e4a7e9f532 100644
--- a/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
+++ b/drivers/video/omap2/displays/panel-tpo-td043mtea1.c
@@ -262,18 +262,20 @@ static const struct omap_video_timings tpo_td043_timings = {
262 .vbp = 34, 262 .vbp = 34,
263}; 263};
264 264
265static int tpo_td043_enable(struct omap_dss_device *dssdev) 265static int generic_panel_power_on(struct omap_dss_device *dssdev)
266{ 266{
267 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); 267 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev);
268 int nreset_gpio = dssdev->reset_gpio; 268 int nreset_gpio = dssdev->reset_gpio;
269 int ret; 269 int r;
270 270
271 dev_dbg(&dssdev->dev, "enable\n"); 271 r = omapdss_dpi_display_enable(dssdev);
272 if (r)
273 goto err0;
272 274
273 if (dssdev->platform_enable) { 275 if (dssdev->platform_enable) {
274 ret = dssdev->platform_enable(dssdev); 276 r = dssdev->platform_enable(dssdev);
275 if (ret) 277 if (r)
276 return ret; 278 goto err1;
277 } 279 }
278 280
279 regulator_enable(tpo_td043->vcc_reg); 281 regulator_enable(tpo_td043->vcc_reg);
@@ -294,15 +296,17 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)
294 tpo_td043_write_gamma(tpo_td043->spi, tpo_td043->gamma); 296 tpo_td043_write_gamma(tpo_td043->spi, tpo_td043->gamma);
295 297
296 return 0; 298 return 0;
299err1:
300 omapdss_dpi_display_disable(dssdev);
301err0:
302 return r;
297} 303}
298 304
299static void tpo_td043_disable(struct omap_dss_device *dssdev) 305static void generic_panel_power_off(struct omap_dss_device *dssdev)
300{ 306{
301 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev); 307 struct tpo_td043_device *tpo_td043 = dev_get_drvdata(&dssdev->dev);
302 int nreset_gpio = dssdev->reset_gpio; 308 int nreset_gpio = dssdev->reset_gpio;
303 309
304 dev_dbg(&dssdev->dev, "disable\n");
305
306 tpo_td043_write(tpo_td043->spi, 3, 310 tpo_td043_write(tpo_td043->spi, 3,
307 TPO_R03_VAL_STANDBY | TPO_R03_EN_PWM); 311 TPO_R03_VAL_STANDBY | TPO_R03_EN_PWM);
308 312
@@ -318,17 +322,52 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev)
318 322
319 if (dssdev->platform_disable) 323 if (dssdev->platform_disable)
320 dssdev->platform_disable(dssdev); 324 dssdev->platform_disable(dssdev);
325
326 omapdss_dpi_display_disable(dssdev);
327}
328
329static int tpo_td043_enable(struct omap_dss_device *dssdev)
330{
331 int ret;
332
333 dev_dbg(&dssdev->dev, "enable\n");
334
335 ret = generic_panel_power_on(dssdev);
336 if (ret)
337 return ret;
338
339 dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
340
341 return 0;
342}
343
344static void tpo_td043_disable(struct omap_dss_device *dssdev)
345{
346 dev_dbg(&dssdev->dev, "disable\n");
347
348 generic_panel_power_off(dssdev);
349
350 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
321} 351}
322 352
323static int tpo_td043_suspend(struct omap_dss_device *dssdev) 353static int tpo_td043_suspend(struct omap_dss_device *dssdev)
324{ 354{
325 tpo_td043_disable(dssdev); 355 generic_panel_power_off(dssdev);
356 dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
326 return 0; 357 return 0;
327} 358}
328 359
329static int tpo_td043_resume(struct omap_dss_device *dssdev) 360static int tpo_td043_resume(struct omap_dss_device *dssdev)
330{ 361{
331 return tpo_td043_enable(dssdev); 362 int r = 0;
363
364 r = generic_panel_power_on(dssdev);
365 if (r)
366 return r;
367
368 dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
369
370 return 0;
332} 371}
333 372
334static int tpo_td043_probe(struct omap_dss_device *dssdev) 373static int tpo_td043_probe(struct omap_dss_device *dssdev)