SX8654 I2C Touchscreen on Verdin iMX8MP (Development Board)

Hi folks,

I am working on a Verdin iMX8MP development board, with a connected “resistive” touchscreen on the “DSI to LVDS” adapter over i2C (SX8655 controller).
I added an overlay by myself, which is compiled successfully (adapted GPIOS from the atmel mxt controller, which is supported by the board):

/dts-v1/;
/plugin/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>

/ {
    compatible = "toradex,verdin-imx8mp";
    fragment@0 {
        target = <&i2c4>;
        __overlay__ {
            #address-cells = <1>;
            #size-cells = <0>;
            status = "okay";

            sx8654: touch@49 {
                compatible = "semtech,sx8655";
                reg = <0x49>;
                pinctrl-names = "default";
                touchrate = <0x30>;
		        powdly = <0x06>;
		        filt = <0x02>;
		        setdly = <0x08>;
                reset-gpios = <&gpio3 23 GPIO_ACTIVE_LOW>;
                pinctrl-0 = <&pinctrl_gpio_9_dsi>, <&pinctrl_i2s_2_bclk_touch_reset>;
                interrupt-parent = <&gpio3>;
                interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
                status = "okay";
            };
        };
    };
};

After booting the newly created “torizon-core-docker-evaluation-verdin-imx8mp-Tezi_5.5.0+build.11.container.tar” (own overlays included) :

# dmesg | grep SX
input: SX8654 I2C Touchscreen as /devices/platform/soc@0/30800000.bus/30a50000.i2c/i2c-3/3-0049/input/input2

# udevadm info /dev/input/event2
P: /devices/platform/soc@0/30800000.bus/30a50000.i2c/i2c-3/3-0049/input/input2/event2
N: input/event2
L: 0
S: input/by-path/platform-30a50000.i2c-event
E: DEVPATH=/devices/platform/soc@0/30800000.bus/30a50000.i2c/i2c-3/3-0049/input/input2/event2
E: DEVNAME=/dev/input/event2
E: MAJOR=13
E: MINOR=66
E: SUBSYSTEM=input
E: USEC_INITIALIZED=6342670
E: ID_INPUT=1
E: ID_INPUT_TOUCHSCREEN=1
E: ID_PATH=platform-30a50000.i2c
E: ID_PATH_TAG=platform-30a50000_i2c
E: UDISKS_FILESYSTEM_SHARED=1
E: DEVLINKS=/dev/input/by-path/platform-30a50000.i2c-event

Tried to run evtest on a dedicated Debian container with

# docker run -ti --rm -e ACCEPT_FSL_EULA=1 --privileged -v /dev:/dev -v /run/udev/:/run/udev/ -v /etc/udev/rules.d:/etc/udev/rules.d debian:latest
# apt update
# apt install evtest
# evtest
Available devices:
/dev/input/event0:      30370000.snvs:snvs-powerkey
/dev/input/event1:      gpio-keys
/dev/input/event2:      SX8654 I2C Touchscreen

event number [0-2]: 2
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "SX8654 I2C Touchscreen"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max     4095
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max     4095
Properties:
  Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)

to see, whether the touchpanel is working. No luck as i press the panel, but no events are emitted.

What am I missing guys?
Any help is greatly appreciated!

Greetings @Karle,

Where did you get the information to create this overlay? There are some fields that I don’t recognize like powdly and setdly. Furthermore I don’t believe the pins are correct. You are using the pin groups pinctrl_gpio_9_dsi and pinctrl_i2s_2_bclk_touch_reset. Which I imagined you copied from the definition of the atmel touch controller.

However for reset-gpios you then reference “gpio3 23” even though pinctrl_i2s_2_bclk_touch_reset refers to “gpio5 0”. Same with your interrupt GPIO it doesn’t seem to match the pin group. Did you re-define these pin groups somewhere? Otherwise if you’re using the original definitions then your pins don’t seem to match.

