WhyCan Forum

本站无需注册,无需积分,无需回复可下载所有资料,如果真的喜欢小站,请您注册之后请至少回复一个帖子激活Id,谢谢支持! 站长QQ: 516333132 (挖坑网/填坑网) admin@whycan.cn

您尚未登录。

#1 2019-09-11 17:20:06

shiqx429
会员
注册时间: 2019-09-04
累计积分: 39

nano板子GT911触摸屏驱动问题

我现在触摸屏驱动不行,请帮忙看看,指导一下

首先我已经看过
https://whycan.cn/t_2688.html  还有 https://whycan.cn/t_2482.html#p19396 
里面提到的问题我下面再说,我先说一下我的改动

1.内核中已经勾选Gooddix I2C touchscreen,之前内核是[M],我改为*

2.suniv-f1c100s-licheepi-nano.dts 文件如下

// SPDX-License-Identifier: (GPL-2.0+ OR X11)
/*
 * Copyright 2018 Icenowy Zheng <icenowy@aosc.io>
 */

/dts-v1/;
#include "suniv-f1c100s.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>

/ {
	model = "Lichee Pi Nano";
	compatible = "licheepi,licheepi-nano", "allwinner,suniv-f1c100s",
		     "allwinner,suniv";

	aliases {
		serial0 = &uart0;
		spi0 = &spi0;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	reg_vcc3v3: vcc3v3 {
		compatible = "regulator-fixed";
		regulator-name = "vcc3v3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	panel: panel {
		/* compatible = "qiaodian,qd43003c0-40", "simple-panel";*/
		compatible = "lg,lb070wv8", "simple-panel";
		/* compatible = "sharp,lq043t1dg04", "simple-panel"; */
		#address-cells = <1>;
		#size-cells = <0>;
		enable-gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>;

		port@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;

			panel_input: endpoint@0 {
				reg = <0>;
				remote-endpoint = <&tcon0_out_lcd>;
			};
		};
	};

	leds {
		compatible = "gpio-leds";

			// blue_led {
			// 	label = "licheepi:blue:usr";
			// 	gpios = <&pio 4 4 GPIO_ACTIVE_LOW>; /* PE4 */
			// 	linux,default-trigger = "disk-activity";
			// };

			blue_led {
				label = "licheepi:blue:usr";
				gpios = <&pio 4 5 GPIO_ACTIVE_LOW>; /* PE5 */
				linux,default-trigger = "heartbeat";
			};

	};

	
};

&de {
	status = "okay";
};

&spi0 {
	pinctrl-names = "default";
	pinctrl-0 = <&spi0_pins_a>;
	status = "okay";
	spi-max-frequency = <50000000>;
	flash: w25q128@0 {
		#address-cells = <1>;
		#size-cells = <1>;
		compatible = "winbond,w25q128", "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <50000000>;
		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x000000 0x100000>;
			};

			partition@100000 {
				label = "dtb";
				reg = <0x100000 0x10000>;
			};

			partition@110000 {
				label = "kernel";
				reg = <0x110000 0x400000>;
			};

			partition@510000 {
				label = "rootfs";
				reg = <0x510000 0xAF0000>;
			};
		};
	};
};

&uart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_pins_a>;
	status = "okay";
};

&mmc0 {
	vmmc-supply = <&reg_vcc3v3>;
	bus-width = <4>;
	broken-cd;
	status = "okay";
};

&tcon0 {
	pinctrl-names = "default";
	pinctrl-0 = <&lcd_rgb666_pins>;
	status = "okay";
};

&tcon0_out {
	tcon0_out_lcd: endpoint@0 {
		reg = <0>;
		remote-endpoint = <&panel_input>;
	};
};

&i2c0 {
	pinctrl-0 = <&i2c0_pins>;
	pinctrl-names = "default";
	status = "okay";

	gt911: touchscreen@5d {
		compatible = "goodix,gt911";
		reg = <0x5d>;
		interrupt-parent = <&pio>;
		interrupts = <4 3 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&ts_reset_pin>;
		irq-gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>; /* INT */
		reset-gpios = <&pio 4 4 GPIO_ACTIVE_HIGH>; /* RST */
		/* touchscreen-swapped-x-y; */
	};
};

