From: William Breathitt Gray <william.gray@linaro.org>
To: linux-aspeed@lists.ozlabs.org
Subject: [PATCH 16/17] gpio: pci-idio-16: Convert to immutable irq_chip
Date: Wed, 8 Feb 2023 06:16:44 -0500 [thread overview]
Message-ID: <Y+OEnM/gZ+lLRELc@fedora> (raw)
In-Reply-To: <20230215-immutable-chips-v1-16-51a8f224a5d0@linaro.org>
On Thu, Feb 16, 2023 at 10:37:17AM +0100, Linus Walleij wrote:
> Convert the driver to immutable irq-chip with a bit of
> intuition.
>
> Cc: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
FYI, I'm migrating pci-idio-16 to the regmap-irq API soon, so this patch
might not be necessary once the code is removed. Anyway, here's my ack
in case this patch series is merged first.
Acked-by: William Breathitt Gray <william.gray@linaro.org>
> ---
> drivers/gpio/gpio-pci-idio-16.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-pci-idio-16.c b/drivers/gpio/gpio-pci-idio-16.c
> index a86ce748384b..6726c32e31e6 100644
> --- a/drivers/gpio/gpio-pci-idio-16.c
> +++ b/drivers/gpio/gpio-pci-idio-16.c
> @@ -107,6 +107,8 @@ static void idio_16_irq_mask(struct irq_data *data)
>
> raw_spin_unlock_irqrestore(&idio16gpio->lock, flags);
> }
> +
> + gpiochip_disable_irq(chip, irqd_to_hwirq(data));
> }
>
> static void idio_16_irq_unmask(struct irq_data *data)
> @@ -117,6 +119,8 @@ static void idio_16_irq_unmask(struct irq_data *data)
> const unsigned long prev_irq_mask = idio16gpio->irq_mask;
> unsigned long flags;
>
> + gpiochip_enable_irq(chip, irqd_to_hwirq(data));
> +
> idio16gpio->irq_mask |= mask;
>
> if (!prev_irq_mask) {
> @@ -138,12 +142,14 @@ static int idio_16_irq_set_type(struct irq_data *data, unsigned int flow_type)
> return 0;
> }
>
> -static struct irq_chip idio_16_irqchip = {
> +static const struct irq_chip idio_16_irqchip = {
> .name = "pci-idio-16",
> .irq_ack = idio_16_irq_ack,
> .irq_mask = idio_16_irq_mask,
> .irq_unmask = idio_16_irq_unmask,
> - .irq_set_type = idio_16_irq_set_type
> + .irq_set_type = idio_16_irq_set_type,
> + .flags = IRQCHIP_IMMUTABLE,
> + GPIOCHIP_IRQ_RESOURCE_HELPERS,
> };
>
> static irqreturn_t idio_16_irq_handler(int irq, void *dev_id)
> @@ -242,7 +248,7 @@ static int idio_16_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> idio_16_state_init(&idio16gpio->state);
>
> girq = &idio16gpio->chip.irq;
> - girq->chip = &idio_16_irqchip;
> + gpio_irq_chip_set_chip(girq, &idio_16_irqchip);
> /* This will let us handle the parent IRQ in the driver */
> girq->parent_handler = NULL;
> girq->num_parents = 0;
>
> --
> 2.34.1
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20230208/582a47b3/attachment-0001.sig>
WARNING: multiple messages have this Message-ID (diff)
From: William Breathitt Gray <william.gray@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Mun Yew Tham <mun.yew.tham@intel.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>,
Alban Bedel <albeu@free.fr>, Orson Zhai <orsonzhai@gmail.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Chunyan Zhang <zhang.lyra@gmail.com>,
Jay Fang <f.fangjian@huawei.com>,
Daniel Palmer <daniel@thingy.jp>,
Romain Perier <romain.perier@gmail.com>,
Grygorii Strashko <grygorii.strashko@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-omap@vger.kernel.org,
Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH 16/17] gpio: pci-idio-16: Convert to immutable irq_chip
Date: Wed, 8 Feb 2023 06:16:44 -0500 [thread overview]
Message-ID: <Y+OEnM/gZ+lLRELc@fedora> (raw)
In-Reply-To: <20230215-immutable-chips-v1-16-51a8f224a5d0@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 2411 bytes --]
On Thu, Feb 16, 2023 at 10:37:17AM +0100, Linus Walleij wrote:
> Convert the driver to immutable irq-chip with a bit of
> intuition.
>
> Cc: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
FYI, I'm migrating pci-idio-16 to the regmap-irq API soon, so this patch
might not be necessary once the code is removed. Anyway, here's my ack
in case this patch series is merged first.
Acked-by: William Breathitt Gray <william.gray@linaro.org>
> ---
> drivers/gpio/gpio-pci-idio-16.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-pci-idio-16.c b/drivers/gpio/gpio-pci-idio-16.c
> index a86ce748384b..6726c32e31e6 100644
> --- a/drivers/gpio/gpio-pci-idio-16.c
> +++ b/drivers/gpio/gpio-pci-idio-16.c
> @@ -107,6 +107,8 @@ static void idio_16_irq_mask(struct irq_data *data)
>
> raw_spin_unlock_irqrestore(&idio16gpio->lock, flags);
> }
> +
> + gpiochip_disable_irq(chip, irqd_to_hwirq(data));
> }
>
> static void idio_16_irq_unmask(struct irq_data *data)
> @@ -117,6 +119,8 @@ static void idio_16_irq_unmask(struct irq_data *data)
> const unsigned long prev_irq_mask = idio16gpio->irq_mask;
> unsigned long flags;
>
> + gpiochip_enable_irq(chip, irqd_to_hwirq(data));
> +
> idio16gpio->irq_mask |= mask;
>
> if (!prev_irq_mask) {
> @@ -138,12 +142,14 @@ static int idio_16_irq_set_type(struct irq_data *data, unsigned int flow_type)
> return 0;
> }
>
> -static struct irq_chip idio_16_irqchip = {
> +static const struct irq_chip idio_16_irqchip = {
> .name = "pci-idio-16",
> .irq_ack = idio_16_irq_ack,
> .irq_mask = idio_16_irq_mask,
> .irq_unmask = idio_16_irq_unmask,
> - .irq_set_type = idio_16_irq_set_type
> + .irq_set_type = idio_16_irq_set_type,
> + .flags = IRQCHIP_IMMUTABLE,
> + GPIOCHIP_IRQ_RESOURCE_HELPERS,
> };
>
> static irqreturn_t idio_16_irq_handler(int irq, void *dev_id)
> @@ -242,7 +248,7 @@ static int idio_16_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> idio_16_state_init(&idio16gpio->state);
>
> girq = &idio16gpio->chip.irq;
> - girq->chip = &idio_16_irqchip;
> + gpio_irq_chip_set_chip(girq, &idio_16_irqchip);
> /* This will let us handle the parent IRQ in the driver */
> girq->parent_handler = NULL;
> girq->num_parents = 0;
>
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: William Breathitt Gray <william.gray@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Mun Yew Tham <mun.yew.tham@intel.com>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Joel Stanley <joel@jms.id.au>, Andrew Jeffery <andrew@aj.id.au>,
Alban Bedel <albeu@free.fr>, Orson Zhai <orsonzhai@gmail.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Chunyan Zhang <zhang.lyra@gmail.com>,
Jay Fang <f.fangjian@huawei.com>,
Daniel Palmer <daniel@thingy.jp>,
Romain Perier <romain.perier@gmail.com>,
Grygorii Strashko <grygorii.strashko@ti.com>,
Santosh Shilimkar <ssantosh@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-omap@vger.kernel.org,
Marc Zyngier <maz@kernel.org>
Subject: Re: [PATCH 16/17] gpio: pci-idio-16: Convert to immutable irq_chip
Date: Wed, 8 Feb 2023 06:16:44 -0500 [thread overview]
Message-ID: <Y+OEnM/gZ+lLRELc@fedora> (raw)
In-Reply-To: <20230215-immutable-chips-v1-16-51a8f224a5d0@linaro.org>
[-- Attachment #1.1: Type: text/plain, Size: 2411 bytes --]
On Thu, Feb 16, 2023 at 10:37:17AM +0100, Linus Walleij wrote:
> Convert the driver to immutable irq-chip with a bit of
> intuition.
>
> Cc: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
FYI, I'm migrating pci-idio-16 to the regmap-irq API soon, so this patch
might not be necessary once the code is removed. Anyway, here's my ack
in case this patch series is merged first.
Acked-by: William Breathitt Gray <william.gray@linaro.org>
> ---
> drivers/gpio/gpio-pci-idio-16.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-pci-idio-16.c b/drivers/gpio/gpio-pci-idio-16.c
> index a86ce748384b..6726c32e31e6 100644
> --- a/drivers/gpio/gpio-pci-idio-16.c
> +++ b/drivers/gpio/gpio-pci-idio-16.c
> @@ -107,6 +107,8 @@ static void idio_16_irq_mask(struct irq_data *data)
>
> raw_spin_unlock_irqrestore(&idio16gpio->lock, flags);
> }
> +
> + gpiochip_disable_irq(chip, irqd_to_hwirq(data));
> }
>
> static void idio_16_irq_unmask(struct irq_data *data)
> @@ -117,6 +119,8 @@ static void idio_16_irq_unmask(struct irq_data *data)
> const unsigned long prev_irq_mask = idio16gpio->irq_mask;
> unsigned long flags;
>
> + gpiochip_enable_irq(chip, irqd_to_hwirq(data));
> +
> idio16gpio->irq_mask |= mask;
>
> if (!prev_irq_mask) {
> @@ -138,12 +142,14 @@ static int idio_16_irq_set_type(struct irq_data *data, unsigned int flow_type)
> return 0;
> }
>
> -static struct irq_chip idio_16_irqchip = {
> +static const struct irq_chip idio_16_irqchip = {
> .name = "pci-idio-16",
> .irq_ack = idio_16_irq_ack,
> .irq_mask = idio_16_irq_mask,
> .irq_unmask = idio_16_irq_unmask,
> - .irq_set_type = idio_16_irq_set_type
> + .irq_set_type = idio_16_irq_set_type,
> + .flags = IRQCHIP_IMMUTABLE,
> + GPIOCHIP_IRQ_RESOURCE_HELPERS,
> };
>
> static irqreturn_t idio_16_irq_handler(int irq, void *dev_id)
> @@ -242,7 +248,7 @@ static int idio_16_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> idio_16_state_init(&idio16gpio->state);
>
> girq = &idio16gpio->chip.irq;
> - girq->chip = &idio_16_irqchip;
> + gpio_irq_chip_set_chip(girq, &idio_16_irqchip);
> /* This will let us handle the parent IRQ in the driver */
> girq->parent_handler = NULL;
> girq->num_parents = 0;
>
> --
> 2.34.1
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-02-08 11:16 UTC|newest]
Thread overview: 88+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-16 9:37 [PATCH 00/17] Mass convert GPIO IRQ chips to be immutable Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 01/17] gpio: altera: Convert to immutable irq_chip Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 02/17] gpio: adnp: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 03/17] gpio: aspeed: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-27 0:44 ` Joel Stanley
2023-02-27 0:44 ` Joel Stanley
2023-02-27 0:44 ` Joel Stanley
2023-02-16 9:37 ` [PATCH 04/17] gpio: aspeed-sgpio: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 05/17] gpio: ath79: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 06/17] gpio: cadence: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 07/17] gpio: eic_sprd: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-17 3:36 ` Cixi Geng
2023-02-16 9:37 ` [PATCH 08/17] gpio: hisi: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 09/17] gpio: hlwd: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 10/17] gpio: idt3243x: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-17 13:28 ` Thomas Bogendoerfer
2023-02-17 13:28 ` Thomas Bogendoerfer
2023-02-17 13:28 ` Thomas Bogendoerfer
2023-02-16 9:37 ` [PATCH 11/17] gpio: msc313: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 12/17] gpio: mlxbf2: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 13/17] gpio: max732x: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` [PATCH 14/17] gpio: omap: Drop irq_base Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-17 5:58 ` Tony Lindgren
2023-02-17 5:58 ` Tony Lindgren
2023-02-17 5:58 ` Tony Lindgren
2023-02-16 9:37 ` [PATCH 15/17] gpio: omap: Convert to immutable irq_chip Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-17 7:49 ` Tony Lindgren
2023-02-17 7:49 ` Tony Lindgren
2023-02-17 7:49 ` Tony Lindgren
2023-02-17 16:31 ` Andreas Kemnade
2023-02-17 16:31 ` Andreas Kemnade
2023-02-17 16:31 ` Andreas Kemnade
2023-03-06 7:28 ` Tony Lindgren
2023-03-06 7:28 ` Tony Lindgren
2023-03-06 7:28 ` Tony Lindgren
2023-03-06 7:31 ` Tony Lindgren
2023-03-06 7:31 ` Tony Lindgren
2023-03-06 7:31 ` Tony Lindgren
2023-02-16 9:37 ` [PATCH 16/17] gpio: pci-idio-16: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-08 11:16 ` William Breathitt Gray [this message]
2023-02-08 11:16 ` William Breathitt Gray
2023-02-08 11:16 ` William Breathitt Gray
2023-02-16 9:37 ` [PATCH 17/17] gpio: pcie-idio-24: " Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-16 9:37 ` Linus Walleij
2023-02-08 11:17 ` William Breathitt Gray
2023-02-08 11:17 ` William Breathitt Gray
2023-02-08 11:17 ` William Breathitt Gray
2023-02-16 10:47 ` [PATCH 00/17] Mass convert GPIO IRQ chips to be immutable Marc Zyngier
2023-02-16 10:47 ` Marc Zyngier
2023-02-16 10:47 ` Marc Zyngier
2023-02-17 6:02 ` Tony Lindgren
2023-02-17 6:02 ` Tony Lindgren
2023-02-17 6:02 ` Tony Lindgren
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=Y+OEnM/gZ+lLRELc@fedora \
--to=william.gray@linaro.org \
--cc=linux-aspeed@lists.ozlabs.org \
/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.