Problems setting up FT5446 Polytouch touchscreen device

Hello everyone! I am trying to set up a 7" capacitive touch screen which uses the FT5446 chip and having difficulty. I believe I should be able to use the edt-ft5x06 driver that is included in the standard Linux kernel build. Appreciate any help. Here’s where I’m at:

  • I’ve updated my device tree overlay as shown below, and built Torizon with torizoncore-builder. I know that the build and deployment process is working as I’ve configured other things in the device tree successfully (e.g. the LVDS display itself is working). My device tree overlay is essentially the stock imx6q-apalis-ixora-v1.2.dts with a few changes.
  • I’ve connected the touchscreen to I2C1 and I’ve confirmed that I can see it on the bus with i2cdetect (the touchscreen’s address, 0x38, appears when it is connected).
  • modinfo edt-ft5x06 provides information about the driver, which tells me that the module is at least available. It lists “edt-ft5x06” as an alias, which is the same string used in the device tree However, lsmod does not show it as loaded, and I see no messages at boot from this driver (nothing in dmesg).

Here’s my configuration:

  • Apalis iMX6Q 2GB on custom carrier board (based on Ixora v1.2). The capacitive touchscreen interface is identical to the Ixora (I2C1, with touch interrupt on GPIO5 and reset on GPIO6).
  • TorizonCore build based on torizon-core-docker-apalis-imx6-Tezi_5.5.0+build.11.tar
  • 7" LVDS capacitive touch screen with FT5446 I2C touch interface. This is the 7" module sold by Variscite. Link to datasheet.

Questions:

  • Do I need to do anything else, aside from enabling the device in the device tree overlay, to get the driver to load?
  • I’m not clear on the pinctrl-0 parameter. I’ve commented this out as Torizon would not build with this parameter because pinctrl_edt_ft5x06 is not defined. Where is this supposed to be defined?
  • I’ve also commented out wake-gpios and wakeup-source as this display does not have separate reset and wake output. Is that appropriate? I don’t think this is essential to the function of the driver, but not sure.
  • Is there any way for me to manually load the driver with this configuration in place and see if it’s able to talk to the display? I did try modprobe edt-ft5x06 and this seemed to load the driver but I’m not sure it is configured properly when I load it that way–there was still no comms with the touchscreen.
/* I2C1_SDA/SCL on MXM3 209/211 (e.g. RTC on carrier board) */
&i2c1 {
	status = "okay";

    polytouch: edt-ft5x06@38 {
        compatible = "edt,edt-ft5x06";
        reg = <0x38>;
        pinctrl-names = "default";
        //pinctrl-0 = <&pinctrl_edt_ft5x06>;
        interrupt-parent = <&gpio6>;
        interrupts = <10 IRQ_TYPE_EDGE_FALLING>;
        reset-gpios = <&gpio6 9 GPIO_ACTIVE_HIGH>;
        //wake-gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
        //wakeup-source;
		status = "okay";
    };

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

	eeprom: eeprom@50 {
		compatible = "atmel,24c02";
		reg = <0x50>;
		pagesize = <16>;
	};
};

Greetings @mosaic-engineering,

On initial view I’d say the issue is that you’re not defining pinctrl-0. You need to actually define the node pinctrl_edt_ft5x06 or whatever you decided to call this node. Otherwise no actual in definitions are being passed to this node.

For reference look at the i2c touch we use in our default device tree here: imx6qdl-apalis.dtsi « dts « boot « arm « arch - linux-toradex.git - Linux kernel for Apalis and Colibri modules

Notice the pinctrl-0 node, further down in that same file if you search for pinctrl_apalis_gpio5 and pinctrl_apalis_gpio6 you’ll find these nodes defined. Defining new pinctrl nodes via overlay can be a bit odd, so it may be easier to just modify the device tree directly, then build and deploy that.

Best Regards,
Jeremias

I was able to get it to work. Walking through my process…I first confirmed that I was able to load the module with modprobe edt_ft5x06. The module then showed up in dmesg and running i2cdetect 0 indicated that address 0x38 was in use (“UU”). I was able to observe touchscreen events with evtest and the coordinates looked accurate.

For some reason, the touchscreen driver was not loading automatically at boot (I thought it would load automatically if it was enabled in the device tree? guess not…). I added a file, edt_ft5x06.conf, to /etc/module-load.d/. This got the touchscreen driver starting at boot time.

I then noticed that the touch events were registering on the UI, but the X/Y coordinates were way off because the touchscreen driver was unaware of the display resolution. evtest showed 65535 for ABS_X/ABS_Y Max, whereas the actual coordinates were in the range of 0-800/0-480 (the actual resolution of the display). So I think my touch events were just scaled way down on the screen. I updated the device tree overlay as follows to adjust the resolution of the touchscreen and invert both axes. Works like a charm.

Note that the only parameters that are required for this driver are: compatible, reg, interrupt-parent, and interrupts. Everything else is optional.

&i2c1 {
    clock-frequency = <100000>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_i2c1>;
    status = "okay";

    polytouch: edt-ft5x06@38 {
        compatible = "edt,edt-ft5x06";
        reg = <0x38>;
        interrupt-parent = <&gpio6>;
        interrupts = <10 IRQ_TYPE_EDGE_FALLING>;
	touchscreen-size-x = <800>;
	touchscreen-size-y = <480>;
	touchscreen-inverted-x = <1>;
	touchscreen-inverted-y = <1>;
	status = "okay";
    };
};

I also added a line to /etc/udev/rules.d/touchscreen.rules to recognize this touchscreen and map it to /dev/input/touchscreen0, although I’m not sure this is really needed:

SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="edt_ft5x06", SYMLINK+="input/touchscreen0"

Thank you for sharing your findings and solutions.

Strange that the driver wasn’t being loaded on boot. But perhaps no sub-system/peripheral was asking for it on boot, so the system just assumed it wasn’t needed at boot-time.

Though perhaps this is just a quirk of this specific touch driver. In any case glad to see you got it working.

Best Regards,
Jeremias

Just a quick note here to say that I had a typo above. The correct folder is /etc/modules-load.d, not /etc/module-load.d

Thank you for coming back to clarify.