eGalax Touchscreen on Colibri iMX7

Hello,

I’m trying to add a touchscreen with eGalax controller to the device tree and edited the config provided by Toradex (Fusion display). Here is the example from the Linux Kernel repo:

* EETI eGalax Multiple Touch Controller

Required properties:
- compatible: must be "eeti,egalax_ts"
- reg: i2c slave address
- interrupts: touch controller interrupt
- wakeup-gpios: the gpio pin to be used for waking up the controller
  and also used as irq pin

Example:

	touchscreen@4 {
		compatible = "eeti,egalax_ts";
		reg = <0x04>;
		interrupt-parent = <&gpio1>;
		interrupts = <9 2>;
		wakeup-gpios = <&gpio1 9 0>;
	};

Here is my config:

&i2c4 {
        status = "okay";
        clock-frequency = <400000>; /* i2c bus frequency 400 KHz */

        /* the PCAPs use SODIMM 28/30, also used for PWM<B>, PWM<C>, aka pwm2, pwm3.
        so if you enable one of the PCAP controllers disable the pwms */
        /* Atmel maxtouch controller */
        atmel_mxt_ts: atmel_mxt_ts@4a {
                compatible = "atmel,maxtouch";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpiotouch>;
                reg = <0x4a>;
                interrupt-parent = <&gpio1>;
                interrupts = <9 IRQ_TYPE_EDGE_FALLING>; /* SODIMM 28 */
                reset-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; /* SODIMM 30 */
                status = "disabled";
        };

        touch: touchscreen@4 {
                compatible = "eeti,egalax_ts";
                pinctrl-names = "default";
                pinctrl-0 = <&pinctrl_gpiotouch>;
                reg = <0x04>;
                interrupt-parent = <&gpio1>;
                interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
                wakeup-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
                        /* SODIMM 28, Pen down interrupt */
                /* gpios = <&gpio1 9 GPIO_ACTIVE_HIGH */
                        /* SODIMM 30, Reset interrupt */
                        /*  &gpio1 10 GPIO_ACTIVE_LOW */
                        /* >; */
                status = "okay";
        };

        /* M41T0M6 real time clock on carrier board */
        rtc: m41t0m6@68 {
                compatible = "st,m41t0";
                reg = <0x68>;
        };
};

PWM2 and 3 are disabled. Do I have to stick to the iMX7 naming convention or the one from eGalax? I’m not sure about the GPIO/Interrupt mapping. The eGalax is not showing up when scanning with i2cdetect -y -r 3.

Thanks in advance

Sebastian

HI @sorschiedt

Could you provide your kernel config and the dmesg log in a text file?
Thanks.

Best regards,
Jaski

Hello Jaski,

here you are. Thank you for helping :slight_smile:

dmesg.log

Kernel config

Regards

Sebastian

Thanks for your Input. Could you provide the datasheet of the touchscreen? How and to which SODIMM Pins did you connect the touch interface?

Hello Jaski,

sorry for the delay, I fell ill.

this is the datasheet. Chapter 7 covers the touch interface.

We designed our own carrier board, which is electrically fine. Connections are:

Touchscreen pin                        Colibri pin
1 (VCC)                                     198 (3.3V)
2+3 (SDA)                                 194 (i2c4.SDA)
4 (GND)                                     General GND
5+6 (SCL)                                  196 (i2c4.SCL)
7 (INT)                                        28 (PWM2)
8 (RES)                                      30 (PWM3)

Thank you for looking into it

Sebastian

HI @sorschiedt

No Problem. Thanks for your Input.

Your Connection seems to be correct. Try to connect only one PIN for SCL and SDA respectively and not both.

Does the i2c communication work well? Can you check this with an oscilloscope?

At last, I think there could maybe a problem with the Firmware.

This is what I found in the kernel sources ( drivers/input/touchscreen/egalax_ts.c )

/* HannStar (HSD100PXN1 Rev: 1-A00C11 F/W:0634) LVDS touch
* screen needs to trigger I2C event to device FW at booting
* first, and then the FW can switch to I2C interface.
* Otherwise, the FW can’t work with I2C interface. So here
* just use the exist function egalax_firmware_version() to
* send a I2C command to the device, make sure the device FW
* switch to I2C interface.
*/

Best regards,
Jaski

Hello Jaski,

I have checked the I2C bus with an oscilloscope and it is in working order. Our external RTC is shown on the correct address 0x68 in the output of i2cdetect -y -r 3. I will look into the firmware issue.

Thank you

Sebastian

Hi Sebastian

Thanks for your Input.
We will wait for your feedback about the firmware.

Best regards,
Jaski

Hi Sebastian,
there is no issue.

Perfect that it works. Thanks for the feedback.

Best regards,
Jaski

Hello Jaski,

I’ve got it to work. It was actually an electrical problem.

Thank you for your help and sorry for wasting your time :-/

Sebastian