From 9eaa22bc792ee2320f7bb14f8396c6cd06ddccc3 Mon Sep 17 00:00:00 2001 From: Joseph Chen Date: Mon, 16 Apr 2018 17:39:09 +0800 Subject: [PATCH] mfd: rk808: set fall event higher priority than rise event When PMIC irq occurs, regmap-irq.c will traverse all PMIC child interrupts from low index 0 to high index, we give fall interrupt high priority to be called earlier than rise, so that it can be override by late rise event. This can helps to solve key release glitch which make a wrongly fall event immediately after rise. Change-Id: Ieda1d6fd3c50cc36742a4740504ec7ce12ea509b Signed-off-by: Joseph Chen --- include/linux/mfd/rk808.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h index a8f02ff150ee..50cc98f86329 100644 --- a/include/linux/mfd/rk808.h +++ b/include/linux/mfd/rk808.h @@ -491,14 +491,22 @@ enum rk805_reg { #define RK805_PWRON_FALL_RISE_INT_MSK 0x81 /* RK805 IRQ Definitions */ -#define RK805_IRQ_PWRON_RISE 0 #define RK805_IRQ_VB_LOW 1 #define RK805_IRQ_PWRON 2 #define RK805_IRQ_PWRON_LP 3 #define RK805_IRQ_HOTDIE 4 #define RK805_IRQ_RTC_ALARM 5 #define RK805_IRQ_RTC_PERIOD 6 -#define RK805_IRQ_PWRON_FALL 7 + +/* + * When PMIC irq occurs, regmap-irq.c will traverse all PMIC child + * interrupts from low index 0 to high index, we give fall interrupt + * high priority to be called earlier than rise, so that it can be + * override by late rise event. This can helps to solve key release + * glitch which make a wrongly fall event immediately after rise. + */ +#define RK805_IRQ_PWRON_FALL 0 +#define RK805_IRQ_PWRON_RISE 7 #define RK805_IRQ_PWRON_RISE_MSK BIT(0) #define RK805_IRQ_VB_LOW_MSK BIT(1)