From 1ddb8a16aa0e60e7fdc48b1f532cf43e692f8fae Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 30 Apr 2005 22:39:51 +0100 Subject: [PATCH 1/3] [PATCH] ARM: AMBA CLCD: program palette for pseudocolor visuals Signed-off-by: Russell King --- drivers/video/amba-clcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 3e386fd4c5c6..2896a380d4ea 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -256,7 +256,7 @@ clcdfb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, convert_bitfield(green, &fb->fb.var.green) | convert_bitfield(red, &fb->fb.var.red); - if (fb->fb.var.bits_per_pixel == 8 && regno < 256) { + if (fb->fb.fix.visual == FB_VISUAL_PSEUDOCOLOR && regno < 256) { int hw_reg = CLCD_PALETTE + ((regno * 2) & ~3); u32 val, mask, newval; From ed562ab12733ab75437b3390427d41fce9da83c3 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 30 Apr 2005 23:28:47 +0100 Subject: [PATCH 2/3] [PATCH] ARM: IntegratorCP: 16bpp is RGB565 not RGB555 Signed-off-by: Russell King --- drivers/video/amba-clcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 2896a380d4ea..321dbe91dc14 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -134,16 +134,16 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var) break; case 16: var->red.length = 5; - var->green.length = 5; + var->green.length = 6; var->blue.length = 5; if (fb->panel->cntl & CNTL_BGR) { - var->red.offset = 10; + var->red.offset = 11; var->green.offset = 5; var->blue.offset = 0; } else { var->red.offset = 0; var->green.offset = 5; - var->blue.offset = 10; + var->blue.offset = 11; } break; case 32: From 4774e2260cf25c54f2188dd0407676e3af6f1f23 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 30 Apr 2005 23:32:38 +0100 Subject: [PATCH 3/3] [PATCH] ARM: IntegratorCP: Fix CLCD MUX selection values The documentation on these values seems to be rather wrong. These values have been determined by mere trial and error. Signed-off-by: Russell King --- arch/arm/mach-integrator/integrator_cp.c | 17 ++++++++++++++++- include/asm-arm/arch-integrator/cm.h | 6 +++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index 68e15c36e336..3b948e8c2751 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c @@ -420,7 +420,22 @@ static struct clcd_panel vga = { */ static void cp_clcd_enable(struct clcd_fb *fb) { - cm_control(CM_CTRL_LCDMUXSEL_MASK, CM_CTRL_LCDMUXSEL_VGA); + u32 val; + + if (fb->fb.var.bits_per_pixel <= 8) + val = CM_CTRL_LCDMUXSEL_VGA_8421BPP; + else if (fb->fb.var.bits_per_pixel <= 16) + val = CM_CTRL_LCDMUXSEL_VGA_16BPP; + else + val = 0; /* no idea for this, don't trust the docs */ + + cm_control(CM_CTRL_LCDMUXSEL_MASK| + CM_CTRL_LCDEN0| + CM_CTRL_LCDEN1| + CM_CTRL_STATIC1| + CM_CTRL_STATIC2| + CM_CTRL_STATIC| + CM_CTRL_n24BITEN, val); } static unsigned long framesize = SZ_1M; diff --git a/include/asm-arm/arch-integrator/cm.h b/include/asm-arm/arch-integrator/cm.h index d31c1a71f781..1ab353e23595 100644 --- a/include/asm-arm/arch-integrator/cm.h +++ b/include/asm-arm/arch-integrator/cm.h @@ -24,9 +24,9 @@ void cm_control(u32, u32); #define CM_CTRL_LCDBIASDN (1 << 10) #define CM_CTRL_LCDMUXSEL_MASK (7 << 11) #define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11) -#define CM_CTRL_LCDMUXSEL_SHARPLCD1 (3 << 11) -#define CM_CTRL_LCDMUXSEL_SHARPLCD2 (4 << 11) -#define CM_CTRL_LCDMUXSEL_VGA (7 << 11) +#define CM_CTRL_LCDMUXSEL_VGA_16BPP (2 << 11) +#define CM_CTRL_LCDMUXSEL_SHARPLCD (3 << 11) +#define CM_CTRL_LCDMUXSEL_VGA_8421BPP (4 << 11) #define CM_CTRL_LCDEN0 (1 << 14) #define CM_CTRL_LCDEN1 (1 << 15) #define CM_CTRL_STATIC1 (1 << 16)