msm: qpnp-power-on: Use BARK interrupt for key reporting
The PMIC 8941 v1.0 has a hardware bug where the RESIN line
does not generate an interrupt on key-press. The bark interrupt
can be used to provide the required functionality as follows -
Initialization:
1. Configure the bark (s1 timer) to 0ms, this generates the bark
interrupt as soon as the key is pressed.
2. Configure S2 reset timer to max 2 seconds and enable the S2 reset.
Runtime:
1. On receiving a bark interrupt report the key press, disable
reset and the bark irq. Schedule a work handler to execute after 500ms.
2. In the work, enable the reset and check the bark RT status bit.
3. If the bark RT bit is 0, report the key release and exit.
4. If bark RT bit is 1, disable the reset and re-arm the work for 500ms.
Change-Id: I6da47d27e32ada34660e36e6265f9078b2144999
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
1 file changed