提交 f413070e 编写于 作者: A Anatolij Gustschin 提交者: Florian Tobias Schandinat

fbdev: da8xx: add support for SP10Q010 display

Add timing data for Hitachi SP10Q010 display and allow configuration
of the 4bpp palette. For 4bpp framebuffer enable reversed order of
pixels in a byte. This requires defining FB_CFB_REV_PIXELS_IN_BYTE
and additionally setting var.nonstd to the value FB_NONSTD_REV_PIX_IN_B.
Note that it is not enough to set da8xx_fb_var.nonstd to this value
statically, since FBIOPUT_VSCREENINFO ioctl might pass var struct with
.nonstd field set to zero or another value. Therefore this setting must
be adjusted in fb_check_var() according to the requested bpp value.
Signed-off-by: NAnatolij Gustschin <agust@denx.de>
Cc: Manjunathappa, Prakash <prakash.pm@ti.com>
Signed-off-by: NFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>
上级 084e104b
...@@ -2246,6 +2246,7 @@ config FB_DA8XX ...@@ -2246,6 +2246,7 @@ config FB_DA8XX
select FB_CFB_FILLRECT select FB_CFB_FILLRECT
select FB_CFB_COPYAREA select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT select FB_CFB_IMAGEBLIT
select FB_CFB_REV_PIXELS_IN_BYTE
---help--- ---help---
This is the frame buffer device driver for the TI LCD controller This is the frame buffer device driver for the TI LCD controller
found on DA8xx/OMAP-L1xx SoCs. found on DA8xx/OMAP-L1xx SoCs.
......
...@@ -239,6 +239,20 @@ static struct da8xx_panel known_lcd_panels[] = { ...@@ -239,6 +239,20 @@ static struct da8xx_panel known_lcd_panels[] = {
.pxl_clk = 7833600, .pxl_clk = 7833600,
.invert_pxl_clk = 0, .invert_pxl_clk = 0,
}, },
[2] = {
/* Hitachi SP10Q010 */
.name = "SP10Q010",
.width = 320,
.height = 240,
.hfp = 10,
.hbp = 10,
.hsw = 10,
.vfp = 10,
.vbp = 10,
.vsw = 10,
.pxl_clk = 7833600,
.invert_pxl_clk = 0,
},
}; };
/* Enable the Raster Engine of the LCD Controller */ /* Enable the Raster Engine of the LCD Controller */
...@@ -547,7 +561,26 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green, ...@@ -547,7 +561,26 @@ static int fb_setcolreg(unsigned regno, unsigned red, unsigned green,
if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) if (info->fix.visual == FB_VISUAL_DIRECTCOLOR)
return 1; return 1;
if (info->var.bits_per_pixel == 8) { if (info->var.bits_per_pixel == 4) {
if (regno > 15)
return 1;
if (info->var.grayscale) {
pal = regno;
} else {
red >>= 4;
green >>= 8;
blue >>= 12;
pal = (red & 0x0f00);
pal |= (green & 0x00f0);
pal |= (blue & 0x000f);
}
if (regno == 0)
pal |= 0x2000;
palette[regno] = pal;
} else if (info->var.bits_per_pixel == 8) {
red >>= 4; red >>= 4;
green >>= 8; green >>= 8;
blue >>= 12; blue >>= 12;
...@@ -802,6 +835,7 @@ static int fb_check_var(struct fb_var_screeninfo *var, ...@@ -802,6 +835,7 @@ static int fb_check_var(struct fb_var_screeninfo *var,
var->blue.length = 8; var->blue.length = 8;
var->transp.offset = 0; var->transp.offset = 0;
var->transp.length = 0; var->transp.length = 0;
var->nonstd = 0;
break; break;
case 4: case 4:
var->red.offset = 0; var->red.offset = 0;
...@@ -812,6 +846,7 @@ static int fb_check_var(struct fb_var_screeninfo *var, ...@@ -812,6 +846,7 @@ static int fb_check_var(struct fb_var_screeninfo *var,
var->blue.length = 4; var->blue.length = 4;
var->transp.offset = 0; var->transp.offset = 0;
var->transp.length = 0; var->transp.length = 0;
var->nonstd = FB_NONSTD_REV_PIX_IN_B;
break; break;
case 16: /* RGB 565 */ case 16: /* RGB 565 */
var->red.offset = 11; var->red.offset = 11;
...@@ -822,6 +857,7 @@ static int fb_check_var(struct fb_var_screeninfo *var, ...@@ -822,6 +857,7 @@ static int fb_check_var(struct fb_var_screeninfo *var,
var->blue.length = 5; var->blue.length = 5;
var->transp.offset = 0; var->transp.offset = 0;
var->transp.length = 0; var->transp.length = 0;
var->nonstd = 0;
break; break;
default: default:
err = -EINVAL; err = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册