Best Regards,
Jeremias

Hi @jeremias.tx

Very good point! I reworked my overlay with the “hopefully” correct pinnings:

pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_9_dsi>, <&pinctrl_i2s_2_bclk_touch_reset>;
interrupt-parent = <&gpio4>;
interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
reset-gpio = <&gpio5 0 GPIO_ACTIVE_LOW>;

But I get the same result with evtest

Available devices:
/dev/input/event0:      30370000.snvs:snvs-powerkey
/dev/input/event1:      gpio-keys
/dev/input/event2:      SX8654 I2C Touchscreen

event number [0-2]: 2
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "SX8654 I2C Touchscreen"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max     4095
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max     4095
Properties:
  Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)

No events … nothing to happen :frowning:
Is there anything else, I can have a look at?

Hi again @jeremias.tx

Touchpanel is up and running - The wiring was incorrect :slight_smile:
Thanks for your assistance!

No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      30370000.snvs:snvs-powerkey
/dev/input/event1:      gpio-keys
/dev/input/event2:      SX8654 I2C Touchscreen
Select the device event number [0-2]: 2
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x0 version 0x0
Input device name: "SX8654 I2C Touchscreen"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 330 (BTN_TOUCH)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value      0
      Min        0
      Max     4095
    Event code 1 (ABS_Y)
      Value      0
      Min        0
      Max     4095
Properties:
  Property type 1 (INPUT_PROP_DIRECT)
