kiwin
1
本帖最后由 kiwin 于 2022-2-10 16:16 编辑
目前在RK3568上调一块新的LCD屏;
如上图,其中底板的(J37)TP 6 PIN通过I2C接到屏的gt9271芯片小板上;底板背面的MIPI_DSI1接到屏的对应MIPI接口。
使用SDK:rk356x_linux_release_20211019 默认编译的是Ubuntu 20.04.3 LTS系统。
在原有的kernel\arch\arm64\boot\dts\rockchip\rk3568-firefly-aioj-ipc-mipi_JD9365DA_H3.dts基础上进行修改,新增如下I2C1的控制:
&i2c1 {
status = “okay”;
clock-frequency = <100000>;
gt9271: gt9271@5d {
compatible = “goodix,gt9271”;
reg = <0x5d>;
screen_max_x = <800>;
screen_max_y = <1280>;
touch-gpio = <&gpio3 RK_PA3 IRQ_TYPE_LEVEL_LOW>;
reset-gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>;
flip-x = <1>;
flip-y = <0>;
swap-xy = <0>;
gsl,fw = <1>;
};
};
但是开机后I2C通讯异常报错:
[ 1.409972] Goodix-TS 1-005d: i2c test failed attempt 1: -6
[ 1.436244] Goodix-TS 1-005d: i2c test failed attempt 2: -6
[ 1.462739] Goodix-TS 1-005d: I2C communication failure: -6
请问是哪里没配对或者其他问题?
Liuth
2
错误-6一般表示找不到设备,可能是连接错误,看原理图检查一下mipi接口和J37的每个脚是否和你的屏幕对应
kiwin
3
本帖最后由 kiwin 于 2022-2-8 11:48 编辑
Liuth 发表于 2022-1-22 09:11
错误-6一般表示找不到设备,可能是连接错误,看原理图检查一下mipi接口和J37的每个脚是否和你的屏幕对应
J37是连接到了屏的触摸控制芯片上,确认了下PIN是对应的上的。
如上图知道使用了I2C1。
查看对应的主控PIN:
查看datasheet:
知道了中断和复位脚对应的GPIO:
查看屏幕厂家驱动移植手册:
知道I2C地址为0x5d。
故在原有的kernel\arch\arm64\boot\dts\rockchip\rk3568-firefly-aioj-ipc-mipi_JD9365DA_H3.dts基础上进行修改,新增如下I2C1的控制,并指定touch-gpio为GPIO3_A3,reset-gpio为GPIO3_A5,写法如下:
&i2c1 {
status = "okay";
clock-frequency = <100000>;
gt9271: gt9271@5d {
compatible = "goodix,gt9271";
reg = <0x5d>;
screen_max_x = <800>;
screen_max_y = <1280>;
touch-gpio = <&gpio3 RK_PA3 IRQ_TYPE_LEVEL_LOW>;
reset-gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>;
flip-x = <1>;
flip-y = <0>;
swap-xy = <0>;
gsl,fw = <1>;
};
};
查看了sdk,rk356x_linux_release_20211019\kernel\drivers\input\touchscreen下原就支持了gt9xxx的芯片驱动了。
但是运行起来还是报错:
[ 1.409972] Goodix-TS 1-005d: i2c test failed attempt 1: -6
[ 1.436244] Goodix-TS 1-005d: i2c test failed attempt 2: -6
[ 1.462739] Goodix-TS 1-005d: I2C communication failure: -6
kiwin
4
Liuth 发表于 2022-1-22 09:11
错误-6一般表示找不到设备,可能是连接错误,看原理图检查一下mipi接口和J37的每个脚是否和你的屏幕对应
和MIPI暂时无关吧?现在是想先调通屏触摸的I2C
Liuth
5
目前来看你的配置应该没问题,可以在板子上apt install i2c-tools
然后使用命令 i2cdetect -r -y -a 1
看看对应的5d位置上有没有设备,有设备会显示5d
kiwin
6
Liuth 发表于 2022-1-24 09:42
目前来看你的配置应该没问题,可以在板子上apt install i2c-tools
然后使用命令 i2cdetect -r -y -a 1
看 …
跑的不是Android系统,是ubuntu20.04系统,需要怎样查看呢?
kiwin
8
本帖最后由 kiwin 于 2022-2-8 18:40 编辑
Liuth 发表于 2022-1-24 09:42
目前来看你的配置应该没问题,可以在板子上apt install i2c-tools
然后使用命令 i2cdetect -r -y -a 1
看 …
root@firefly:~# i2cdetect -r -y -a 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – UU – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – – – – – – – – – –
运行i2cdetect之后,没看到5d,是否可能相关GPIO在其他地方复用成了其他功能了?
Liuth
9
i2c根本检测不到触摸芯片,可能你的触摸芯片并没有上电
EDP_TP_PWREN是否有使能?可以参考rk3568-firefly-aioj.dtsi中的vcc_hub_power节点写一个regulator以及pinctrl中的vcc_hub_power_en节点设置引脚,来使能EDP_TP_PWREN
如果还是不行,可能你的触摸芯片不能脱离屏幕工作,需要先调屏幕
也有可能是你的触摸芯片坏了
kiwin
10
本帖最后由 kiwin 于 2022-2-10 15:01 编辑
Liuth 发表于 2022-2-8 17:41
i2c根本检测不到触摸芯片,可能你的触摸芯片并没有上电
EDP_TP_PWREN是否有使能?可以参考rk3568-firefl …
rk3568-firefly-aioj.dtsi文件中新增如下:
vcc_edp_power: vcc-edp-power-regulator {
compatible = “regulator-fixed”;
enable-active-high;
gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
pinctrl-names = “default”;
pinctrl-0 = <&vcc_edp_power_en>;
regulator-name = “vcc_edp_power_en”;
regulator-always-on;
};
pinctrl中新增:
edp {
vcc_edp_power_en: vcc-edp-power-en {
rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
root@firefly:~# i2cdetect -r -y -a 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – – – – –
10: – – – – 14 – – – – – – – – – – –
20: – UU – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – – – – – – – – – –
还是无法识别到I2C,麻烦帮忙确认这样加是否有误?
Liuth
11
你这不是有了吗,14位置出现了设备
说明你的触摸芯片地址是0x14,不是0x5d
kiwin
12
Liuth 发表于 2022-2-10 15:16
你这不是有了吗,14位置出现了设备
说明你的触摸芯片地址是0x14,不是0x5d
嗯,重新将:
kernel\arch\arm64\boot\dts\rockchip\rk3568-firefly-aioj-ipc-mipi_JD9365DA_H3.dts中i2c的地址改成了0x14:
&i2c1 {
status = “okay”;
clock-frequency = <100000>;
gt9271: gt9271@5d {
compatible = “goodix,gt9271”;
reg = <0x14>;
screen_max_x = <800>;
screen_max_y = <1280>;
touch-gpio = <&gpio3 RK_PA3 IRQ_TYPE_LEVEL_LOW>;
reset-gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>;
flip-x = <1>;
flip-y = <0>;
swap-xy = <0>;
gsl,fw = <1>;
};
};
开机起来打印如下:
[ 1.409306] Goodix-TS 1-0014: ID 9271, version: 1020
[ 1.426632] Goodix-TS 1-0014: Invalid config, using defaults
[ 1.426859] input: Goodix Capacitive TouchScreen as /devices/platform/fe5a0000.i2c/i2c-1/1-0014/input/input2
[ 1.427090] Goodix-TS 1-0014: request IRQ failed: -22
[ 1.427705] Goodix-TS: probe of 1-0014 failed with error -22
设备是识别到了,但IRQ中断报错,是中断脚没配对?
kiwin
13
Liuth 发表于 2022-2-10 15:16
你这不是有了吗,14位置出现了设备
说明你的触摸芯片地址是0x14,不是0x5d
你好,目前开机起来打印如下:
[ 1.409306] Goodix-TS 1-0014: ID 9271, version: 1020
[ 1.426632] Goodix-TS 1-0014: Invalid config, using defaults
[ 1.426859] input: Goodix Capacitive TouchScreen as /devices/platform/fe5a0000.i2c/i2c-1/1-0014/input/input2
[ 1.427090] Goodix-TS 1-0014: request IRQ failed: -22
[ 1.427705] Goodix-TS: probe of 1-0014 failed with error -22
IRQ中断报错,是哪里没配好吗?