Disable power key in Android 12.1 in imx8mp

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

Disable power key in Android 12.1 in imx8mp

Jump to solution
462 Views
dgeier315
Contributor III

I need to disable the power button function when our unit enters a certain state and enable it when it leaves that state.

Does Android have a function call for that(imx_snvs_pwrkey_pm_ops?), or do I need to disable the interrupt?

Thanks

 

                snvs_pwrkey: snvs-powerkey {
                    compatible = "fsl,sec-v4.0-pwrkey";
                    regmap = <&snvs>;
                    interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
                    clocks = <&clk IMX8MP_CLK_SNVS_ROOT>;
                    clock-names = "snvs-pwrkey";
                    linux,keycode = <KEY_POWER>;
                    debounce-interval = <2000>;

                    wakeup-source;
                    status = "okay";
                };
 
0 Kudos
Reply
1 Solution
392 Views
dgeier315
Contributor III
echo \"30370000.snvs:snvs-powerkey\" > /sys/bus/platform/drivers/snvs_pwrkey/bind
echo \"30370000.snvs:snvs-powerkey\" > /sys/bus/platform/drivers/snvs_pwrkey/unbind
 
These commands were able to disable the power button.
 

View solution in original post

0 Kudos
Reply
3 Replies
393 Views
dgeier315
Contributor III
echo \"30370000.snvs:snvs-powerkey\" > /sys/bus/platform/drivers/snvs_pwrkey/bind
echo \"30370000.snvs:snvs-powerkey\" > /sys/bus/platform/drivers/snvs_pwrkey/unbind
 
These commands were able to disable the power button.
 
0 Kudos
Reply
390 Views
dgeier315
Contributor III
 
0 Kudos
Reply
445 Views
Alejandro_Salas
NXP TechSupport
NXP TechSupport

Hello @dgeier315 

 

As you mentioned, disabling the IRQ can works, and re-enabling again. Take a look to the ICR1, ICR2 and IMR registers on Reference Manual.

 

Best regards,

Salas.

0 Kudos
Reply