[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220119070809.15563-4-qianggui.song@amlogic.com>
Date: Wed, 19 Jan 2022 15:08:08 +0800
From: Qianggui Song <qianggui.song@...ogic.com>
To: Thomas Gleixner <tglx@...utronix.de>, Marc Zyngier <maz@...nel.org>
CC: Qianggui Song <qianggui.song@...ogic.com>,
Kevin Hilman <khilman@...libre.com>,
Neil Armstrong <narmstrong@...libre.com>,
Jerome Brunet <jbrunet@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-amlogic@...ts.infradead.org>
Subject: [PATCH v2 3/4] irqchip/meson-gpio: add select trigger type callback
Due to some chips may use different registers and offset, provide
a set trigger type call back.
Signed-off-by: Qianggui Song <qianggui.song@...ogic.com>
---
drivers/irqchip/irq-meson-gpio.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/irqchip/irq-meson-gpio.c b/drivers/irqchip/irq-meson-gpio.c
index eefe15e1b3a6..b511f9532adc 100644
--- a/drivers/irqchip/irq-meson-gpio.c
+++ b/drivers/irqchip/irq-meson-gpio.c
@@ -55,6 +55,8 @@ struct irq_ctl_ops {
void (*gpio_irq_sel_pin)(struct meson_gpio_irq_controller *ctl,
unsigned int channel, unsigned long hwirq);
void (*gpio_irq_init)(struct meson_gpio_irq_controller *ctl);
+ void (*gpio_irq_sel_type)(struct meson_gpio_irq_controller *ctl,
+ unsigned int idx, u32 val);
};
struct meson_gpio_irq_params {
@@ -278,6 +280,12 @@ static int meson_gpio_irq_type_setup(struct meson_gpio_irq_controller *ctl,
*/
type &= IRQ_TYPE_SENSE_MASK;
+ /* Some controllers may have different calculation method*/
+ if (params->ops.gpio_irq_sel_type) {
+ params->ops.gpio_irq_sel_type(ctl, idx, type);
+ return 0;
+ }
+
/*
* New controller support EDGE_BOTH trigger. This setting takes
* precedence over the other edge/polarity settings
--
2.34.1
Powered by blists - more mailing lists