diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-03-21 20:55:18 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2010-03-21 20:55:18 +0100 |
commit | 7d10368cf1c59d5b474a27bb81b09dbe03e1862f (patch) | |
tree | d9c2d4d85ad0c939b8605a2a00bcce9076225805 | |
parent | 98b7291ecb2848194351c9e7b84173aa3e5d95a8 (diff) |
Enable display before trying to set mode or base
This makes it possible to change mode when the screen is switched off.
Signed-off-by: Thomas White <taw@bitwiz.org.uk>
-rw-r--r-- | drivers/mfd/glamo/glamo-display.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/mfd/glamo/glamo-display.c b/drivers/mfd/glamo/glamo-display.c index e56cdb437c7..24a1a31025d 100644 --- a/drivers/mfd/glamo/glamo-display.c +++ b/drivers/mfd/glamo/glamo-display.c @@ -267,9 +267,9 @@ static int glamo_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y, gdrm = gcrtc->gdrm; /* Here it is! */ if ( !gcrtc->pixel_clock_on ) { - printk(KERN_WARNING "[glamo-drm] Refusing to set base while " - "pixel clock is off.\n"); - return -EBUSY; + printk(KERN_WARNING "[glamo-drm] Display is off - " + "enabling it before setting base.\n"); + glamo_lcd_power(gdrm, 1); } gfb = to_glamo_framebuffer(crtc->fb); @@ -304,9 +304,9 @@ static int glamo_crtc_mode_set(struct drm_crtc *crtc, gdrm = gcrtc->gdrm; /* Here it is! */ if ( !gcrtc->pixel_clock_on ) { - printk(KERN_WARNING "[glamo-drm] Refusing to set mode while " - "pixel clock is off.\n"); - return -EBUSY; + printk(KERN_WARNING "[glamo-drm] Display is off - " + "enabling it before setting mode.\n"); + glamo_lcd_power(gdrm, 1); } glamo_lcd_cmd_mode(gdrm, 1); @@ -380,28 +380,6 @@ static void glamo_crtc_dpms(struct drm_crtc *crtc, int mode) } -void glamo_lcd_power(struct glamodrm_handle *gdrm, int mode) -{ - struct drm_crtc *crtc = gdrm->crtc; - struct glamo_crtc *gcrtc = to_glamo_crtc(crtc); - - if ( mode ) { - glamo_engine_enable(gdrm->glamo_core, GLAMO_ENGINE_LCD); - gcrtc->pixel_clock_on = 1; - jbt6k74_setpower(JBT_POWER_MODE_NORMAL); - if ( gcrtc->current_mode_set ) { - glamo_crtc_mode_set(crtc, &gcrtc->current_mode, - &gcrtc->current_mode, 0, 0, - gcrtc->current_fb); - } - } else { - jbt6k74_setpower(JBT_POWER_MODE_OFF); - glamo_engine_suspend(gdrm->glamo_core, GLAMO_ENGINE_LCD); - gcrtc->pixel_clock_on = 0; - } -} - - static void glamo_crtc_prepare(struct drm_crtc *crtc) { } @@ -862,6 +840,28 @@ int glamo_display_init(struct drm_device *dev) } +void glamo_lcd_power(struct glamodrm_handle *gdrm, int mode) +{ + struct drm_crtc *crtc = gdrm->crtc; + struct glamo_crtc *gcrtc = to_glamo_crtc(crtc); + + if ( mode ) { + glamo_engine_enable(gdrm->glamo_core, GLAMO_ENGINE_LCD); + gcrtc->pixel_clock_on = 1; + jbt6k74_setpower(JBT_POWER_MODE_NORMAL); + if ( gcrtc->current_mode_set ) { + glamo_crtc_mode_set(crtc, &gcrtc->current_mode, + &gcrtc->current_mode, 0, 0, + gcrtc->current_fb); + } + } else { + jbt6k74_setpower(JBT_POWER_MODE_OFF); + glamo_engine_suspend(gdrm->glamo_core, GLAMO_ENGINE_LCD); + gcrtc->pixel_clock_on = 0; + } +} + + void glamo_display_suspend(struct glamodrm_handle *gdrm) { /* do nothing */ |