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

Merge at91 lcdfb bug fixes into fixes

These are part of a longer series that has been submitted some time
ago for the frame buffer tree, but it was never accepted there.
The first two of the five patches are bug fixes, so let's merge
this through arm-soc to get a working 3.9 kernel for at91.

* commit '67cf9c0a':
ARM: at91: fix LCD-wiring mode
atmel_lcdfb: fix 16-bpp modes on older SOCs

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+16 -8
+15 -7
drivers/video/atmel_lcdfb.c
··· 422 422 = var->bits_per_pixel; 423 423 break; 424 424 case 16: 425 + /* Older SOCs use IBGR:555 rather than BGR:565. */ 426 + if (sinfo->have_intensity_bit) 427 + var->green.length = 5; 428 + else 429 + var->green.length = 6; 430 + 425 431 if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) { 426 - /* RGB:565 mode */ 427 - var->red.offset = 11; 432 + /* RGB:5X5 mode */ 433 + var->red.offset = var->green.length + 5; 428 434 var->blue.offset = 0; 429 435 } else { 430 - /* BGR:565 mode */ 436 + /* BGR:5X5 mode */ 431 437 var->red.offset = 0; 432 - var->blue.offset = 11; 438 + var->blue.offset = var->green.length + 5; 433 439 } 434 440 var->green.offset = 5; 435 - var->green.length = 6; 436 441 var->red.length = var->blue.length = 5; 437 442 break; 438 443 case 32: ··· 684 679 685 680 case FB_VISUAL_PSEUDOCOLOR: 686 681 if (regno < 256) { 687 - if (cpu_is_at91sam9261() || cpu_is_at91sam9263() 688 - || cpu_is_at91sam9rl()) { 682 + if (sinfo->have_intensity_bit) { 689 683 /* old style I+BGR:555 */ 690 684 val = ((red >> 11) & 0x001f); 691 685 val |= ((green >> 6) & 0x03e0); ··· 874 870 } 875 871 sinfo->info = info; 876 872 sinfo->pdev = pdev; 873 + if (cpu_is_at91sam9261() || cpu_is_at91sam9263() || 874 + cpu_is_at91sam9rl()) { 875 + sinfo->have_intensity_bit = true; 876 + } 877 877 878 878 strcpy(info->fix.id, sinfo->pdev->name); 879 879 info->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
+1 -1
include/video/atmel_lcdc.h
··· 30 30 */ 31 31 #define ATMEL_LCDC_WIRING_BGR 0 32 32 #define ATMEL_LCDC_WIRING_RGB 1 33 - #define ATMEL_LCDC_WIRING_RGB555 2 34 33 35 34 36 35 /* LCD Controller info data structure, stored in device platform_data */ ··· 61 62 void (*atmel_lcdfb_power_control)(int on); 62 63 struct fb_monspecs *default_monspecs; 63 64 u32 pseudo_palette[16]; 65 + bool have_intensity_bit; 64 66 }; 65 67 66 68 #define ATMEL_LCDC_DMABADDR1 0x00