From 98b7291ecb2848194351c9e7b84173aa3e5d95a8 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 8 Mar 2010 23:51:09 +0100 Subject: Clean up JBT hooks, and allow resolution switching Signed-off-by: Thomas White --- drivers/mfd/glamo/glamo-display.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'drivers/mfd/glamo/glamo-display.c') diff --git a/drivers/mfd/glamo/glamo-display.c b/drivers/mfd/glamo/glamo-display.c index 5f0469723b5..e56cdb437c7 100644 --- a/drivers/mfd/glamo/glamo-display.c +++ b/drivers/mfd/glamo/glamo-display.c @@ -52,19 +52,18 @@ * */ -#define DEBUG 1 - #include #include #include #include +#include +#include #include "glamo-core.h" #include "glamo-drm-private.h" #include "glamo-regs.h" #include "glamo-kms-fb.h" #include "glamo-display.h" -#include #define GLAMO_LCD_WIDTH_MASK 0x03FF @@ -356,6 +355,12 @@ static int glamo_crtc_mode_set(struct drm_crtc *crtc, glamo_lcd_cmd_mode(gdrm, 0); + if ( mode->hdisplay == 240 ) { + jbt6k74_setresolution(JBT_RESOLUTION_QVGA); + } else { + jbt6k74_setresolution(JBT_RESOLUTION_VGA); + } + glamo_crtc_mode_set_base(crtc, 0, 0, old_fb); gcrtc->current_mode = *mode; @@ -366,8 +371,6 @@ static int glamo_crtc_mode_set(struct drm_crtc *crtc, } -extern void jbt6k74_action(int val); - /* This is not the right place to switch power on/off, because the helper * stuff ends up calling this before/after setting the mode. We can't * set modes with the display off (although backlight off would be OK) */ @@ -385,14 +388,14 @@ void glamo_lcd_power(struct glamodrm_handle *gdrm, int mode) if ( mode ) { glamo_engine_enable(gdrm->glamo_core, GLAMO_ENGINE_LCD); gcrtc->pixel_clock_on = 1; - jbt6k74_action(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_action(0); + jbt6k74_setpower(JBT_POWER_MODE_OFF); glamo_engine_suspend(gdrm->glamo_core, GLAMO_ENGINE_LCD); gcrtc->pixel_clock_on = 0; } -- cgit v1.2.3