G520 power key long press behavior configuration

Dear MTK,

The customer wants to know if a long press of the G520 power key can generate an event for the system.

The use case is:
After a long press of the power key, a message pops up asking if the user wants to power off, and then a password is required to power off.

Is there a similar configuration that can be provided to the customer for reference?

Thanks.


Best Regards,
Roy Hung

Dear Roy_Hung,

Thank you for your inquiry.

To better assist you with your request, could you please confirm whether your Genio-520 platform is running Android or Yocto?

Thank you.

Dear Santosh,

Customer is using “Android”.

Thanks.


Best Regards,
Roy Hung

Dear Customer,

In our G520 EVK, power key does not generate a event and it is directly controlled by the PMIC and hardwired to turn the device off when pressed.

Thanks

Dear MTK,

Thank you for your help.

We will inform the customer.

Thanks.

- -

Best Regard s,

Roy H ung

You can disable power key turn off on the Genio 520 EVK in Linux. I have a board running IOT-Yocto 25.1.1 and was able to do this with a systemd config file.

You can see evtest running without a power down or reset below. Holding the power key and home together did reset the board after 8 seconds (�… shows reset).

root@genio-520-evk-ufs:~# cat > /usr/lib/systemd/logind.conf.d/01-disable-pwr-key.conf << EOF
[Login]
HandlePowerKey=ignore
EOF
root@genio-520-evk-ufs:~# systemctl restart systemd-logind
root@genio-520-evk-ufs:~# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Goodix Capacitive TouchScreen
/dev/input/event1: mt8391-evk Headset Jack
/dev/input/event2: mtk-pmic-keys
Select the device event number [0-2]: 2
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x1
Input device name: “mtk-pmic-keys”
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 102 (KEY_HOME)
Event code 116 (KEY_POWER)
Properties:
Testing … (interrupt to exit)
Event: time 1774765775.099828, type 1 (EV_KEY), code 102 (KEY_HOME), value 1
Event: time 1774765775.099828, -------------- SYN_REPORT ------------
Event: time 1774765775.341737, type 1 (EV_KEY), code 102 (KEY_HOME), value 0
Event: time 1774765775.341737, -------------- SYN_REPORT ------------
Event: time 1774765778.108514, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1774765778.108514, -------------- SYN_REPORT ------------
Event: time 1774765778.294951, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1774765778.294951, -------------- SYN_REPORT ------------
Event: time 1774765850.169641, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1774765850.169641, -------------- SYN_REPORT ------------
Event: time 1774765869.552647, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1774765869.552647, -------------- SYN_REPORT ------------
Event: time 1774765938.292588, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1774765938.292588, -------------- SYN_REPORT ------------
Event: time 1774765939.044985, type 1 (EV_KEY), code 102 (KEY_HOME), value 1
Event: time 1774765939.044985, -------------- SYN_REPORT ------------
�������������������������������������������