AnsweredAssumed Answered

How to prevent the power button from putting the device into sleep?

Question asked by Dennis Muhlestein on May 6, 2020
Latest reply on May 13, 2020 by Dennis Muhlestein

Our device has a power button the user can turn on/off the device like normal.  In fsl-imx8mq.dtsi this is defined via the snvs_pwrkey node:


     snvs_pwrkey: snvs-powerkey {
      compatible = "fsl,sec-v4.0-pwrkey";
      regmap = <&snvs>;
      interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
      linux,keycode = <KEY_POWER>;


Power functions all work as designed except I have the need to prevent the device from going into a sleep state.  


Power button long press -> show power menu, user can shutdown or reboot (OK)

Power button long press > 5 seconds -> hard shutdown (OK)

Power button short press -> sleep. (wish to disable this)

Power button short press -> wake


Can someone point me to the right layer in Android or Linux where I might change the handler to ignore the short press sleep state?