diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-05 15:46:18 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-05 15:46:18 -0500 |
commit | 3fa04ecd72780da31ba8b329e148179bc24a9c7d (patch) | |
tree | f5d462fd4aee086952d18f159f737c450ab46b3b /drivers/video/omap2/displays/panel-generic.c | |
parent | 180b62a3d837613fcac3ce89576526423926c3c3 (diff) | |
parent | 1cda707d52e51a6cafac0aef12d2bd7052d572e6 (diff) |
Merge branch 'writeback-for-2.6.34' into nfs-for-2.6.34
Diffstat (limited to 'drivers/video/omap2/displays/panel-generic.c')
-rw-r--r-- | drivers/video/omap2/displays/panel-generic.c | 56 |
1 files changed, 49 insertions, 7 deletions
diff --git a/drivers/video/omap2/displays/panel-generic.c b/drivers/video/omap2/displays/panel-generic.c index eb48d1afd80..c59e4baed8b 100644 --- a/drivers/video/omap2/displays/panel-generic.c +++ b/drivers/video/omap2/displays/panel-generic.c @@ -35,6 +35,35 @@ static struct omap_video_timings generic_panel_timings = { .vbp = 7, }; +static int generic_panel_power_on(struct omap_dss_device *dssdev) +{ + int r; + + r = omapdss_dpi_display_enable(dssdev); + if (r) + goto err0; + + if (dssdev->platform_enable) { + r = dssdev->platform_enable(dssdev); + if (r) + goto err1; + } + + return 0; +err1: + omapdss_dpi_display_disable(dssdev); +err0: + return r; +} + +static void generic_panel_power_off(struct omap_dss_device *dssdev) +{ + if (dssdev->platform_disable) + dssdev->platform_disable(dssdev); + + omapdss_dpi_display_disable(dssdev); +} + static int generic_panel_probe(struct omap_dss_device *dssdev) { dssdev->panel.config = OMAP_DSS_LCD_TFT; @@ -51,27 +80,40 @@ static int generic_panel_enable(struct omap_dss_device *dssdev) { int r = 0; - if (dssdev->platform_enable) - r = dssdev->platform_enable(dssdev); + r = generic_panel_power_on(dssdev); + if (r) + return r; - return r; + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; + + return 0; } static void generic_panel_disable(struct omap_dss_device *dssdev) { - if (dssdev->platform_disable) - dssdev->platform_disable(dssdev); + generic_panel_power_off(dssdev); + + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; } static int generic_panel_suspend(struct omap_dss_device *dssdev) { - generic_panel_disable(dssdev); + generic_panel_power_off(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; return 0; } static int generic_panel_resume(struct omap_dss_device *dssdev) { - return generic_panel_enable(dssdev); + int r = 0; + + r = generic_panel_power_on(dssdev); + if (r) + return r; + + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; + + return 0; } static struct omap_dss_driver generic_driver = { |