2021-03-11 00:44:02

by Guru Das Srinagesh

[permalink] [raw]
Subject: [RFC PATCH v3 3/3] regmap-irq: Modify type_buf handling for IRQ_TYPE_LEVEL_*

In order to configure LEVEL_HIGH and LEVEL_LOW for QCOM's type
registers, the bit corresponding to the interrupt must be cleared.

Therefore, in QCOM's case, the type_*_val are all to be configured as
BIT() masks.

Quite clearly, this is a fundamental change, and am looking for feedback
on whether and how this may be handled in a generic manner.

Signed-off-by: Guru Das Srinagesh <[email protected]>
---
drivers/base/regmap/regmap-irq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index cb13855..c70ef90 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -327,11 +327,11 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type)
break;

case IRQ_TYPE_LEVEL_HIGH:
- d->type_buf[reg] |= t->type_level_high_val;
+ d->type_buf[reg] &= t->type_level_high_val;
break;

case IRQ_TYPE_LEVEL_LOW:
- d->type_buf[reg] |= t->type_level_low_val;
+ d->type_buf[reg] &= t->type_level_low_val;
break;
default:
return -EINVAL;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project