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

250 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
%3CLINGO-SUB%20id%3D%22lingo-sub-2140650%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EImplementing%20Dual-Function%20GPIO%20Key%20Mapping%20for%20Display%20Control%20and%20System%20Restart%20on%20i.MX8QXP%20SoM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2140650%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20are%20using%20an%20%3CSTRONG%3Ei.MX8QXP%20SoM%3C%2FSTRONG%3E%20and%20have%20built%20the%20OS%20image%20with%20the%20following%20Yocto%20configuration%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3EMACHINE%20%3D%20imx8qxpc0mek%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EDISTRO%20%3D%20fsl-imx-wayland%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EDISTRO_VERSION%20%3D%206.6-scarthgap%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3E%3CSTRONG%3EKernel%20Version%3C%2FSTRONG%3E%3A%206.6.36%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EA%20%3CSTRONG%3EGPIO%20expander%20is%20connected%20over%20I2C%3C%2FSTRONG%3E%2C%20and%20we%20have%20successfully%20mapped%20several%20GPIOs%20to%20key%20events%20like%20number%20keys%20and%20letters.%3C%2FP%3E%3CP%3ENow%2C%20we%20want%20to%20assign%20a%20%3CSTRONG%3Edual-functionality%20to%20one%20GPIO%20key%3C%2FSTRONG%3E%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3E%3CSTRONG%3EShort%20press%3C%2FSTRONG%3E%3A%20Turns%20%3CSTRONG%3Eoff%20the%20display%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3E%3CSTRONG%3ELong%20press%20(%E2%89%A55%20seconds)%3C%2FSTRONG%3E%3A%20%3CSTRONG%3ERestarts%20the%20system%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EWe%20are%20looking%20for%20the%20appropriate%20%3CSTRONG%3ELinux%20input%20event%20keycode%3C%2FSTRONG%3E%20to%20assign%20this%20behavior%20with%20dual%20functionality%20and%20device%20tree%20configuration.%3CBR%20%2F%3E%3CBR%20%2F%3ERegads%2C%3CBR%20%2F%3EAdnan%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2140650%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%208%20Family%20%7C%20i.MX%208QuadMax%20(8QM)%20%7C%208QuadPlus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELinux%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EYocto%20Project%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E