From: Thomas Gleixner <tglx@linutronix.de>
To: Xianwei Zhao via B4 Relay
<devnull+xianwei.zhao.amlogic.com@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Heiner Kallweit <hkallweit1@gmail.com>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org,
Xianwei Zhao <xianwei.zhao@amlogic.com>
Subject: Re: [PATCH 2/4] irqchip: Add support for Amlogic A4 and A5 SoCs
Date: Fri, 21 Feb 2025 10:07:21 +0100 [thread overview]
Message-ID: <87o6yvhdiu.ffs@tglx> (raw)
In-Reply-To: <20250219-irqchip-gpio-a4-a5-v1-2-3c8e44ae42df@amlogic.com>
On Wed, Feb 19 2025 at 15:29, Xianwei Zhao via wrote:
>
> +static int meson_ao_gpio_irq_set_type(struct meson_gpio_irq_controller *ctl,
> + unsigned int type, u32 *channel_hwirq)
> +{
> + u32 val = 0;
> + unsigned int idx;
> +
> + idx = meson_gpio_irq_get_channel_idx(ctl, channel_hwirq);
> +
> + type &= IRQ_TYPE_SENSE_MASK;
> +
> + meson_gpio_irq_update_bits(ctl, REG_EDGE_POL_AO, BIT(idx), 0);
> +
> + if (type == IRQ_TYPE_EDGE_BOTH) {
> + val |= BIT(ctl->params->edge_both_offset + (idx));
> + meson_gpio_irq_update_bits(ctl, REG_EDGE_POL_AO,
> + BIT(ctl->params->edge_both_offset + (idx)), val);
> + return 0;
> + }
> +
> + if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_EDGE_FALLING))
> + val |= BIT(ctl->params->pol_low_offset + idx);
> +
> + if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
> + val |= BIT(ctl->params->edge_single_offset + idx);
> +
> + meson_gpio_irq_update_bits(ctl, REG_EDGE_POL,
> + BIT(idx) | BIT(12 + idx), val);
> +
> + return 0;
> +};
This function is a full copy of meson_s4_gpio_irq_set_type() with the
only difference of:
s/REG_EDGE_POL_S4/REG_EDGE_POL_AO/
Can you please stick that register offset into the parameter structure
and use the function for both variants?
Thanks,
tglx
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Gleixner <tglx@linutronix.de>
To: Xianwei Zhao via B4 Relay
<devnull+xianwei.zhao.amlogic.com@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Heiner Kallweit <hkallweit1@gmail.com>
Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org,
Xianwei Zhao <xianwei.zhao@amlogic.com>
Subject: Re: [PATCH 2/4] irqchip: Add support for Amlogic A4 and A5 SoCs
Date: Fri, 21 Feb 2025 10:07:21 +0100 [thread overview]
Message-ID: <87o6yvhdiu.ffs@tglx> (raw)
In-Reply-To: <20250219-irqchip-gpio-a4-a5-v1-2-3c8e44ae42df@amlogic.com>
On Wed, Feb 19 2025 at 15:29, Xianwei Zhao via wrote:
>
> +static int meson_ao_gpio_irq_set_type(struct meson_gpio_irq_controller *ctl,
> + unsigned int type, u32 *channel_hwirq)
> +{
> + u32 val = 0;
> + unsigned int idx;
> +
> + idx = meson_gpio_irq_get_channel_idx(ctl, channel_hwirq);
> +
> + type &= IRQ_TYPE_SENSE_MASK;
> +
> + meson_gpio_irq_update_bits(ctl, REG_EDGE_POL_AO, BIT(idx), 0);
> +
> + if (type == IRQ_TYPE_EDGE_BOTH) {
> + val |= BIT(ctl->params->edge_both_offset + (idx));
> + meson_gpio_irq_update_bits(ctl, REG_EDGE_POL_AO,
> + BIT(ctl->params->edge_both_offset + (idx)), val);
> + return 0;
> + }
> +
> + if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_EDGE_FALLING))
> + val |= BIT(ctl->params->pol_low_offset + idx);
> +
> + if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
> + val |= BIT(ctl->params->edge_single_offset + idx);
> +
> + meson_gpio_irq_update_bits(ctl, REG_EDGE_POL,
> + BIT(idx) | BIT(12 + idx), val);
> +
> + return 0;
> +};
This function is a full copy of meson_s4_gpio_irq_set_type() with the
only difference of:
s/REG_EDGE_POL_S4/REG_EDGE_POL_AO/
Can you please stick that register offset into the parameter structure
and use the function for both variants?
Thanks,
tglx
next prev parent reply other threads:[~2025-02-21 9:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-19 7:29 [PATCH 0/4] Add GPIO interrupt support for Amlogic A4 and A5 SoCs Xianwei Zhao
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
2025-02-19 7:29 ` [PATCH 1/4] dt-bindings: interrupt-controller: Add " Xianwei Zhao
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
2025-02-21 21:08 ` Rob Herring
2025-02-21 21:08 ` Rob Herring
2025-02-24 1:57 ` Xianwei Zhao
2025-02-24 1:57 ` Xianwei Zhao
2025-02-19 7:29 ` [PATCH 2/4] irqchip: " Xianwei Zhao
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
2025-02-21 9:07 ` Thomas Gleixner [this message]
2025-02-21 9:07 ` Thomas Gleixner
2025-02-21 9:40 ` Xianwei Zhao
2025-02-21 9:40 ` Xianwei Zhao
2025-02-19 7:29 ` [PATCH 3/4] arm64: dts: Add gpio_intc node for Amlogic-A4 SoCs Xianwei Zhao
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
2025-02-19 7:29 ` [PATCH 4/4] arm64: dts: Add gpio_intc node for Amlogic-A5 SoCs Xianwei Zhao
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
2025-02-19 7:29 ` Xianwei Zhao via B4 Relay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o6yvhdiu.ffs@tglx \
--to=tglx@linutronix.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=devnull+xianwei.zhao.amlogic.com@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.org \
--cc=xianwei.zhao@amlogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.