diff options
author | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-01-12 14:12:07 +0100 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2010-02-24 13:31:28 +0100 |
commit | 37ac60e414052f1d9301368437db8f0cb9e323fe (patch) | |
tree | d6b30b58deae82a6d5f2ac2f4d9cf18ed3bc57da /drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c | |
parent | OMAP: DSS2: move update() and sync() (diff) | |
download | linux-37ac60e414052f1d9301368437db8f0cb9e323fe.tar.xz linux-37ac60e414052f1d9301368437db8f0cb9e323fe.zip |
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-sharp-lq043t1dg01.c')
-rw-r--r-- | drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c | 67 |
1 files changed, 53 insertions, 14 deletions
diff --git a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c index e75798edbb59..10267461991c 100644 --- a/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c +++ b/drivers/video/omap2/displays/panel-sharp-lq043t1dg01.c @@ -39,6 +39,41 @@ static struct omap_video_timings sharp_lq_timings = { .vbp = 2, }; +static int sharp_lq_panel_power_on(struct omap_dss_device *dssdev) +{ + int r; + + r = omapdss_dpi_display_enable(dssdev); + if (r) + goto err0; + + /* wait couple of vsyncs until enabling the LCD */ + msleep(50); + + 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 sharp_lq_panel_power_off(struct omap_dss_device *dssdev) +{ + if (dssdev->platform_disable) + dssdev->platform_disable(dssdev); + + /* wait at least 5 vsyncs after disabling the LCD */ + msleep(100); + + omapdss_dpi_display_disable(dssdev); +} + static int sharp_lq_panel_probe(struct omap_dss_device *dssdev) { @@ -58,36 +93,40 @@ static int sharp_lq_panel_enable(struct omap_dss_device *dssdev) { int r = 0; + r = sharp_lq_panel_power_on(dssdev); + if (r) + return r; - /* wait couple of vsyncs until enabling the LCD */ - msleep(50); - - if (dssdev->platform_enable) - r = dssdev->platform_enable(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; - return r; + return 0; } static void sharp_lq_panel_disable(struct omap_dss_device *dssdev) { + sharp_lq_panel_power_off(dssdev); - if (dssdev->platform_disable) - dssdev->platform_disable(dssdev); - - /* wait at least 5 vsyncs after disabling the LCD */ - - msleep(100); + dssdev->state = OMAP_DSS_DISPLAY_DISABLED; } static int sharp_lq_panel_suspend(struct omap_dss_device *dssdev) { - sharp_lq_panel_disable(dssdev); + sharp_lq_panel_power_off(dssdev); + dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED; return 0; } static int sharp_lq_panel_resume(struct omap_dss_device *dssdev) { - return sharp_lq_panel_enable(dssdev); + int r = 0; + + r = sharp_lq_panel_power_on(dssdev); + if (r) + return r; + + dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; + + return 0; } static struct omap_dss_driver sharp_lq_driver = { |