Implementing Dual-Function GPIO Key Mapping for Display Control and System Restart on i.MX8QXP SoM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Implementing Dual-Function GPIO Key Mapping for Display Control and System Restart on i.MX8QXP SoM

220 Views
adnan_dst
Contributor III

Hi,

We are using an i.MX8QXP SoM and have built the OS image with the following Yocto configuration:

  • MACHINE = imx8qxpc0mek

  • DISTRO = fsl-imx-wayland

  • DISTRO_VERSION = 6.6-scarthgap

  • Kernel Version: 6.6.36

A GPIO expander is connected over I2C, and we have successfully mapped several GPIOs to key events like number keys and letters.

Now, we want to assign a dual-functionality to one GPIO key:

  • Short press: Turns off the display.

  • Long press (≥5 seconds): Restarts the system.

We are looking for the appropriate Linux input event keycode to assign this behavior with dual functionality and device tree configuration.

Regads,
Adnan

0 Kudos
Reply
0 Replies