Out-of-tree driver missing from /kernel/drivers

Hi,

I’m looking to include the eeti_ts driver in my custom Yocto build, for my device which has an attached EETI I2C multi-touch panel. I’ve edited the default apalis_imx6_defconfig, selecting the appropriate EETI driver, and have verified that the selection is correct in the resulting defconfig file which is then included in my custom Yocto layer. I’ve also added a patch to the relevant .dtsi file, and have added the compatible = “eeti,eeti_ts” property for the given I2C channel and register. The kernel compiles without issue, and I can see eeti_ts.o and .eeti_ts.o.cmd in /build/drivers/input/touchscreen.

However, in my actual Tezi and modules directories, there is no eeti_ts.ko file in /kernel/drivers/input/touchscreen. Both the default .ko files (atmel_mxt_ts.ko and fusion_F0710A.ko) are present. It’s worth noting that in the previously mentioned tmp build directory, the atmel_mxt_ts and fusion_F0710A drivers not only have the .o file like eeti_ts, but also have the .ko, .mod.c, .mod.o and .o files (as well as various others). This suggests to me that I don’t have a configuration option correctly set for eeti_ts, as not all the (seemingly) required files are being generated, nor is the .ko file being packed into the Tezi filesystem.

Have I missed something in a .conf file, or is there anything else I’m supposed to do? I’ve had a look through the usual Yocto directories and files for the atmel_mxt_ts and fusion_F0710A phrases as a reference, but nothing obvious has jumped out at me.

Any guidance on this would be greatly appreciated!

Hi @jars121

Thanks for writing to the Toradex community!

Could you share the files you changed in your custom yocto build?

Best regards,
Jaski

Hi @jaski.tx

Thank you for your prompt response as always. It would appear that I’ve addressed this issue, but I’m not entirely sure why it’s worked. It seems that if I enable the eeti_ts driver in defconfig with CONFIG_TOUCHSCREEN_EETI=y then the .ko file is not added to the build, but if I instead use CONFIG_TOUCHSCREEN_EETI=m it is. I’ve made the change from =y to =m and now the eeti_ts.ko file is in /kernel/drivers/input/touchscreen as expected.

I’m attempting to use these touchscreen drivers on the bitbanged DDC I2C channel, and have made the required changes in the .dtsi patch. I feel like I need to i2c_register_board_info as well, but all mentions of the board-apalis_imx6.c file seem to be from several years ago; the current linux-toradex kernel source doesn’t seem to have an arch/arm/mach-mx6/board-apalis_imx6.c file anymore? Where do I need to add the i2c and interrupt registration? My .dtsi changes are included below.

&i2cddc {
        status = "okay"

-       hdmi_ddc: edid@50 {
-              compatible = "fsl,imx6-hdmi-i2c";
-              reg = <0x50>;
-       };
+      eeti_ts@2a {
+              compatible = "eeti,eeti_ts";
+              reg = <0x2a>;
+              interrupt-parent = <&gpio5>;
+              interrupts = <19 8>;
+              int-gpios = <&gpio5 19 0>;
+      };
};

HI @jars121

I enable the eeti_ts driver in defconfig with CONFIG_TOUCHSCREEN_EETI=y, then the .ko file is not added to the build

This is a regular use case, when you set a config to “Y”, then driver is included in the kernel and .ko file is not needed.

I feel like I need to i2c_register_board_info as well, but all mentions of the board-apalis_imx6.c file seem to be from several years ago; the current linux-toradex kernel source doesn’t seem to have an arch/arm/mach-mx6/board-apalis_imx6.c file anymore?

All the device information have been moved to the devicetree files. As you correctly did, you should add the i2c and interrupt information to the devicetree files.

Is the touch screen working now?

Best regards,
Jaski

Hi @jaski.tx

I can see that the driver is indeed installed and active, and that the touchscreen is correctly registered as an input device in /proc/bus/input/devices, but I’m not getting any raw data out of the i2c interface. The eeti_ts driver I’ve used isn’t the exact .c/.h file as supplied by the manufacturer, so it’s probably due to it not being 100% compatible with my particular touchscreen controller.

If were to instead use the supplied .c/.h files in building my OE image, again making the required changes to the device tree, how do I include the files in the build so that they’re correctly built and installed as drivers in the image? Given that these are completely external files and won’t be selectable in menuconfig?

Edit: It’s also worth reiterating that I’m using the bit-banged i2cddc interface. It’s correctly patched in the device tree so I don’t see why it wouldn’t work, but it may also be worth considering.

Hi @jaski.tx

Never mind the above comment! I managed to add the external driver, re-build my kernel and image, and the touchscreen is now working perfectly! For anyone else that is struggling to incorporate an out-of-device-tree driver in their OE build, the (very) high level steps are as follows:

  1. You need to make a patch for the Kconfig file in {linux kernel source}/drivers/input/touchscreen.
  2. You need to make a similar patch to the Makefile in the same directory ({linux kernel source}/drivers/input/touchscreen).
  3. Include the patches in your Yocto kernel files directory (whichever folder you’ve ‘appended’ in your .bbappend file).
  4. Include the driver .c file in your Yocto kernel files directory (same as above), and add the file to your .bbappend file.

Perfect that it works.

Thanks for your input.