请问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";
};
离线
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 */ }
};
离线
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)
离线
有参与编译,edt-ft5x06.ko文件都出来了
离线
直接编译进内核,不使用模块编译就可以了。但是新的问题来了,左右移动触摸的时候,鼠标指针上下移动。上下移动触摸的时候,鼠标指针左右移动。
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 都没效果 。这是什么原因
离线
离线
任何一个或者组合都没有效果
离线
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;
这里加调试语句
离线
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 这些关键字
离线
版本4.9.170
但是我看你发的地址 https://elixir.bootlin.com/linux/v4.9/source/drivers/input/touchscreen/of_touchscreen.c 这里面4.9.170 是有touchscreen-inverted-x 这些参数的
离线
版本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/ 文件夹都复制过来好了。
离线
没有git跟踪,全志给的代码
离线
感谢@哇酷小二,搞定收工
离线
按照你说的,驱动文件更新覆盖掉
离线