屏幕规格书
需要主要硬件通信电压为:1.8V或者3.3V
I2C通信的地址:0x5D 和0x40
系统上电时序:不同的地址,稍微有些差异
对应代码中如下:
与RK3568的硬件接口电路
DTS 配置
驱动:RK自带的驱动程序就可以正确工作,不需要新的驱动:gt9xx_android_driver_v2.8.0.2_20171214
其中:WGJ89006B_GT911_Config_20140625_085816_0X43.cfg 文件是通过触摸屏公司提供的,如下:
GT相关,正确启动日志
[ 0.745986] Quentin,bus_freq_hz:200000,scl_fall_ns:300,scl_rise_ns:300,sda_hold_ns:0
[ 0.746506] goodix_ts_probe() start
[ 0.746523] <<-GTP-FUNC->> Func:goodix_ts_probe@Line:2691
[ 0.746535] <<-GTP-INFO->> GTP Driver Version: V2.2<2014/01/14>
[ 0.746546] <<-GTP-INFO->> GTP I2C Address: 0x5d
[ 0.746591] Goodix-TS 1-005d: 1-005d supply tp not found, using dummy regulator
[ 0.746650] Goodix-TS 1-005d: Linked as a consumer to regulator.0
[ 0.770593] <<-GTP-FUNC->> Func:gtp_request_io_port@Line:1849
[ 0.770620] <<-GTP-FUNC->> Func:gtp_reset_guitar@Line:1132
[ 0.770626] <<-GTP-ERROR->> Guitar reset
[ 0.877222] <<-GTP-FUNC->> Func:gtp_i2c_test@Line:1821
[ 0.877238] <<-GTP-FUNC->> Func:gtp_i2c_read@Line:175
[ 0.877522] <<-GTP-FUNC->> Func:gtp_read_version@Line:1782
[ 0.877538] <<-GTP-FUNC->> Func:gtp_i2c_read@Line:175
[ 0.878045] <<-GTP-INFO->> IC Version: 911_1060
[ 0.878058] <<-GTP-FUNC->> Func:gtp_i2c_read@Line:175
[ 0.889141] <<-GTP-INFO->> <gtp_init_panel>_1643 <800, 480>
[ 0.889141]
[ 0.889156] <<-GTP-INFO->> <gtp_init_panel>_1645
[ 0.889156]
[ 0.889163] <<-GTP-INFO->> X_MAX: 800, Y_MAX: 480, TRIGGER: 0x01
[ 0.903894] <<-GTP-INFO->> create proc entry gt9xx_config success
[ 0.903909] <<-GTP-FUNC->> Func:gtp_request_input_dev@Line:2129
[ 0.904022] input: goodix-ts as /devices/platform/fe5a0000.i2c/i2c-1/1-005d/input/input2
[ 0.904140] <<-GTP-FUNC->> Func:gtp_request_irq@Line:1913
[ 0.904154] <<-GTP-DEBUG->> [1914]INT trigger type:1
[ 0.904363] <<-GTP-INFO->> <gtp_request_irq>_1928 ts->irq=110 ret = 0
[ 0.904363]
[ 0.904378] <<-GTP-INFO->> <gtp_request_irq>_1958 ts->irq=110 ret = 0
[ 0.904378]
[ 0.904390] <<-GTP-FUNC->> Func:gtp_irq_disable@Line:385
[ 0.904402] <<-GTP-INFO->> GTP works in interrupt mode.
[ 0.904408] <<-GTP-FUNC->> Func:gtp_irq_enable@Line:408
[ 0.904618] Quentin,bus_freq_hz:100000,scl_fall_ns:300,scl_rise_ns:1000,sda_hold_ns:0
[ 50.123150] <<-GTP-FUNC->> Func:goodix_ts_irq_handler@Line:1090
[ 50.123179] <<-GTP-FUNC->> Func:gtp_irq_disable@Line:385
[ 50.123246] <<-GTP-FUNC->> Func:goodix_ts_work_func@Line:626
[ 50.123256] <<-GTP-FUNC->> Func:gtp_i2c_read@Line:175
[ 50.124024] <<-GTP-DEBUG->> [897]pre_touch:00, finger:81.
[ 50.124049] <<-GTP-DEBUG->> [472]ID:0, X:295, Y:437, W:32
[ 50.124082] <<-GTP-FUNC->> Func:gtp_i2c_write@Line:248
[ 50.124315] <<-GTP-FUNC->> Func:gtp_irq_enable@Line:408
[ 50.135259] <<-GTP-FUNC->> Func:goodix_ts_irq_handler@Line:1090
[ 50.135291] <<-GTP-FUNC->> Func:gtp_irq_disable@Line:385
[ 50.135361] <<-GTP-FUNC->> Func:goodix_ts_work_func@Line:626
[ 50.135383] <<-GTP-FUNC->> Func:gtp_i2c_read@Line:175
[ 50.136114] <<-GTP-DEBUG->> [897]pre_touch:01, finger:81.
[ 50.136138] <<-GTP-DEBUG->> [472]ID:0, X:295, Y:437, W:32
[ 50.136169] <<-GTP-FUNC->> Func:gtp_i2c_write@Line:248
[ 50.136397] <<-GTP-FUNC->> Func:gtp_irq_enable@Line:408
[ 50.147441] <<-GTP-FUNC->> Func:goodix_ts_irq_handler@Line:1090
[ 50.147469] <<-GTP-FUNC->> Func:gtp_irq_disable@Line:385
[ 50.147538] <<-GTP-FUNC->> Func:goodix_ts_work_func@Line:626
[ 50.147559] <<-GTP-FUNC->> Func:gtp_i2c_read@Line:175
[ 50.148291] <<-GTP-DEBUG->> [897]pre_touch:01, finger:81.
[ 50.148317] <<-GTP-DEBUG->> [472]ID:0, X:295, Y:437, W:32
[ 50.148349] <<-GTP-FUNC->> Func:gtp_i2c_write@Line:248
[ 50.148577] <<-GTP-FUNC->> Func:gtp_irq_enable@Line:408
[ 50.159680] <<-GTP-FUNC->> Func:goodix_ts_irq_handler@Line:1090
[ 50.159714] <<-GTP-FUNC->> Func:gtp_irq_disable@Line:385
[ 50.159756] <<-GTP-FUNC->> Func:goodix_ts_work_func@Line:626
[ 50.159764] <<-GTP-FUNC->> Func:gtp_i2c_read@Line:175
[ 50.160500] <<-GTP-DEBUG->> [897]pre_touch:01, finger:81.
[ 50.160516] <<-GTP-DEBUG->> [472]ID:0, X:290, Y:438, W:32
[ 50.160592] <<-GTP-FUNC->> Func:gtp_i2c_write@Line:248
[ 50.160831] <<-GTP-FUNC->> Func:gtp_irq_enable@Line:408
[ 50.171806] <<-GTP-FUNC->> Func:goodix_ts_irq_handler@Line:1090
[ 50.171828] <<-GTP-FUNC->> Func:gtp_irq_disable@Line:385
[ 50.171893] <<-GTP-FUNC->> Func:goodix_ts_work_func@Line:626
[ 50.171903] <<-GTP-FUNC->> Func:gtp_i2c_read@Line:175
[ 50.172606] <<-GTP-DEBUG->> [897]pre_touch:01, finger:81.
GT相关,错误启动日志:<<GTP-ERR>>[_do_i2c_write:430] I2c transfer error! (-6 原因在下面
[ 0.730772] <<GTP-INF>>[gt1x_ts_probe:537] GTP Driver Version: V1.4<2015/07/10>
[ 0.730798] <<GTP-INF>>[gt1x_ts_probe:538] GTP I2C Address: 0x14
[ 0.730856] <<GTP-ERR>>[gt1x_parse_dt:334] vdd_ana not specified, fallback to power-supply
[ 0.730929] Goodix-TS-GT1X 1-0014: Linked as a consumer to regulator.7
[ 0.730994] <<GTP-INF>>[gt1x_reset_guitar:784] GTP RESET!
[ 0.731180] i2c i2c-4: 1 i2c clients have been registered at 0x36
[ 0.731801] gsensor_mxc6655 5-0015: sensor_register_device: gs_mxc6655xa, id = 24
[ 0.731812] i2c i2c-5: sensor_probe: gs_mxc6655xa,000000007e31acb1
[ 0.802485] <<GTP-ERR>>[_do_i2c_write:430] I2c transfer error! (-6)
[ 0.802500] <<GTP-ERR>>[gt1x_init:2315] Reset guitar failed!
[ 0.802505] <<GTP-INF>>[gt1x_reset_guitar:784] GTP RESET!
[ 0.872481] <<GTP-ERR>>[_do_i2c_write:430] I2c transfer error! (-6)
[ 0.872495] <<GTP-ERR>>[gt1x_init:2315] Reset guitar failed!
[ 0.872500] <<GTP-INF>>[gt1x_reset_guitar:784] GTP RESET!
[ 0.942479] <<GTP-ERR>>[_do_i2c_write:430] I2c transfer error! (-6)
[ 0.942494] <<GTP-ERR>>[gt1x_init:2315] Reset guitar failed!
[ 0.942499] <<GTP-INF>>[gt1x_reset_guitar:784] GTP RESET!
[ 1.012471] <<GTP-ERR>>[_do_i2c_write:430] I2c transfer error! (-6)
[ 1.012486] <<GTP-ERR>>[gt1x_init:2315] Reset guitar failed!
[ 1.012492] <<GTP-INF>>[gt1x_reset_guitar:784] GTP RESET!
[ 1.082477] <<GTP-ERR>>[_do_i2c_write:430] I2c transfer error! (-6)
[ 1.082491] <<GTP-ERR>>[gt1x_init:2315] Reset guitar failed!
[ 1.082497] <<GTP-ERR>>[gt1x_init:2341] Init failed, use default setting
[ 1.082655] <<GTP-ERR>>[_do_i2c_read:388] I2c Transfer error! (-6)
[ 1.082670] <<GTP-ERR>>[gt1x_get_chip_type:891] I2c communication error.
[ 1.082681] <<GTP-ERR>>[gt1x_init:2351] Get chip type failed!
[ 1.082844] <<GTP-ERR>>[_do_i2c_read:388] I2c Transfer error! (-6)
[ 1.082858] <<GTP-ERR>>[gt1x_read_version:841] Read version failed!
[ 1.189156] <<GTP-ERR>>[_do_i2c_read:388] I2c Transfer error! (-6)
[ 1.189170] <<GTP-ERR>>[gt1x_read_version:841] Read version failed!
[ 1.295812] <<GTP-ERR>>[_do_i2c_read:388] I2c Transfer error! (-6)
[ 1.295826] <<GTP-ERR>>[gt1x_read_version:841] Read version failed!
[ 1.313776] gsensor_mxc6655 5-0015: sensor_chip_init:fail to read gs_mxc6655xa devid:0xf
[ 1.313794] i2c i2c-5: sensor_probe failed -2
错误主I2C波形:下面都是错误的:
下面是硬件更改之后,抓的数据,下面是正确的:
LInux中相关的调试信息:
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/input/input2/id # cat version
28bb
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/input/input2/id # cat ve
vendor version
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/input/input2/id # cat vendor
dead
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/input/input2/id # cat bustype
0018
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/input/input2/id # cd ..
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/input/input2 # ls
capabilities device event2 id modalias name phys power properties subsystem uevent uniq
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/input/input2 # cat name
goodix-ts
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/input/input2 # cd ..
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/input # cd ..
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d # ls
driver input modalias name of_node power subsystem uevent
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d # ls -al
total 0
drwxr-xr-x 4 root root 0 2022-12-12 03:26 .
drwxr-xr-x 5 root root 0 2022-12-12 03:26 ..
lrwxrwxrwx 1 root root 0 2022-12-12 03:30 driver -> ../../../../../bus/i2c/drivers/Goodix-TS
drwxr-xr-x 3 root root 0 2022-12-12 03:30 input
-r--r--r-- 1 root root 4096 2022-12-12 03:30 modalias
-r--r--r-- 1 root root 4096 2022-12-12 03:30 name
lrwxrwxrwx 1 root root 0 2022-12-12 03:30 of_node -> ../../../../../firmware/devicetree/base/i2c@fe5a0000/gt9xx@5d
drwxr-xr-x 2 root root 0 2022-12-12 03:30 power
lrwxrwxrwx 1 root root 0 2022-12-12 03:30 subsystem -> ../../../../../bus/i2c
-rw-r--r-- 1 root root 4096 2022-12-12 03:30 uevent
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d # cat name
gt9xx
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d #
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d # ls
driver input modalias name of_node power subsystem uevent
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d # cat modalias
of:Ngt9xxT<NULL>Cgoodix,gt9xx
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d #
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d # ls
driver input modalias name of_node power subsystem uevent
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d # cd driver/
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/driver # ls
1-005d bind uevent unbind
rk3568_s:/sys/devices/platform/fe5a0000.i2c/i2c-1/1-005d/driver # ls -al
total 0
drwxr-xr-x 2 root root 0 2022-12-12 03:38 .
drwxr-xr-x 87 root root 0 2022-12-12 03:38 ..
lrwxrwxrwx 1 root root 0 2022-12-12 03:38 1-005d -> ../../../../devices/platform/fe5a0000.i2c/i2c-1/1-005d
--w------- 1 root root 4096 2022-12-12 03:38 bind
--w------- 1 root root 4096 2022-12-12 03:38 uevent
--w------- 1 root root 4096 2022-12-12 03:38 unbind