I have a TCA8418 I2C Keypad Controller on my Custom carrier board for Verdin iMX8M-Plus.
And I would like using it from Torizon OS.
Is there any suggestion on how to customize a dts file for this?
Some years ago someone else made a request very similar (almost the same but for a different SoM), but with no answer.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Did you like my answer?
Hello! Thank you for your detailed question.
To integrate the TCA8418 I2C Keypad Controller with your Verdin iMX8M Plus module running Torizon OS, you will need to create a device tree overlay to properly configure the driver and hardware mapping. Here is a general step-by-step approach tailored for your scenario:
1. Identify I2C Bus and GPIO for IRQ
Determine which I2C bus the TCA8418 is connected to on your carrier board (commonly i2c4 on Verdin iMX8M Plus, but confirm with your board schematics).
Find out which GPIO is wired to the TCA8418’s interrupt (INT) pin.
2. Create a Device Tree Overlay
Device tree overlays let you easily add your configuration on top of the standard hardware description. Here is an example overlay snippet for i2c4 (replace values as appropriate):
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&i2c4>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
tca8418: keypad@34 {
compatible = "ti,tca8418";
reg = <0x34>; // I2C address of TCA8418
interrupt-parent = <&gpio3>; // GPIO controller (replace as per your wiring)
interrupts = <4 IRQ_TYPE_LEVEL_LOW>; // GPIO pin and trigger (replace as needed)
linux,keymap = <
// Fill in your key mapping here
>;
gpio-controller;
#gpio-cells = <2>;
// Add additional properties as required
};
};
};
};
Adjust the reg, interrupt-parent, and interrupts values based on your hardware setup.
Complete the linux,keymap property according to your keypad matrix.
3. Compile and Deploy the Overlay
Compile the overlay using the device tree compiler (dtc).
Reference your overlay in the Torizon OS device tree overlays configuration file or through the Torizon OS build system, as documented in the Device Tree Technical Overview.
5. Test I2C Access
Use the I2C tools inside a Torizon container to ensure communication with the TCA8418: How to Use I2C on Torizon
Once the device tree overlay is active, the TCA8418 should be detected and the keypad events should be accessible from Linux input devices.
If you’d like, I can help you with a more specific example if you provide your I2C bus number and which GPIO is connected to the TCA8418 INT pin.
What do you mean with this sentence?
Is the relevant kernel module included in Torizon OS or not?
Is this an activity that requires Torizon customization from Toradex side? Or can this be done by the customer alone (using torizoncore-builder)?
CONFIG_KEYBOARD_TCA8418 is not set on Torizon OS, and therefore the kernel module not available by default.
To add this kernel module, there are different approaches that can be taken:
Ask Toradex to include it by default.
This is what Jeremias mentioned could be done. It usually takes us a few days to evaluate if it will have any other impacts on the system and to make it available on the following nightly pre-release.
Add it as an external kernel module via TorizonCore Builder.
Do your own Yocto build of Torizon to enable this kernel config.
Please let us know if you would like us to enable the CONFIG_KEYBOARD_TCA8418 as a module on Torizon OS by default.