您尚未登录。

楼主 # 2021-07-02 20:56:48

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

ft5426

请问ft5426驱动和ft5406兼容吗?
这设备树有没有毛病

			ft5426: ft5426@38 {
				compatible = "edt,edt-ft5406","edt,edt-ft5x06";
				reg = <0x38>;
				pinctrl-names = "default";
				//pinctrl-0 = <&pinctrl_tsc>;
				interrupt-parent = <&pio>;
				interrupts = < PF 5 IRQ_TYPE_EDGE_FALLING>;
				interrupt-gpios = <&pio PF 5 6 0xffffffff 0xffffffff 0>;
				reset-gpios = <&pio PF 6 1 0xffffffff 0xffffffff 1>;
				
				status = "okay";
			};

离线

#1 2021-07-02 21:29:29

哇酷小二
wechat微信:whycan_cn
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,378
积分: 1902
个人网站

Re: ft5426

https://github.com/torvalds/linux/blob/master/drivers/input/touchscreen/edt-ft5x06.c

从驱动代码看是没问题的:

static const struct of_device_id edt_ft5x06_of_match[] = {
	{ .compatible = "edt,edt-ft5206", .data = &edt_ft5x06_data },
	{ .compatible = "edt,edt-ft5306", .data = &edt_ft5x06_data },
	{ .compatible = "edt,edt-ft5406", .data = &edt_ft5x06_data },
	{ .compatible = "edt,edt-ft5506", .data = &edt_ft5506_data },
	{ .compatible = "evervision,ev-ft5726", .data = &edt_ft5506_data },
	/* Note focaltech vendor prefix for compatibility with ft6236.c */
	{ .compatible = "focaltech,ft6236", .data = &edt_ft6236_data },
	{ /* sentinel */ }
};




离线

楼主 #2 2021-07-03 09:00:59

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

edt-ft5x06.c编译进去了,设备树也添加了,但是竟然没反应。同一个i2c上挂在的其他设备都有log出来

[    3.301947] rtc-ds1307: probe of 3-0068 failed with error -5
[    3.312606] rtc-pcf8563 3-0051: rtc core: registered rtc-pcf8563 as rtc0

即便ft5426不存在,是不是也有下面这句log出来
probing for EDT FT5x06 I2C 或者 touchscreen probe failed 之类的
但是什么都没有,这是什么原因

最近编辑记录 cris8259 (2021-07-03 09:03:51)

离线

#3 2021-07-03 09:15:52

哇酷小二
wechat微信:whycan_cn
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,378
积分: 1902
个人网站

Re: ft5426

https://github.com/torvalds/linux/blob/master/drivers/input/touchscreen/edt-ft5x06.c


看这个文件有没有参与编译,probe函数里面加一些调试代码。





离线

楼主 #4 2021-07-03 09:32:03

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

有参与编译,edt-ft5x06.ko文件都出来了

离线

楼主 #5 2021-07-03 17:35:03

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

直接编译进内核,不使用模块编译就可以了。但是新的问题来了,左右移动触摸的时候,鼠标指针上下移动。上下移动触摸的时候,鼠标指针左右移动。

                touchscreen-size-x = <1024>;
                touchscreen-size-y = <600>;
                touchscreen-inverted-x = <0>;
                touchscreen-inverted-y = <0>;
                touchscreen-swapped-x-y = <0>;
inverted-x , inverted-y , swapped-x-y 改成1 都没效果 。这是什么原因

离线

楼主 #6 2021-07-07 17:39:19

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

该评论内容与本帖子无关,鼓励各位坑友积极发言讨论与帖子有关的内容!

离线

  • 不通过:与技术无关

#7 2021-07-07 17:41:08

哇酷小二
wechat微信:whycan_cn
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,378
积分: 1902
个人网站

Re: ft5426

只改其中一个看效果呢?





离线

楼主 #8 2021-07-08 08:37:04

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

任何一个或者组合都没有效果

离线

#9 2021-07-08 09:08:45

哇酷小二
wechat微信:whycan_cn
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,378
积分: 1902
个人网站

Re: ft5426

https://elixir.bootlin.com/linux/v4.9/source/drivers/input/touchscreen/of_touchscreen.c

