[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1629435488-10228-8-git-send-email-quic_fenglinw@quicinc.com>
Date: Fri, 20 Aug 2021 12:58:02 +0800
From: Fenglin Wu <quic_fenglinw@...cinc.com>
To: <linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<sboyd@...nel.org>
CC: <collinsd@...eaurora.org>, <subbaram@...eaurora.org>,
<quic_fenglinw@...cinc.com>, Yimin Peng <yiminp@...eaurora.org>
Subject: [PATCH V1 7/9] spmi: pmic-arb: support updating interrupt type flags
From: Yimin Peng <yiminp@...eaurora.org>
Have the qpnpint_irq_set_type function clear unwanted high/low
trigger bits when updating the interrupt flags.
Signed-off-by: Yimin Peng <yiminp@...eaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@...eaurora.org>
Signed-off-by: Fenglin Wu <quic_fenglinw@...cinc.com>
---
drivers/spmi/spmi-pmic-arb.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index 9239830..988204c 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -636,8 +636,12 @@ static int qpnpint_irq_set_type(struct irq_data *d, unsigned int flow_type)
type.type |= BIT(irq);
if (flow_type & IRQF_TRIGGER_RISING)
type.polarity_high |= BIT(irq);
+ else
+ type.polarity_high &= ~BIT(irq);
if (flow_type & IRQF_TRIGGER_FALLING)
type.polarity_low |= BIT(irq);
+ else
+ type.polarity_low &= ~BIT(irq);
flow_handler = handle_edge_irq;
} else {
@@ -646,10 +650,13 @@ static int qpnpint_irq_set_type(struct irq_data *d, unsigned int flow_type)
return -EINVAL;
type.type &= ~BIT(irq); /* level trig */
- if (flow_type & IRQF_TRIGGER_HIGH)
+ if (flow_type & IRQF_TRIGGER_HIGH) {
type.polarity_high |= BIT(irq);
- else
+ type.polarity_low &= ~BIT(irq);
+ } else {
type.polarity_low |= BIT(irq);
+ type.polarity_high &= ~BIT(irq);
+ }
flow_handler = handle_level_irq;
}
--
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
Powered by blists - more mailing lists