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>;
wakeup-source;
};
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?
Solved! Go to Solution.
This is not a i.MX specific rather it is Android supported feature.
To disable the Power button short press sleep functionality, change the value of the variable "config_shortPressOnPowerBehavior" to 0 (zero) in {AOSP}/frameworks/base/core/res/res/values/config.xml file.
Hope this will help you.
Regards,
Shivani
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
This is not a i.MX specific rather it is Android supported feature.
To disable the Power button short press sleep functionality, change the value of the variable "config_shortPressOnPowerBehavior" to 0 (zero) in {AOSP}/frameworks/base/core/res/res/values/config.xml file.
Hope this will help you.
Regards,
Shivani
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you for this tip. That's exactly what I was looking for.