移植GT9XX遇到的问题

gt9xx驱动移植触摸不准:厂家提供的cfg有问题,重新问厂家要一份正确的

XY坐标镜像:

在gtp_get_points函数里修改代码:

if(ts->pdata->reverse_xy) {
	points[i].x = ts->pdata->abs_size_x - (coor_data[1] | (coor_data[2] << 8));
	points[i].y = ts->pdata->abs_size_y - (coor_data[3] | (coor_data[4] << 8));
} else {
	points[i].x = coor_data[1] | (coor_data[2] << 8);
	points[i].y = coor_data[3] | (coor_data[4] << 8);
}

设备树节点:

gt9xx@0x5d {
	compatible = "goodix,gt9xx";
	reg = <0x5d>;
	status = "okay";
	interrupt-parent = <&gpe>;
	interrupts = <5 IRQ_TYPE_EDGE_FALLING>;

	reset-gpios = <&gpc 6 0>;
	irq-gpios = <&gpe 11 0>;
	irq-flags = <2>;

	touchscreen-max-id = <11>;
	touchscreen-size-x = <720>;
	touchscreen-size-y = <1280>;
	touchscreen-max-w = <720>;
	touchscreen-max-p = <512>;
	touchscreen-key-map = <172>, <158>;

	goodix,reverse-xy = <1>;
	goodix,slide-wakeup = <0>;
	goodix,type-a-report = <0>;
	goodix,driver-send-cfg = <1>;
	goodix,resume-in-workqueue = <0>;
	goodix,int-sync = <1>;
	goodix,swap-x2y = <1>;
	goodix,esd-protect = <0>;
	goodix,auto-update-cfg = <0>;
	goodix,power-off-sleep = <0>;
	goodix,pen-suppress-finger = <0>;
	goodix,transform-type = <0>;	/* transform for p2s */

	goodix,cfg-group2 = <
		0x00 0x00 0x05 0xD0 0x02 0x05 0x3D
		0x08 0x01 0xC8 0x1E 0x0C 0x50 0x41
		0x03 0x05 0x00 0x00 0x00 0x00 0x00
		0x00 0x05 0x18 0x1A 0x1E 0x14 0x8C
		0x2E 0x0E 0x7D 0x7F 0x0C 0x08 0x00
		0x00 0x00 0x59 0x02 0x2C 0x00 0x00
		0x00 0x00 0x00 0x00 0x00 0x00 0x00
		0x00 0x00 0x64 0xA0 0x94 0xD5 0x02
		0x07 0x14 0x00 0x04 0x8D 0x68 0x00
		0x85 0x73 0x00 0x7F 0x7E 0x00 0x7A
		0x8B 0x00 0x76 0x98 0x00 0x76 0x00
		0x00 0x00 0x00 0x00 0x00 0x00 0x00
		0x00 0x00 0x00 0x00 0x00 0x00 0x00
		0x00 0x00 0x00 0x00 0x00 0x00 0x00
		0x00 0x00 0x00 0x00 0x00 0x00 0x00
		0x00 0x00 0x00 0x00 0x00 0x00 0x00
		0x02 0x04 0x06 0x08 0x0A 0x0C 0x0E
		0x10 0x12 0x14 0x16 0x18 0x1A 0x1C
		0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
		0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
		0xFF 0xFF 0x14 0x13 0x12 0x10 0x0F
		0x0C 0x0A 0x08 0x06 0x04 0x02 0x00
		0x16 0x18 0x1C 0x1D 0x1E 0x1F 0x20
		0x21 0x22 0x24 0x26 0x28 0x29 0x2A
		0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
		0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
		0xFF 0xFF 0x8A 0x01
		>;
};

dev_dbg(&ts->client->dev, "[%d][%d %d %d]\n", points[i].id, points[i].x, points[i].y, points[i].p); // 打印信息

dmesg | grep goodix 查看触摸时的坐标 

i2cdetect -l               列出系统中存在的I2C总线
i2cdump -f -y 2  0x5d w    查看I2C2总线上地址为0x5d的寄存器内容
i2cdetect -y 2             查看I2C2总线上的I2C设备
‘--’:表示该地址被检测,但没有芯片应答
‘UU’:表示该地址当前由内核驱动程序使用 

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Wu小燕呀

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值