Testing ... (interrupt to exit)
Event: time 1664357383.287117, type 3 (EV_ABS), code 0 (ABS_X), value 2517
Event: time 1664357383.287117, type 3 (EV_ABS), code 1 (ABS_Y), value 1301
Event: time 1664357383.287117, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1664357383.287117, -------------- SYN_REPORT ------------
Event: time 1664357383.290809, type 3 (EV_ABS), code 0 (ABS_X), value 2518
Event: time 1664357383.290809, -------------- SYN_REPORT ------------
Event: time 1664357383.294195, type 3 (EV_ABS), code 1 (ABS_Y), value 1297
Event: time 1664357383.294195, -------------- SYN_REPORT ------------
Event: time 1664357383.297568, type 3 (EV_ABS), code 0 (ABS_X), value 2543
Event: time 1664357383.297568, type 3 (EV_ABS), code 1 (ABS_Y), value 1307
Event: time 1664357383.297568, -------------- SYN_REPORT ------------
Event: time 1664357383.300887, type 3 (EV_ABS), code 0 (ABS_X), value 2551
Event: time 1664357383.300887, type 3 (EV_ABS), code 1 (ABS_Y), value 1310
Event: time 1664357383.300887, -------------- SYN_REPORT ------------
Event: time 1664357383.304232, type 3 (EV_ABS), code 0 (ABS_X), value 2552
Event: time 1664357383.304232, type 3 (EV_ABS), code 1 (ABS_Y), value 1307
Event: time 1664357383.304232, -------------- SYN_REPORT ------------
Event: time 1664357383.307599, type 3 (EV_ABS), code 0 (ABS_X), value 2551
Event: time 1664357383.307599, type 3 (EV_ABS), code 1 (ABS_Y), value 1305
Event: time 1664357383.307599, -------------- SYN_REPORT ------------
Event: time 1664357383.310967, type 3 (EV_ABS), code 0 (ABS_X), value 2558
Event: time 1664357383.310967, type 3 (EV_ABS), code 1 (ABS_Y), value 1308
Event: time 1664357383.310967, -------------- SYN_REPORT ------------
Event: time 1664357383.314341, type 3 (EV_ABS), code 0 (ABS_X), value 2553
Event: time 1664357383.314341, type 3 (EV_ABS), code 1 (ABS_Y), value 1306
Event: time 1664357383.314341, -------------- SYN_REPORT ------------
Event: time 1664357383.317714, type 3 (EV_ABS), code 0 (ABS_X), value 2555
Event: time 1664357383.317714, type 3 (EV_ABS), code 1 (ABS_Y), value 1323
Event: time 1664357383.317714, -------------- SYN_REPORT ------------
Event: time 1664357383.321080, type 3 (EV_ABS), code 0 (ABS_X), value 2566
Event: time 1664357383.321080, type 3 (EV_ABS), code 1 (ABS_Y), value 1340
Event: time 1664357383.321080, -------------- SYN_REPORT ------------
Event: time 1664357383.324424, type 3 (EV_ABS), code 0 (ABS_X), value 2568
Event: time 1664357383.324424, type 3 (EV_ABS), code 1 (ABS_Y), value 1346
Event: time 1664357383.324424, -------------- SYN_REPORT ------------
Event: time 1664357383.327792, type 3 (EV_ABS), code 0 (ABS_X), value 2566
Event: time 1664357383.327792, type 3 (EV_ABS), code 1 (ABS_Y), value 1349
Event: time 1664357383.327792, -------------- SYN_REPORT ------------
Event: time 1664357383.331163, type 3 (EV_ABS), code 0 (ABS_X), value 2569
Event: time 1664357383.331163, -------------- SYN_REPORT ------------
Event: time 1664357383.334539, type 3 (EV_ABS), code 0 (ABS_X), value 2571
Event: time 1664357383.334539, -------------- SYN_REPORT ------------
Event: time 1664357383.337903, type 3 (EV_ABS), code 0 (ABS_X), value 2575
Event: time 1664357383.337903, type 3 (EV_ABS), code 1 (ABS_Y), value 1351
Event: time 1664357383.337903, -------------- SYN_REPORT ------------
Event: time 1664357383.341265, type 3 (EV_ABS), code 0 (ABS_X), value 2570
Event: time 1664357383.341265, -------------- SYN_REPORT ------------
Event: time 1664357383.344641, type 3 (EV_ABS), code 0 (ABS_X), value 2578
Event: time 1664357383.344641, type 3 (EV_ABS), code 1 (ABS_Y), value 1352
Event: time 1664357383.344641, -------------- SYN_REPORT ------------
Event: time 1664357383.348008, type 3 (EV_ABS), code 0 (ABS_X), value 2580
Event: time 1664357383.348008, type 3 (EV_ABS), code 1 (ABS_Y), value 1357
Event: time 1664357383.348008, -------------- SYN_REPORT ------------
Event: time 1664357383.351385, type 3 (EV_ABS), code 0 (ABS_X), value 2578
Event: time 1664357383.351385, -------------- SYN_REPORT ------------
Event: time 1664357383.354772, type 3 (EV_ABS), code 0 (ABS_X), value 2594
Event: time 1664357383.354772, type 3 (EV_ABS), code 1 (ABS_Y), value 1374
Event: time 1664357383.354772, -------------- SYN_REPORT ------------
Event: time 1664357383.358172, type 3 (EV_ABS), code 0 (ABS_X), value 2595
Event: time 1664357383.358172, type 3 (EV_ABS), code 1 (ABS_Y), value 1376
Event: time 1664357383.358172, -------------- SYN_REPORT ------------
Event: time 1664357383.361519, type 3 (EV_ABS), code 0 (ABS_X), value 2600
Event: time 1664357383.361519, type 3 (EV_ABS), code 1 (ABS_Y), value 1375
Event: time 1664357383.361519, -------------- SYN_REPORT ------------
Event: time 1664357383.364920, type 3 (EV_ABS), code 0 (ABS_X), value 2580
Event: time 1664357383.364920, type 3 (EV_ABS), code 1 (ABS_Y), value 1530
Event: time 1664357383.364920, -------------- SYN_REPORT ------------
Event: time 1664357383.365488, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
Event: time 1664357383.365488, -------------- SYN_REPORT ------------

Glad you were able to get things resolved on your side.