参考
屏幕型号, 自带GT911触摸,分辨率480x854
KD050FWFPA011-C009A
打开内核支持
│ Location: │
│ -> Device Drivers │
│ -> Input device support │
│ -> Generic input layer (needed for keyboard, mouse, ...) (INPUT [=y]) │
│ -> Touchscreens (INPUT_TOUCHSCREEN [=y])
TOUCHSCREEN_GOODIX [=y]
修改dts 文件
将下段配置放在i2c下即可
gt911:gt911@5d{
compatible = "goodix,gt911","goodix,gt9xx";
status = "okay";
reg = <0x5d>;
pinctrl-names = "default";
interrupt-parent = <&pio>;
interrupts = <1 4 IRQ_TYPE_EDGE_FALLING>; /* PB4 */
irq-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
reset-gpios = <&pio 1 5 GPIO_ACTIVE_HIGH>; /* PB5 */
/* touchscreen-swapped-x-y; */
/*touchscreen-size-x = <480>;
touchscreen-size-y = <850>;*/
};
log
如下,因为之前中断配错,出现了i2c获取的和通过io获取的不一致,加入了中断号的打印。
gt911 由于内部有otp,我的这块内部的参数本来就是480x854对的,也就不需要倒入配置文件(我也不会)。
[ 769.467201] base 32, pin 36, irq -1054213100
[ 769.471718] Goodix-TS 1-005d: supply AVDD28 not found, using dummy regulator
[ 769.479136] Goodix-TS 1-005d: supply VDDIO not found, using dummy regulator
[ 769.486253] Goodix-TS 1-005d: Irq from irq gpiod c14daf85, 49
[ 769.492100] base 32, pin 36, irq -1054213164
[ 769.496376] Goodix-TS 1-005d: Irq from of irq 49
[ 769.501153] Goodix-TS 1-005d: Irq from reset gpiod 7b4a2cfd, 50
[ 769.619970] Goodix-TS 1-005d: ID 911, version: 1060
[ 769.626642] Goodix-TS 1-005d: Direct firmware load for goodix_911_cfg.bin failed with error -2
[ 769.658520] Goodix-TS 1-005d: config x,y: 480,854
[ 769.663501] input: Goodix Capacitive TouchScreen as /devices/platform/i2c2/i2c-1/1-005d/input/input1
[ 769.675031] Goodix-TS 1-005d: irq num:49
使用 hexdump 进行事件查看,能获取到响应,理论上说应是通过了。