1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- From 8781ba7f45695af3ab8e8d1b55a31f527c9201a3 Mon Sep 17 00:00:00 2001
- From: Aren Moynihan <[email protected]>
- Date: Thu, 8 Dec 2022 17:02:26 -0500
- Subject: [PATCH] mfd: axp20x: Fix order of pek rise and fall events
- The power button can get "stuck" if the rising edge and falling edge irq
- are read in the same pass. This can often be triggered when resuming
- from suspend if the power button is released before the kernel handles
- the interrupt.
- Swapping the order of the rise and fall events makes sure that the press
- event is handled first, which prevents this situation.
- Signed-off-by: Aren Moynihan <[email protected]>
- Reviewed-by: Samuel Holland <[email protected]>
- Tested-by: Samuel Holland <[email protected]>
- Acked-by: Chen-Yu Tsai <[email protected]>
- Signed-off-by: Lee Jones <[email protected]>
- Link: https://lore.kernel.org/r/[email protected]
- ---
- include/linux/mfd/axp20x.h | 15 ++++++++++-----
- 1 file changed, 10 insertions(+), 5 deletions(-)
- --- a/include/linux/mfd/axp20x.h
- +++ b/include/linux/mfd/axp20x.h
- @@ -432,8 +432,9 @@ enum {
- AXP152_IRQ_PEK_SHORT,
- AXP152_IRQ_PEK_LONG,
- AXP152_IRQ_TIMER,
- - AXP152_IRQ_PEK_RIS_EDGE,
- + /* out of bit order to make sure the press event is handled first */
- AXP152_IRQ_PEK_FAL_EDGE,
- + AXP152_IRQ_PEK_RIS_EDGE,
- AXP152_IRQ_GPIO3_INPUT,
- AXP152_IRQ_GPIO2_INPUT,
- AXP152_IRQ_GPIO1_INPUT,
- @@ -472,8 +473,9 @@ enum {
- AXP20X_IRQ_LOW_PWR_LVL1,
- AXP20X_IRQ_LOW_PWR_LVL2,
- AXP20X_IRQ_TIMER,
- - AXP20X_IRQ_PEK_RIS_EDGE,
- + /* out of bit order to make sure the press event is handled first */
- AXP20X_IRQ_PEK_FAL_EDGE,
- + AXP20X_IRQ_PEK_RIS_EDGE,
- AXP20X_IRQ_GPIO3_INPUT,
- AXP20X_IRQ_GPIO2_INPUT,
- AXP20X_IRQ_GPIO1_INPUT,
- @@ -502,8 +504,9 @@ enum axp22x_irqs {
- AXP22X_IRQ_LOW_PWR_LVL1,
- AXP22X_IRQ_LOW_PWR_LVL2,
- AXP22X_IRQ_TIMER,
- - AXP22X_IRQ_PEK_RIS_EDGE,
- + /* out of bit order to make sure the press event is handled first */
- AXP22X_IRQ_PEK_FAL_EDGE,
- + AXP22X_IRQ_PEK_RIS_EDGE,
- AXP22X_IRQ_GPIO1_INPUT,
- AXP22X_IRQ_GPIO0_INPUT,
- };
- @@ -571,8 +574,9 @@ enum axp803_irqs {
- AXP803_IRQ_LOW_PWR_LVL1,
- AXP803_IRQ_LOW_PWR_LVL2,
- AXP803_IRQ_TIMER,
- - AXP803_IRQ_PEK_RIS_EDGE,
- + /* out of bit order to make sure the press event is handled first */
- AXP803_IRQ_PEK_FAL_EDGE,
- + AXP803_IRQ_PEK_RIS_EDGE,
- AXP803_IRQ_PEK_SHORT,
- AXP803_IRQ_PEK_LONG,
- AXP803_IRQ_PEK_OVER_OFF,
- @@ -623,8 +627,9 @@ enum axp809_irqs {
- AXP809_IRQ_LOW_PWR_LVL1,
- AXP809_IRQ_LOW_PWR_LVL2,
- AXP809_IRQ_TIMER,
- - AXP809_IRQ_PEK_RIS_EDGE,
- + /* out of bit order to make sure the press event is handled first */
- AXP809_IRQ_PEK_FAL_EDGE,
- + AXP809_IRQ_PEK_RIS_EDGE,
- AXP809_IRQ_PEK_SHORT,
- AXP809_IRQ_PEK_LONG,
- AXP809_IRQ_PEK_OVER_OFF,
|