&pio {
        gt911_int_pin: gt911_int_pin@0 {
                pins = "PE3";
                function = "gpio_in";
        };

		ts_reset_pin: ts_reset_pin@0 {
			pins = "PE9";-----------------------------------------------我改动过,之前默认是PE3,我已经改成PE9了
			function = "gpio_out";
		};
};

&lradc {
	vref-supply = <&reg_vcc3v3>;
	status = "okay";

	button@200 {
		label = "Volume Up";
		linux,code = <KEY_VOLUMEUP>;
		channel = <0>;
		voltage = <200000>;
	};

	button@400 {
		label = "Volume Down";
		linux,code = <KEY_VOLUMEDOWN>;
		channel = <0>;
		voltage = <400000>;
	};

	button@600 {
		label = "Select";
		linux,code = <KEY_SELECT>;
		channel = <0>;
		voltage = <600000>;
	};

	button@800 {
		label = "Start";
		linux,code = <KEY_OK>;
		channel = <0>;
		voltage = <800000>;
	};
};

刷机之后启动板子
部分log如下

[    0.940333] Creating 4 MTD partitions on "spi0.0":
[    0.945148] 0x000000000000-0x000000100000 : "u-boot"
[    0.952937] 0x000000100000-0x000000110000 : "dtb"
[    0.960578] 0x000000110000-0x000000510000 : "kernel"
[    0.968316] 0x000000510000-0x000001000000 : "rootfs"
[    0.977583] input: 1c23400.lradc as /devices/platform/soc/1c23400.lradc/input/input0
[    0.986534] i2c /dev entries driver
[    3.208195] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[    3.214754] Goodix-TS 0-005d: i2c test failed attempt 1: -110
[    5.368175] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[    5.374716] Goodix-TS 0-005d: i2c test failed attempt 2: -110
[    5.418173] Goodix-TS 0-005d: I2C communication failure: -110
[    5.424049] Goodix-TS: probe of 0-005d failed with error -110
[    5.459185] sunxi-mmc 1c0f000.mmc: base:0x2b2be80f irq:21
[    5.467168] NET: Registered protocol family 17

我这个现象跟上面提到的帖子现象一样

参考第一个帖子说有两个可能
1.

guo_felix 说:

谢谢晕哥    之前一直怀疑设备树写得有问题 检测了好几遍,也确实检查出了问题。后来尝试控制PE11 和PE12,发现抓从底板上引出来的PE12没办法拉低,但cat value 又确实是0,最后发现是核心板和底板就这个脚虚焊了  现在i2cdetect:

# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- 5d -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --       

虽然log中好像关于触屏的驱动还是有问题:

[    0.663484] i2c /dev entries driver
[    0.781273] Goodix-TS 0-0014: i2c test failed attempt 1: -6
[    0.821241] Goodix-TS 0-0014: i2c test failed attempt 2: -6
[    0.861061] Goodix-TS 0-0014: I2C communication failure: -6

但至少I2c是没问题的了

-----------------------------说的是虚焊了, 我跟他不一样,我的是小小的那块nano板子,邮票大小,不太可能虚焊

2.

guo_felix 说:

谢谢晕哥 已经可以了,可以读到gt911,可以运行 ts_test

[    0.663190] i2c /dev entries driver
[    0.782659] Goodix-TS 0-005d: ID 911, version: 1060
[    0.790639] Goodix-TS 0-005d: Direct firmware load for goodix_911_cfg.bin failed with error -2

总结一下,应该是需要dts将引脚改对(PE3),还有就是<reg>也要改到相应0x5d

----------------------------------这个我现在的代码也是这样的,也是PE3  0x5d


参考第二个帖子
楼主说"gt911根据reset pin和interrupt pin拉高的顺序决定使用i2c地址0x14或0x5d, 但似乎linux的goodix驱动尚未支持设置两个时序,导致在调试时地址会变化,从而无法驱动。可通过在dts中添加两个不同地址的gt911来解决,总有一个能驱动成功。"

这个怎么在dts添加两个不同地址的gt911啊, 这个我不会,能指导一下吗?


另外我现在用的板子是https://item.taobao.com/item.htm?spm=a1z09.2.0.0.6d612e8davnXcb&id=584657396198&_u=b1t9k8ak2a0b
配套的电路图
https://whycan.cn/files/members/1951/1.png

0x14/0x5d/0x48我都试过, 现象一样的, 请多帮忙看看,谢谢!!!!!

离线

#2 2019-09-11 17:32:44

shiqx429
会员
注册时间: 2019-09-04
累计积分: 39

Re: nano板子GT911触摸屏驱动问题

# i2cdetect -l 
i2c-0   i2c             mv64xxx_i2c adapter                     I2C adapter
# i2cdetect -r -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          [ 2659.848214] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
-- [ 2661.928204] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
-- [ 2664.008168] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
-- ^C[ 2666.088209] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0

离线

#3 2019-09-11 17:40:45

我思故我在
会员
注册时间: 2019-09-03
累计积分: 50

Re: nano板子GT911触摸屏驱动问题

i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0

这个错误一般是硬件出问题, 看有没有上拉。

烧这个固件看下情况: https://whycan.cn/t_2689.html

离线

#4 2019-09-11 17:59:05

shiqx429
会员
注册时间: 2019-09-04
累计积分: 39

Re: nano板子GT911触摸屏驱动问题

好的,我一会试一下

我思故我在 说:

i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0

这个错误一般是硬件出问题, 看有没有上拉。

烧这个固件看下情况: https://whycan.cn/t_2689.html

离线

#5 2019-09-11 18:01:05

shiqx429
会员
注册时间: 2019-09-04
累计积分: 39

Re: nano板子GT911触摸屏驱动问题

dts添加两个不同地址的gt911  我参考了帖子 ,正在试

&i2c0 {
	pinctrl-0 = <&i2c0_pins>;
	pinctrl-names = "default";
	status = "okay";

	gt9115d: touchscreen@5d {
		compatible = "goodix,gt911";
		reg = <0x5d>;
		interrupt-parent = <&pio>;
		interrupts = <4 3 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&ts_reset_pin>;
		irq-gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>; /* INT */
		reset-gpios = <&pio 4 9 GPIO_ACTIVE_HIGH>; /* RST */---------------------这里也改了之前是4 4  现在改成4 9
		/* touchscreen-swapped-x-y; */
	};
	gt91114: touchscreen@14 {
		compatible = "goodix,gt911";
		reg = <0x14>;
		interrupt-parent = <&pio>;
		interrupts = <4 3 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&ts_reset_pin>;
		irq-gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>; /* INT */
		reset-gpios = <&pio 4 9 GPIO_ACTIVE_HIGH>; /* RST */
		/* touchscreen-swapped-x-y; */
	};
};

&pio {
        gt911_int_pin: gt911_int_pin@0 {
                pins = "PE3";
                function = "gpio_in";
        };

		ts_reset_pin: ts_reset_pin@0 {
			pins = "PE9";
			function = "gpio_out";
		};
};

最近编辑记录 shiqx429 (2019-09-11 18:01:45)

离线

#6 2019-09-11 18:57:01

shiqx429
会员
注册时间: 2019-09-04
累计积分: 39

Re: nano板子GT911触摸屏驱动问题

失败了

[    0.993157] suniv-pinctrl 1c20800.pinctrl: pin PE9 already requested by 0-005d; cannot claim for 1c20800.pinctrl:137
[    1.003931] suniv-pinctrl 1c20800.pinctrl: pin-137 (1c20800.pinctrl:137) status -22
[    1.011792] Goodix-TS: probe of 0-005d failed with error -22
[    1.018494] suniv-pinctrl 1c20800.pinctrl: pin PE9 already requested by 0-0014; cannot claim for 1c20800.pinctrl:137
[    1.029081] suniv-pinctrl 1c20800.pinctrl: pin-137 (1c20800.pinctrl:137) status -22
[    1.036823] Goodix-TS: probe of 0-0014 failed with error -22
shiqx429 说:

dts添加两个不同地址的gt911  我参考了帖子 ,正在试

&i2c0 {
	pinctrl-0 = <&i2c0_pins>;
	pinctrl-names = "default";
	status = "okay";

	gt9115d: touchscreen@5d {
		compatible = "goodix,gt911";
		reg = <0x5d>;
		interrupt-parent = <&pio>;
		interrupts = <4 3 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&ts_reset_pin>;
		irq-gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>; /* INT */
		reset-gpios = <&pio 4 9 GPIO_ACTIVE_HIGH>; /* RST */---------------------这里也改了之前是4 4  现在改成4 9
		/* touchscreen-swapped-x-y; */
	};
	gt91114: touchscreen@14 {
		compatible = "goodix,gt911";
		reg = <0x14>;
		interrupt-parent = <&pio>;
		interrupts = <4 3 IRQ_TYPE_EDGE_FALLING>;
		pinctrl-names = "default";
		pinctrl-0 = <&ts_reset_pin>;
		irq-gpios = <&pio 4 3 GPIO_ACTIVE_HIGH>; /* INT */
		reset-gpios = <&pio 4 9 GPIO_ACTIVE_HIGH>; /* RST */
		/* touchscreen-swapped-x-y; */
	};
};

