首先弄清楚linux内核中LCD驱动相关文件包含内容,在驱动任务承担啥角色,然后对照《S5PV210_UM_REV1.1.pdf》和自己的LCD user manual修改参数。
我就是以前没有动过这部分调试,狠狠的看了三星samsung的芯片手册和液晶屏的Driver IC。A8核比2440和6410的LCD控制器要复杂、强大。
下面开始 ==>>
linux2.6.32内核中,关于lcd的驱动主要的文件为:
/drivers/video/sumsung/s3cfb.c 、s3cfb_fimd6x.c 等
一、LCD初始化入口
@s3cfb.c lines1306
static int s3cfb_probe(struct platform_device *pdev)
{
struct s3c_platform_fb *pdata;
struct resource *res;
int ret = 0;
printk("# s3cfb_probe() for V-PDA LCD:\n");
#if 0
/* ldo6 regulator on */
printk("\t %s \n", __func__);
lcd_regulator = regulator_get(NULL, "vddlcd");
if (IS_ERR(lcd_regulator)) {
printk(KERN_ERR "failed to get resource %s\n", "vddlcd");
return PTR_ERR(lcd_regulator);
}
regulator_enable(lcd_regulator);
#endif
/* initialzing global structure */
fbdev = kzalloc(sizeof(struct s3cfb_global), GFP_KERNEL);
if (!fbdev) {
dev_err(fbdev->dev, "failed to allocate for "
"global fb structure\n");
goto err_global;
}
fbdev->dev = &pdev->dev;
s3cfb_set_lcd_info(fbdev);//added in ili9341
/* gpio */
pdata = to_fb_plat(&pdev->dev);
if (pdata->cfg_gpio)
pdata->cfg_gpio(pdev);
if (pdata->clk_on)
pdata->clk_on(pdev, &fbdev->clock);
/* io memory */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(fbdev->dev, "failed to get io memory region\n");
ret = -EINVAL;
goto err_io;
}
/* request mem region */
res = request_mem_region(res->start,
res->end - res->start + 1, pdev->name);
if (!res) {
dev_err(fbdev->dev, "failed to request io memory region\n");
ret = -EINVAL;
goto err_io;
}
/* ioremap for register block */
fbdev->regs = ioremap(res->start, res->end - res->start + 1);
if (!fbdev->regs) {
dev_err(fbdev->dev, "failed to remap io region\n");
ret = -EINVAL;
goto err_io;
}
/* irq */
fbdev->irq = platform_get_irq(pdev, 0);
if (request_irq(fbdev->irq, s3cfb_irq_frame, IRQF_SHARED,
pdev->name, fbdev)) {
dev_err(fbdev->dev, "request_irq failed\n");
ret = -EINVAL;
goto err_irq;
}
/*set gamma LUT*/ //SSCR xuhui 110130
s3cfb_set_gamma(fbdev);
#if 1
// added by jamie (2009.08.18)
// enable VSYNC
s3cfb_set_vsync_interrupt(fbdev, 1); //开启场同步信号
s3cfb_set_global_interrupt(fbdev, 1); //设置全局中断变量
#endif
#ifdef CONFIG_FB_S3C_TRACE_UNDERRUN
if (request_irq(platform_get_irq(pdev, 1), s3cfb_irq_fifo,
IRQF_DISABLED, pdev->name, fbdev)) {
dev_err(fbdev->dev, "request_irq failed\n");
ret = -EINVAL;
goto err_irq;
}
s3cfb_set_fifo_interrupt(fbdev, 1);
dev_info(fbdev->dev, "fifo underrun trace\n");
#endif