linux-kernel - Goodix触摸屏在linux4.4 armv7l中没有初始化
问题描述
我使用 pin#3,5 ( ref )将我的 Goodix 触摸面板引脚连接到 I2C0,并使用 GPIOB30 和 GPIOB31 作为中断和复位引脚。我从这个地址编辑了我的 Linux内核GT9xx.h 文件:
//*************************** PART2:TODO define **********************************
// STEP_1(REQUIRED): Define Configuration Information Group(s)
// Sensor_ID Map:
/* sensor_opt1 sensor_opt2 Sensor_ID
GND GND 0
VDDIO GND 1
NC GND 2
GND NC/300K 3
VDDIO NC/300K 4
NC NC/300K 5
*/
// TODO: define your own default or for Sensor_ID == 0 config here.
// The predefined one is just a sample config, which is not suitable for your tp in most cases.
#define CTP_CFG_GROUP0 {\
/* HD101B */ \
0x46,0xE0,0x01,0x56,0x03,0x02,0xF1,0x01,0x02,0x44,0x00,\
0x04,0x46,0x32,0x03,0x00.....
// STEP_2(REQUIRED): Customize your I/O ports & I/O operations
#define GTP_RST_PORT 30 //16 //S5PV210_GPJ3(6)
#define GTP_INT_PORT 31 //17 //S5PV210_GPH1(3)
// STEP_3(optional): Specify your special config info if needed
#if GTP_CUSTOM_CFG
#define GTP_MAX_HEIGHT 480 // 800
#define GTP_MAX_WIDTH 800 // 480
最后一次编辑在s5p4418-nanopi2-common.dtsi中。我将 goodix 移至 I2C0 并更改 touchpanel_irq:
i2c_0: i2c@c00a4000 {
samsung,i2c-max-bus-freq = <400000>;
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
es8316: es8316@11 {
#sound-dai-cells = <0>;
compatible = "everest,es8316";
reg = <0x11>;
};
goodix_ts@5d {
compatible = "goodix,gt9xx";
reg = <0x5d>;
interrupt-parent = <&gpio_b>;
interrupts = <31 IRQ_TYPE_EDGE_FALLING>;
goodix,irq-gpio = <&gpio_b 31 0>;
goodix,rst-gpio = <&gpio_b 30 0>;
};
goodix_ts@14 {
compatible = "goodix,gt9xx";
reg = <0x14>;
interrupt-parent = <&gpio_c>;
interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
goodix,irq-gpio = <&gpio_c 16 0>;
};
};
//=========================
pinctrl@C0010000 {
key_power: key_power {
nexell,pins = "alive-0";
nexell,pin-function = <0>;
nexell,pin-pull = <1>;
nexell,pin-strength = <0>;
};
onewire_pin: onewire-pin {
nexell,pins = "gpioc-15";
nexell,pin-function = <1>;
nexell,pin-pull = <2>;
nexell,pin-strength = <0>;
};
touchpanel_irq: touchpanel-irq {
nexell,pins = "gpiob-31";
nexell,pin-function = <1>;
nexell,pin-pull = <2>;
nexell,pin-strength = <0>;
};
但是在编译成功后使 ARCH=arm 并挂载 Linux 并将所有 dtb 文件和 zImage 移动到引导加载程序文件并重新启动触摸不起作用。
root@NanoPC-T2:~# i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- 5d -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
在这个日志中 GTP 是 Goodix Touch Panle 。
root@NanoPC-T2:~# dmesg | grep -i GTP
[ 9.495000] <<-GTP-INFO->> GTP driver installing
但汇顶未初始化:
[ 9.495000] <<-GTP-INFO->> GTP driver installing
[ 9.504000] himax_ts 2-0048: Unable to get DevId
[ 9.510000] touchscreen-1wire initialized
[ 9.514000] backlight-1wire initialized
[ 9.521000] onewire: REQ 0x60: i2c read error -11
[ 9.526000] input: fa_ts_input as /devices/virtual/input/input0
[ 9.533000] ts-if initialized
对于 i2c:
root@NanoPC-T2:~# dmesg | grep i2c
[ 0.253000] i2c-gpio c0000000.soc:i2c@3: using pins 159 (SDA) and 158 (SCL)
[ 9.524000] onewire: REQ 0x60: i2c read error -11
[ 9.553000] i2c /dev entries driver
[ 35.454000] i2c 0-003c: driver 'ov5640' not found
驱动程序正在安装
root@NanoPC-T2:~# find / -iname good*
/sys/bus/i2c/drivers/Goodix-TS
/sys/firmware/devicetree/base/soc/i2c@c00a4000/goodix_ts@14
/sys/firmware/devicetree/base/soc/i2c@c00a4000/goodix_ts@14/goodix,irq-gpio
/sys/firmware/devicetree/base/soc/i2c@c00a4000/goodix_ts@5d
/sys/firmware/devicetree/base/soc/i2c@c00a4000/goodix_ts@5d/goodix,rst-gpio
/sys/firmware/devicetree/base/soc/i2c@c00a4000/goodix_ts@5d/goodix,irq-gpio
解决方案
推荐阅读
- php - 如何更改刀片文件的语言环境
- r - R中的直方图
- java - Spring Boot 应用程序无法热交换更改
- django - Django Admin Automation 向管理员发送每日查询活动
- c# - 使用 WixSharp 如何在卸载时执行的自定义操作期间获取正确的 InstallDir 路径
- sql - 选择具有 X 最高值的列名
- javascript - 未捕获的错误:模板解析错误:无法绑定到“配置文件”,因为它不是“app-trnmnt-name”的已知属性
- fortran - Fortran 格式 - 数字 < 1e-100 的问题
- c# - 访问来自父用户控件的绑定变量
- ios - iOS 12 的 AVPlayerViewController 问题