TFT LCD在S5PV210平台调试记录

本文详细记录了在S5PV210平台上调试TFT LCD的过程,涉及Linux内核中的LCD驱动文件解析,如s3cfb.c和s3cfb_fimd6x.c。通过芯片手册和LCD驱动IC,理解初始化流程,包括VIDCON0至WxPDATAxx等寄存器的配置,以实现正确的RGB接口控制信号。文章还探讨了VTIME模块的作用,以及如何计算帧率。
摘要由CSDN通过智能技术生成

首先弄清楚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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值