linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Protsenko <semen.protsenko@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH] gpio: max732x: Use irqchip template
Date: Sun, 19 Jul 2020 19:34:23 +0300	[thread overview]
Message-ID: <CAPLW+4kX_1YNDNNeqzQGHZmnr0PYKHsrN++jw9-jOYv6Da3UuQ@mail.gmail.com> (raw)
In-Reply-To: <20200717141924.57887-1-linus.walleij@linaro.org>

Hi Linus,

On Fri, 17 Jul 2020 at 17:19, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> This makes the driver use the irqchip template to assign
> properties to the gpio_irq_chip instead of using the
> explicit calls to gpiochip_irqchip_add_nested() and
> gpiochip_set_nested_irqchip(). The irqchip is instead
> added while adding the gpiochip.
>
> Cc: Sam Protsenko <semen.protsenko@linaro.org>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---

I can test it on my MAX7325 board with BeagleBone Black in a day or
two. Do you want me to verify your patch on top of linux-mainline or
linux-next? Also, is there any specific stuff you want me to look at,
or making sure there are no regressions w.r.t. IRQ from the chip is
enough?

Thanks!

>  drivers/gpio/gpio-max732x.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
> index 63472f308857..347415344a20 100644
> --- a/drivers/gpio/gpio-max732x.c
> +++ b/drivers/gpio/gpio-max732x.c
> @@ -503,6 +503,8 @@ static int max732x_irq_setup(struct max732x_chip *chip,
>
>         if (((pdata && pdata->irq_base) || client->irq)
>                         && has_irq != INT_NONE) {
> +               struct gpio_irq_chip *girq;
> +
>                 if (pdata)
>                         irq_base = pdata->irq_base;
>                 chip->irq_features = has_irq;
> @@ -517,19 +519,17 @@ static int max732x_irq_setup(struct max732x_chip *chip,
>                                 client->irq);
>                         return ret;
>                 }
> -               ret =  gpiochip_irqchip_add_nested(&chip->gpio_chip,
> -                                                  &max732x_irq_chip,
> -                                                  irq_base,
> -                                                  handle_simple_irq,
> -                                                  IRQ_TYPE_NONE);
> -               if (ret) {
> -                       dev_err(&client->dev,
> -                               "could not connect irqchip to gpiochip\n");
> -                       return ret;
> -               }
> -               gpiochip_set_nested_irqchip(&chip->gpio_chip,
> -                                           &max732x_irq_chip,
> -                                           client->irq);
> +
> +               girq = &chip->gpio_chip.irq;
> +               girq->chip = &max732x_irq_chip;
> +               /* This will let us handle the parent IRQ in the driver */
> +               girq->parent_handler = NULL;
> +               girq->num_parents = 0;
> +               girq->parents = NULL;
> +               girq->default_type = IRQ_TYPE_NONE;
> +               girq->handler = handle_simple_irq;
> +               girq->threaded = true;
> +               girq->first = irq_base; /* FIXME: get rid of this */
>         }
>
>         return 0;
> --
> 2.26.2
>

  reply	other threads:[~2020-07-19 16:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 14:19 [PATCH] gpio: max732x: Use irqchip template Linus Walleij
2020-07-19 16:34 ` Sam Protsenko [this message]
2020-07-21  9:54   ` Linus Walleij
2020-07-24 10:50     ` Sam Protsenko
2020-07-24 19:47       ` Andy Shevchenko

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=CAPLW+4kX_1YNDNNeqzQGHZmnr0PYKHsrN++jw9-jOYv6Da3UuQ@mail.gmail.com \
    --to=semen.protsenko@linaro.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.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 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).