diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-01-12 15:12:07 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-02-24 14:31:28 +0200 |
commit | 37ac60e414052f1d9301368437db8f0cb9e323fe (patch) | |
tree | d6b30b58deae82a6d5f2ac2f4d9cf18ed3bc57da /drivers/video/omap2/displays/panel-toppoly-tdo35s.c | |
parent | 18946f62c6cc8cf051bafca8b7fa72309e8a1067 (diff) | |
download | linux-next-37ac60e414052f1d9301368437db8f0cb9e323fe.tar.gz |
OMAP: DSS2: move enable/disable/suspend/resume
Move enable/disable/suspend/resume from omap_dss_device to
omap_dss_driver.
This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2/displays/panel-toppoly-tdo35s.c')
-rw-r--r-- | drivers/video/omap2/displays/panel-toppoly-tdo35s.c | 56 |
1 files changed, 49 insertions, 7 deletions
diff --git a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c index e744b8c83817..fa434ca6e4b7 100644 --- a/drivers/video/omap2/displays/panel-toppoly-tdo35s.c +++ b/drivers/video/omap2/displays/panel-toppoly-tdo35s.c @@ -42,6 +42,35 @@ static struct omap_video_timings toppoly_tdo_panel_timings = { .vbp = 2, }; +static int toppoly_tdo_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 toppoly_tdo_panel_power_off(struct omap_dss_device *dssdev) +{ + if (dssdev->platform_disable) + dssdev->platform_disable(dssdev); + + omapdss_dpi_display_disable(dssdev); +} + static int toppoly_tdo_panel_probe(struct omap_dss_device *dssdev) { dssdev->panel.config = OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS | @@ -59,27 +88,40 @@ static int toppoly_tdo_panel_enable(struct omap_dss_device *dssdev) { int r = 0; - if (dssdev->platform_enable) - r = dssdev->platform_enable(dssdev); + r = toppoly_tdo_panel_power_on(dssdev); + if (r) + return r; - return r; + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; + + return 0; } static void toppoly_tdo_panel_disable(struct omap_dss_device *dssdev) { - if (dssdev->platform_disable) - dssdev->platform_disable(dssdev); + toppoly_tdo_panel_power_off(dssdev); + + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; } static int toppoly_tdo_panel_suspend(struct omap_dss_device *dssdev) { - toppoly_tdo_panel_disable(dssdev); + toppoly_tdo_panel_power_off(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; return 0; } static int toppoly_tdo_panel_resume(struct omap_dss_device *dssdev) { - return toppoly_tdo_panel_enable(dssdev); + int r = 0; + + r = toppoly_tdo_panel_power_on(dssdev); + if (r) + return r; + + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; + + return 0; } static struct omap_dss_driver generic_driver = { |