From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
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>,
William Breathitt Gray <william.gray@linaro.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 10/17] gpio: idt3243x: Convert to immutable irq_chip
Date: Fri, 17 Feb 2023 14:28:16 +0100 [thread overview]
Message-ID: <20230217132816.GA9335@alpha.franken.de> (raw)
In-Reply-To: <20230215-immutable-chips-v1-10-51a8f224a5d0@linaro.org>
On Thu, Feb 16, 2023 at 10:37:11AM +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>
> ---
> drivers/gpio/gpio-idt3243x.c | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpio/gpio-idt3243x.c b/drivers/gpio/gpio-idt3243x.c
> index 1cafdf46f875..00f547d26254 100644
> --- a/drivers/gpio/gpio-idt3243x.c
> +++ b/drivers/gpio/gpio-idt3243x.c
> @@ -92,6 +92,8 @@ static void idt_gpio_mask(struct irq_data *d)
> writel(ctrl->mask_cache, ctrl->pic + IDT_PIC_IRQ_MASK);
>
> raw_spin_unlock_irqrestore(&gc->bgpio_lock, flags);
> +
> + gpiochip_disable_irq(gc, irqd_to_hwirq(d));
> }
>
> static void idt_gpio_unmask(struct irq_data *d)
> @@ -100,6 +102,7 @@ static void idt_gpio_unmask(struct irq_data *d)
> struct idt_gpio_ctrl *ctrl = gpiochip_get_data(gc);
> unsigned long flags;
>
> + gpiochip_enable_irq(gc, irqd_to_hwirq(d));
> raw_spin_lock_irqsave(&gc->bgpio_lock, flags);
>
> ctrl->mask_cache &= ~BIT(d->hwirq);
> @@ -119,12 +122,14 @@ static int idt_gpio_irq_init_hw(struct gpio_chip *gc)
> return 0;
> }
>
> -static struct irq_chip idt_gpio_irqchip = {
> +static const struct irq_chip idt_gpio_irqchip = {
> .name = "IDTGPIO",
> .irq_mask = idt_gpio_mask,
> .irq_ack = idt_gpio_ack,
> .irq_unmask = idt_gpio_unmask,
> - .irq_set_type = idt_gpio_irq_set_type
> + .irq_set_type = idt_gpio_irq_set_type,
> + .flags = IRQCHIP_IMMUTABLE,
> + GPIOCHIP_IRQ_RESOURCE_HELPERS,
> };
>
> static int idt_gpio_probe(struct platform_device *pdev)
> @@ -168,7 +173,7 @@ static int idt_gpio_probe(struct platform_device *pdev)
> return parent_irq;
>
> girq = &ctrl->gc.irq;
> - girq->chip = &idt_gpio_irqchip;
> + gpio_irq_chip_set_chip(girq, &idt_gpio_irqchip);
> girq->init_hw = idt_gpio_irq_init_hw;
> girq->parent_handler = idt_gpio_dispatch;
> girq->num_parents = 1;
>
> --
> 2.34.1
Tested-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
_______________________________________________
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-17 14:35 UTC|newest]
Thread overview: 29+ 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 ` [PATCH 01/17] gpio: altera: Convert to immutable irq_chip Linus Walleij
2023-02-16 9:37 ` [PATCH 02/17] gpio: adnp: " Linus Walleij
2023-02-16 9:37 ` [PATCH 03/17] gpio: aspeed: " Linus Walleij
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 ` [PATCH 05/17] gpio: ath79: " Linus Walleij
2023-02-16 9:37 ` [PATCH 06/17] gpio: cadence: " Linus Walleij
2023-02-16 9:37 ` [PATCH 07/17] gpio: eic_sprd: " Linus Walleij
2023-02-16 9:37 ` [PATCH 08/17] gpio: hisi: " Linus Walleij
2023-02-16 9:37 ` [PATCH 09/17] gpio: hlwd: " Linus Walleij
2023-02-16 9:37 ` [PATCH 10/17] gpio: idt3243x: " Linus Walleij
2023-02-17 13:28 ` Thomas Bogendoerfer [this message]
2023-02-16 9:37 ` [PATCH 11/17] gpio: msc313: " Linus Walleij
2023-02-16 9:37 ` [PATCH 12/17] gpio: mlxbf2: " Linus Walleij
2023-02-16 9:37 ` [PATCH 13/17] gpio: max732x: " Linus Walleij
2023-02-16 9:37 ` [PATCH 14/17] gpio: omap: Drop irq_base Linus Walleij
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-17 7:49 ` Tony Lindgren
2023-02-17 16:31 ` Andreas Kemnade
2023-03-06 7:28 ` 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-08 11:16 ` William Breathitt Gray
2023-02-16 9:37 ` [PATCH 17/17] gpio: pcie-idio-24: " Linus Walleij
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-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=20230217132816.GA9335@alpha.franken.de \
--to=tsbogend@alpha.franken.de \
--cc=albeu@free.fr \
--cc=andrew@aj.id.au \
--cc=baolin.wang@linux.alibaba.com \
--cc=brgl@bgdev.pl \
--cc=daniel@thingy.jp \
--cc=f.fangjian@huawei.com \
--cc=grygorii.strashko@ti.com \
--cc=joel@jms.id.au \
--cc=khilman@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=maz@kernel.org \
--cc=mun.yew.tham@intel.com \
--cc=orsonzhai@gmail.com \
--cc=romain.perier@gmail.com \
--cc=ssantosh@kernel.org \
--cc=william.gray@linaro.org \
--cc=zhang.lyra@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).