Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[ARM] pxafb: add palette format support for LCCR4_PAL_FOR_3

Add the palette format support for LCCR4_PAL_FOR_3, and fix the
issue of LCCR4 being never assigned.

Also remove the useless pxafb_set_truecolor().

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Eric Miao <ycmiao@ycmiao-hp520.(none)>

authored by

Eric Miao and committed by
Eric Miao
a0427509 6e354846

+11 -11
+1
arch/arm/mach-pxa/include/mach/regs-lcd.h
··· 48 48 #define LCCR4_PAL_FOR_0 (0 << 15) 49 49 #define LCCR4_PAL_FOR_1 (1 << 15) 50 50 #define LCCR4_PAL_FOR_2 (2 << 15) 51 + #define LCCR4_PAL_FOR_3 (3 << 15) 51 52 #define LCCR4_PAL_FOR_MASK (3 << 15) 52 53 53 54 #define FDADR0 (0x200) /* DMA Channel 0 Frame Descriptor Address Register */
+10 -11
drivers/video/pxafb.c
··· 155 155 val |= ((blue >> 8) & 0x000000fc); 156 156 ((u32 *)(fbi->palette_cpu))[regno] = val; 157 157 break; 158 + case LCCR4_PAL_FOR_3: 159 + val = ((red << 8) & 0x00ff0000); 160 + val |= ((green >> 0) & 0x0000ff00); 161 + val |= ((blue >> 8) & 0x000000ff); 162 + ((u32 *)(fbi->palette_cpu))[regno] = val; 163 + break; 158 164 } 159 165 160 166 return 0; ··· 422 416 return 0; 423 417 } 424 418 425 - static inline void pxafb_set_truecolor(u_int is_true_color) 426 - { 427 - /* do your machine-specific setup if needed */ 428 - } 429 - 430 419 /* 431 420 * pxafb_set_par(): 432 421 * Set the user defined part of the display for the specified console ··· 453 452 4 : 1 << var->bits_per_pixel; 454 453 455 454 fbi->palette_cpu = (u16 *)&fbi->dma_buff->palette[0]; 456 - 457 - /* 458 - * Set (any) board control register to handle new color depth 459 - */ 460 - pxafb_set_truecolor(fbi->fb.fix.visual == FB_VISUAL_TRUECOLOR); 461 455 462 456 if (fbi->fb.var.bits_per_pixel >= 16) 463 457 fb_dealloc_cmap(&fbi->fb.cmap); ··· 723 727 lcd_writel(fbi, LCCR1, fbi->reg_lccr1); 724 728 lcd_writel(fbi, LCCR2, fbi->reg_lccr2); 725 729 lcd_writel(fbi, LCCR3, fbi->reg_lccr3); 730 + lcd_writel(fbi, LCCR4, fbi->reg_lccr4); 726 731 lcd_writel(fbi, FDADR0, fbi->fdadr[0]); 727 732 lcd_writel(fbi, FDADR6, fbi->fdadr[6]); 728 733 ··· 992 995 (lcd_readl(fbi, LCCR1) != fbi->reg_lccr1) || 993 996 (lcd_readl(fbi, LCCR2) != fbi->reg_lccr2) || 994 997 (lcd_readl(fbi, LCCR3) != fbi->reg_lccr3) || 998 + (lcd_readl(fbi, LCCR4) != fbi->reg_lccr4) || 995 999 (lcd_readl(fbi, FDADR0) != fbi->fdadr[0]) || 996 1000 (lcd_readl(fbi, FDADR1) != fbi->fdadr[1])) 997 1001 pxafb_schedule_work(fbi, C_REENABLE); ··· 1039 1041 return; 1040 1042 1041 1043 /* Sequence from 11.7.10 */ 1044 + lcd_writel(fbi, LCCR4, fbi->reg_lccr4); 1042 1045 lcd_writel(fbi, LCCR3, fbi->reg_lccr3); 1043 1046 lcd_writel(fbi, LCCR2, fbi->reg_lccr2); 1044 1047 lcd_writel(fbi, LCCR1, fbi->reg_lccr1); ··· 1312 1313 1313 1314 fbi->cmap_inverse = inf->cmap_inverse; 1314 1315 fbi->cmap_static = inf->cmap_static; 1316 + fbi->lccr4 = inf->lccr4; 1315 1317 1316 1318 switch (lcd_conn & LCD_TYPE_MASK) { 1317 1319 case LCD_TYPE_MONO_STN: ··· 1337 1337 /* fall back to backward compatibility way */ 1338 1338 fbi->lccr0 = inf->lccr0; 1339 1339 fbi->lccr3 = inf->lccr3; 1340 - fbi->lccr4 = inf->lccr4; 1341 1340 goto decode_mode; 1342 1341 } 1343 1342