mtk-pmic-keys: Ignore power button if pressed before driver loads

Arınç ÜNAL arinc.unal at arinc9.com
Mon Jan 30 05:36:23 PST 2023


Hi all,

The power button on my Bananapi BPI-R2 (MT7623NI SoC, mt6323-keys) is 
shorted, so the device automatically boots when there's power. This 
causes the device to reboot when KEYBOARD_MTK_PMIC is loaded because the 
driver sees the power button being pressed.

I was wondering if it's possible to change the driver in a way that 
doesn't break in this situation. Maybe don't do anything if the first 
state of the the power button the driver sees is being pressed, and if 
the state doesn't change.

To address an edge case, if the power button was being pressed before 
the driver loads, look for if it's ever released. Only after then start 
working as usual.

Looking forward to hearing your thoughts.
Arınç



More information about the Linux-mediatek mailing list