static void
touchscreen_apply_prop_to_x_y(const struct touchscreen_properties *prop,
                              unsigned int *x, unsigned int *y)
{
        if (prop->invert_x)
                *x = prop->max_x - *x;

        if (prop->invert_y)
                *y = prop->max_y - *y;

        if (prop->swap_x_y)
                swap(*x, *y);
}
        prop->max_x = input_abs_get_max(input, axis);
        prop->max_y = input_abs_get_max(input, axis + 1);

        prop->invert_x =
                device_property_read_bool(dev, "touchscreen-inverted-x");
        if (prop->invert_x) {
                absinfo = &input->absinfo[axis];
                absinfo->maximum -= absinfo->minimum;
                absinfo->minimum = 0;
        }

        prop->invert_y =
                device_property_read_bool(dev, "touchscreen-inverted-y");
        if (prop->invert_y) {
                absinfo = &input->absinfo[axis + 1];
                absinfo->maximum -= absinfo->minimum;

这里加调试语句





离线

楼主 #10 2021-07-08 17:29:06

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

void touchscreen_parse_properties(struct input_dev *input, bool multitouch)
{
	struct device *dev = input->dev.parent;
	unsigned int axis;
	unsigned int maximum, fuzz;
	bool data_present;

	input_alloc_absinfo(input);
	if (!input->absinfo)
		return;

	axis = multitouch ? ABS_MT_POSITION_X : ABS_X;
	data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-x",
						input_abs_get_max(input,
								  axis) + 1,
						&maximum) |
		       touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x",
						input_abs_get_fuzz(input, axis),
						&fuzz);
	if (data_present)
		touchscreen_set_params(input, axis, maximum - 1, fuzz);

	axis = multitouch ? ABS_MT_POSITION_Y : ABS_Y;
	data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-y",
						input_abs_get_max(input,
								  axis) + 1,
						&maximum) |
		       touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y",
						input_abs_get_fuzz(input, axis),
						&fuzz);
	if (data_present)
		touchscreen_set_params(input, axis, maximum - 1, fuzz);

	axis = multitouch ? ABS_MT_PRESSURE : ABS_PRESSURE;
	data_present = touchscreen_get_prop_u32(dev,
						"touchscreen-max-pressure",
						input_abs_get_max(input, axis),
						&maximum) |
		       touchscreen_get_prop_u32(dev,
						"touchscreen-fuzz-pressure",
						input_abs_get_fuzz(input, axis),
						&fuzz);
	if (data_present)
		touchscreen_set_params(input, axis, maximum, fuzz);
}
EXPORT_SYMBOL(touchscreen_parse_properties);

原来解析属性函数没有touchscreen-inverted-x 这些关键字

离线

#11 2021-07-08 17:42:28

哇酷小二
wechat微信:whycan_cn
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,378
积分: 1902
个人网站

Re: ft5426

@cris8259
你的linux版本?





离线

楼主 #12 2021-07-09 08:38:32

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

版本4.9.170
但是我看你发的地址 https://elixir.bootlin.com/linux/v4.9/source/drivers/input/touchscreen/of_touchscreen.c 这里面4.9.170 是有touchscreen-inverted-x 这些参数的

离线

#13 2021-07-09 08:45:58

哇酷小二
wechat微信:whycan_cn
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,378
积分: 1902
个人网站

Re: ft5426

cris8259 说:

版本4.9.170
但是我看你发的地址 https://elixir.bootlin.com/linux/v4.9/source/drivers/input/touchscreen/of_touchscreen.c 这里面4.9.170 是有touchscreen-inverted-x 这些参数的

看起来你的SDK有毒,估计是补丁打来打去, 可能被删掉了,如果有git的话跟踪一下,看下哪个大神删掉跑路的。如果没有git记录就自己把哪个 input/touchscreen/ 文件夹都复制过来好了。





离线

楼主 #14 2021-07-09 15:37:34

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

没有git跟踪,全志给的代码

离线

楼主 #15 2021-07-09 21:26:25

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

感谢@哇酷小二,搞定收工

离线

#16 2021-07-09 21:30:09

哇酷小二
wechat微信:whycan_cn
所在地: 你猜
注册时间: 2020-04-22
已发帖子: 3,378
积分: 1902
个人网站

Re: ft5426

cris8259 说:

感谢@哇酷小二,搞定收工

怎么解决的呢?





离线

楼主 #17 2021-07-10 14:06:04

cris8259
会员
注册时间: 2019-09-25
已发帖子: 262
积分: 131

Re: ft5426

按照你说的,驱动文件更新覆盖掉

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn