To give a clear idea , here are the steps i followed.
Step1 Enable SW I2C in config.txt
Reboot
STEP2Check if SW i2c bus is enabledSW I2C is enabled on bus 11.
STEP3 Check if i2c device address is detected
STEP4 Custom GT9110 Overlay, changed the Target , INT, RST parameters to i2c_gpio , 19 and 26
STEP5 Compile dts to dtbo and place it in /boot/overlays as gt9110.dtbo
STEP6 Enable custom goodix overlay by placed in config.txt and connect RST& INT Pins to GPIO
STEP7 Reboot
STEP8 Check if I2C address is reserved by kernel. 0x14 is the address of goodix touchscreens. If "UU" is mentioned The i2c address is
successfully detected and reserved by the kernel. Touchscreen must work at this point if all hardware wiring is correct.
6by9 and Bugs, Hope this gave a clear idea about the steps I took. The touch screen is working.
When i mention the bus parameter and SW I2C overlay and also mentioned the same as target in custom goodix overlay ,
the i2c address is not getting reserved by the overlay.
For example if i enter bus as 5 and enter target as i2c5 the SW I2C bus 5 is created and goodix address is detected at 0x14. But address is not getting reserved. Will there be any problems with my current method?
As bugs mentioned about merging to simplify, How can i do that?
As per my understanding,
If i get SW i2c working as BUS 1 and get the overlays detect it , then users can use original dtoverlays like goodix that come with pi without any modification.
Step1 Enable SW I2C in config.txt
Code:
dtoverlay=i2c-gpio,i2c_gpio_sda=10,i2c_gpio_scl=11
STEP2Check if SW i2c bus is enabled
Code:
pi@raspberrypi:~ $ sudo i2cdetect -li2c-11i2c ffffffff.i2c I2C adapter
STEP3 Check if i2c device address is detected
Code:
pi@raspberrypi:~ $ sudo i2cdetect -y 11 0 1 2 3 4 5 6 7 8 9 a b c d e f00: -- -- -- -- -- -- -- -- 10: -- -- -- -- 14 -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
Code:
// Device tree overlay for Goodix GT9110 touch controller// connected to Raspberry Pi via I2C on GPIO pins./dts-v1/;/plugin/;/ { compatible = "brcm,bcm2835", "brcm,bcm2836", "brcm,bcm2708", "brcm,bcm2709"; fragment@0 { target = <&gpio>; // Overlay for GPIO pins, using standard 'gpio' node __overlay__ { goodix_pins: goodix_pins { // create overlay labeled "goodix_pins" brcm,pins = <19 26>; // use GPIO_27(pin 13), GPIO_4(pin 7) brcm,function = <0 0>; // set pins as Output brcm,pull = <2 2>; // enable internal pull-up resistors }; }; }; fragment@1 { target = <&i2c_gpio>; // Overlay for I2C pins, using the 'i2c1' node __overlay__ { #address-cells = <1>; #size-cells = <0>; status = "okay"; // device is enabled gt9110: gt9110@14 { // set GT9110 with i2c address 0x14 compatible = "goodix,gt9110"; // using 'goodix' kernel device driver reg = <0x14>; // I2C address (needs to match above) pinctrl-names = "default"; // default pin configuration pinctrl-0 = <&goodix_pins>; // assign overlay to pin control interrupt-parent = <&gpio>; // assign interrupt rutines interrupts = <19 2>; // high-to-low edge triggered irq-gpios = <&gpio 19 0>; // set Interupt pin on GPIO 27 reset-gpios = <&gpio 26 0>; // set Reset pin on GPIO 4 }; }; };};
STEP5 Compile dts to dtbo and place it in /boot/overlays as gt9110.dtbo
STEP6 Enable custom goodix overlay by placed in config.txt and connect RST& INT Pins to GPIO
Code:
dtoverlay=gt9110
STEP8 Check if I2C address is reserved by kernel. 0x14 is the address of goodix touchscreens. If "UU" is mentioned The i2c address is
successfully detected and reserved by the kernel. Touchscreen must work at this point if all hardware wiring is correct.
Code:
pi@raspberrypi:~ $ sudo i2cdetect -y 11 0 1 2 3 4 5 6 7 8 9 a b c d e f00: -- -- -- -- -- -- -- -- 10: -- -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
6by9 and Bugs, Hope this gave a clear idea about the steps I took. The touch screen is working.
When i mention the bus parameter and SW I2C overlay and also mentioned the same as target in custom goodix overlay ,
the i2c address is not getting reserved by the overlay.
For example if i enter bus as 5 and enter target as i2c5 the SW I2C bus 5 is created and goodix address is detected at 0x14. But address is not getting reserved. Will there be any problems with my current method?
As bugs mentioned about merging to simplify, How can i do that?
As per my understanding,
If i get SW i2c working as BUS 1 and get the overlays detect it , then users can use original dtoverlays like goodix that come with pi without any modification.
Statistics: Posted by BalajiNarasimhan — Fri Jan 19, 2024 4:04 am