diff options
| -rw-r--r-- | drivers/video/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/video/da8xx-fb.c | 38 |
2 files changed, 38 insertions, 1 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index a43594243186..005347a35b61 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
| @@ -2246,6 +2246,7 @@ config FB_DA8XX | |||
| 2246 | select FB_CFB_FILLRECT | 2246 | select FB_CFB_FILLRECT |
| 2247 | select FB_CFB_COPYAREA | 2247 | select FB_CFB_COPYAREA |
| 2248 | select FB_CFB_IMAGEBLIT | 2248 | select FB_CFB_IMAGEBLIT |
| 2249 | select FB_CFB_REV_PIXELS_IN_BYTE | ||
| 2249 | ---help--- | 2250 | ---help--- |
| 2250 | This is the frame buffer device driver for the TI LCD controller | 2251 | This is the frame buffer device driver for the TI LCD controller |
| 2251 | found on DA8xx/OMAP-L1xx SoCs. | 2252 | found on DA8xx/OMAP-L1xx SoCs. |
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index 8f7e05143708..47118c75a4c0 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c | |||
| @@ -239,6 +239,20 @@ static struct da8xx_panel known_lcd_panels[] = { | |||
| 239 | .pxl_clk = 7833600, | 239 | .pxl_clk = 7833600, |
| 240 | .invert_pxl_clk = 0, | 240 | .invert_pxl_clk = 0, |
| 241 | }, | 241 | }, |
| 242 | [2] = { | ||
| 243 | /* Hitachi SP10Q010 */ | ||
| 244 | .name = "SP10Q010", | ||
| 245 | .width = 320, | ||
| 246 | .height = 240, | ||
| 247 | .hfp = 10, | ||
| 248 | .hbp = 10, | ||
| 249 | .hsw = 10, | ||
| 250 | .vfp = 10, | ||
| 251 | .vbp = 10, | ||
| 252 | .vsw = 10, | ||
| 253 | .pxl_clk = 7833600, | ||
| 254 | .invert_pxl_clk = 0, | ||
| 255 | }, | ||
| 242 | }; | 256 | }; |
| 243 | 257 | ||
| 244 | /* Enable the Raster Engine of the LCD Controller */ | 258 | /* Enable the Raster Engine of the LCD Controller */ |
| @@ -547,7 +561,26 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green, | |||
| 547 | if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) | 561 | if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) |
| 548 | return 1; | 562 | return 1; |
| 549 | 563 | ||
| 550 | if (info->var.bits_per_pixel == 8) { | 564 | if (info->var.bits_per_pixel == 4) { |
| 565 | if (regno > 15) | ||
| 566 | return 1; | ||
| 567 | |||
| 568 | if (info->var.grayscale) { | ||
| 569 | pal = regno; | ||
| 570 | } else { | ||
| 571 | red >>= 4; | ||
| 572 | green >>= 8; | ||
| 573 | blue >>= 12; | ||
| 574 | |||
| 575 | pal = (red & 0x0f00); | ||
| 576 | pal |= (green & 0x00f0); | ||
| 577 | pal |= (blue & 0x000f); | ||
| 578 | } | ||
| 579 | if (regno == 0) | ||
| 580 | pal |= 0x2000; | ||
| 581 | palette[regno] = pal; | ||
| 582 | |||
| 583 | } else if (info->var.bits_per_pixel == 8) { | ||
| 551 | red >>= 4; | 584 | red >>= 4; |
| 552 | green >>= 8; | 585 | green >>= 8; |
| 553 | blue >>= 12; | 586 | blue >>= 12; |
| @@ -802,6 +835,7 @@ static int fb_check_var(struct fb_var_screeninfo *var, | |||
| 802 | var->blue.length = 8; | 835 | var->blue.length = 8; |
| 803 | var->transp.offset = 0; | 836 | var->transp.offset = 0; |
| 804 | var->transp.length = 0; | 837 | var->transp.length = 0; |
| 838 | var->nonstd = 0; | ||
| 805 | break; | 839 | break; |
| 806 | case 4: | 840 | case 4: |
| 807 | var->red.offset = 0; | 841 | var->red.offset = 0; |
| @@ -812,6 +846,7 @@ static int fb_check_var(struct fb_var_screeninfo *var, | |||
| 812 | var->blue.length = 4; | 846 | var->blue.length = 4; |
| 813 | var->transp.offset = 0; | 847 | var->transp.offset = 0; |
| 814 | var->transp.length = 0; | 848 | var->transp.length = 0; |
| 849 | var->nonstd = FB_NONSTD_REV_PIX_IN_B; | ||
| 815 | break; | 850 | break; |
| 816 | case 16: /* RGB 565 */ | 851 | case 16: /* RGB 565 */ |
| 817 | var->red.offset = 11; | 852 | var->red.offset = 11; |
| @@ -822,6 +857,7 @@ static int fb_check_var(struct fb_var_screeninfo *var, | |||
| 822 | var->blue.length = 5; | 857 | var->blue.length = 5; |
| 823 | var->transp.offset = 0; | 858 | var->transp.offset = 0; |
| 824 | var->transp.length = 0; | 859 | var->transp.length = 0; |
| 860 | var->nonstd = 0; | ||
| 825 | break; | 861 | break; |
| 826 | default: | 862 | default: |
| 827 | err = -EINVAL; | 863 | err = -EINVAL; |
