# modprobe goodix
[ 21.535554] Goodix-TS 0-005d: ID 9147, version: 1040
[ 21.541131] Goodix-TS: probe of 0-0014 failed with error -16
[ 21.547465] Goodix-TS 0-005d: Direct firmware load for goodix_9147_cfg.bin failed with error -2
[ 21.575277] i2c i2c-0: mv64xxx_i2c_fsm: Ctlr Error -- state: 0x7, status: 0x0, addr: 0x5d, flags: 0x1
[ 21.585478] Goodix-TS 0-005d: Error reading config (-5), using defaults
[ 21.592777] input: Goodix Capacitive TouchScreen as /devices/platform/soc/1c27000.i2c/i2c-0/0-005d/input/input1
# [ 21.675839] Goodix-TS 0-005d: I2C transfer error: -6
最近编辑记录 nuvoton (2019-12-11 19:54:59)
离线
https://whycan.cn/t_2358.html#p17790
好像找不到一个差不多的, 不知道这位朋友有没有解决?
离线
找到@xm1994的帖子: https://whycan.cn/t_2688.html
https://github.com/summershrimp/opendeck-linux/commit/eb7a274d02b52a02198e3b2726df822eed0f36c8
drivers/input/touchscreen/goodix.c
这个驱动文件还要打点补丁才行:
@@ -777,6 +777,23 @@ static void goodix_config_cb(const struct firmware *cfg, void *ctx)
error = goodix_send_cfg(ts, cfg);
if (error)
goto err_release_cfg;
} else {
u8 check_sum = 0; //校验和
int i=0;
/* 800*480屏使用 */
u8 write2gt911[GOODIX_CONFIG_911_LENGTH] = {0x42, 0xe0, 0x01, 0x20, 0x03, 0x0a, 0x35, 0x00, 0x01, 0x08, 0x28, 0x08, 0x5a, 0x46, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1a, 0x1e, 0x14, 0x89, 0x2a, 0x09, 0x57, 0x5c, 0xb5, 0x06, 0x00, 0x00, 0x00, 0x02, 0x01, 0x1d, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, 0x94, 0xc5, 0x02, 0x07, 0x00, 0x00, 0x04, 0x96, 0x4a, 0x00, 0x85, 0x54, 0x00, 0x77, 0x5f, 0x00, 0x6a, 0x6c, 0x00, 0x5f, 0x7a, 0x00, 0x5f, 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, 0x10, 0x12, 0x14, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0f, 0x10, 0x12, 0x16, 0x18, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x24, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00};
write2gt911[GOODIX_CONFIG_911_LENGTH - 1] = 0x01; //update flag
for (i = 0; i < (GOODIX_CONFIG_911_LENGTH - 2); i++) //校验和计算
check_sum += write2gt911[i];
write2gt911[184] = (~check_sum) + 1; //checksum
error = goodix_i2c_write(ts->client, ts->chip->config_addr, write2gt911, GOODIX_CONFIG_911_LENGTH);
dev_warn(&ts->client->dev,
"updated the user defined config \n",
error);
/* Let the firmware reconfigure itself, so sleep for 10ms */
usleep_range(10000, 11000);
}
goodix_configure_dev(ts);
可是我的芯片是 GT9147, 这可怎么办呢?
不管了, 先照葫芦画瓢吧.
离线
终于找到一个固件: goodix_9147_cfg.zip
拷贝到 /lib/firmware/goodix_9147_cfg.bin
可以注册成功:
# modprobe goodix
[ 39.985469] Goodix-TS 0-005d: ID 9147, version: 1040
[ 40.058363] input: Goodix Capacitive TouchScreen as /devices/platform/soc/1c27000.i2c/i2c-0/0-005d/input/input1
但是evtest 纹丝不动.
dts这样设置:
gt9115d: touchscreen@5d {
compatible = "goodix,gt911";
reg = <0x5d>;
interrupt-parent = <&pio>;
interrupts = <4 3 IRQ_TYPE_EDGE_FALLING>; /* (PE3) */
pinctrl-names = "default";
/*pinctrl-0 = <&ts_reset_pin>;*/
irq-gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>; /* (PE3) */
reset-gpios = <&pio 4 4 GPIO_ACTIVE_HIGH>; /* RST (PE4) */
touchscreen-swapped-x-y;
};
https://github.com/torvalds/linux/blob/master/drivers/input/touchscreen/goodix.c
GOODIX_CONFIG_911_LENGTH 取值是 186, 我那个 goodix_9147_cfg.bin 也刚好186字节。
按理来说应该可以用才对。
离线