&pio {
        gt911_int_pin: gt911_int_pin@0 {
                pins = "PE3";
                function = "gpio_in";
        };

		ts_reset_pin: ts_reset_pin@0 {
			pins = "PE9";
			function = "gpio_out";
		};
};

离线

#7 2019-09-11 19:06:09

jimmy
Moderator
注册时间: 2017-10-29
累计积分: 175

Re: nano板子GT911触摸屏驱动问题

pin PE9 already requested by 0-0014; cannot claim for 1c20800.pinctrl:137



pinctrl-suniv.c 和设备树 里面有没有配好 I2C 引脚.

离线

#8 2019-09-11 19:13:55

shiqx429
会员
注册时间: 2019-09-04
累计积分: 39

Re: nano板子GT911触摸屏驱动问题

不行, 另外我输入root   和密码whycan.cn 无法登入进一步测试,   界面显示了,屏幕触控无效
也是报 i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0,但没报其他错

[    0.972214] 4 ofpart partitions found on MTD device spi0.0
[    0.977839] Creating 4 MTD partitions on "spi0.0":
[    0.982659] 0x000000000000-0x000000100000 : "u-boot"
[    0.990382] 0x000000100000-0x000000110000 : "dtb"
[    0.997935] 0x000000110000-0x000000510000 : "kernel"
[    1.005717] 0x000000510000-0x000001000000 : "rootfs"
[    1.013989] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.020663] ehci-platform: EHCI generic platform driver
[    1.026292] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.032515] ohci-platform: OHCI generic platform driver
[    1.038274] usbcore: registered new interface driver usb-storage
[    1.046490] input: 1c23400.lradc as /devices/platform/soc/1c23400.lradc/input/input0
[    1.056996] input: 1c24800.rtp as /devices/platform/soc/1c24800.rtp/input/input1
[    1.065474] i2c /dev entries driver
[    3.125159] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
[    3.131723] rtc-pcf8563 0-0051: pcf8563_write_block_data: err=-110 addr=0e, data=03
[    3.139439] rtc-pcf8563 0-0051: pcf8563_probe: write error
[    3.145112] rtc-pcf8563: probe of 0-0051 failed with error -5
[    3.153300] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    3.215211] sunxi-mmc 1c0f000.mmc: base:0xcffafbc9 irq:20
[    3.223031] usbcore: registered new interface driver usbhid
[    3.228747] usbhid: USB HID core driver
shiqx429 说:

好的,我一会试一下

我思故我在 说:

i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0

这个错误一般是硬件出问题, 看有没有上拉。

烧这个固件看下情况: https://whycan.cn/t_2689.html

离线

#9 2019-09-11 19:26:07

shiqx429
会员
注册时间: 2019-09-04
累计积分: 39

Re: nano板子GT911触摸屏驱动问题

你那边有没有好用的suniv-f1c100s-licheepi-nano.dts和suniv.dtsi给我看看啊

jimmy 说:

pin PE9 already requested by 0-0014; cannot claim for 1c20800.pinctrl:137



pinctrl-suniv.c 和设备树 里面有没有配好 I2C 引脚.

离线

#10 2019-09-11 19:27:14

awfans
会员
注册时间: 2018-04-03
累计积分: 186

Re: nano板子GT911触摸屏驱动问题

很可能没有接上拉电阻, 确认一下.

离线

#11 2019-09-12 08:19:51

shiqx429
会员
注册时间: 2019-09-04
累计积分: 39

Re: nano板子GT911触摸屏驱动问题

我试试吧,谢谢了

awfans 说:

很可能没有接上拉电阻, 确认一下.

离线

#12 2019-09-12 09:42:30

xm1994
会员
注册时间: 2019-07-03
累计积分: 24

Re: nano板子GT911触摸屏驱动问题

下我贴子里的固件试试 如果不行就基本上是硬件问题了

离线

页脚