All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andy Shevchenko <andy@kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [PATCH v5 1/2] gpio: sch: Add edge event support
Date: Thu, 25 Mar 2021 13:33:04 +0200	[thread overview]
Message-ID: <YFx08OhkBbyXBdZo@smile.fi.intel.com> (raw)
In-Reply-To: <CACRpkdaZwAg4X9QT4QMR2GSH6Cekc7Xuk+-pqhCyON-Y3cnCrA@mail.gmail.com>

On Thu, Mar 25, 2021 at 09:13:51AM +0100, Linus Walleij wrote:
> On Wed, Mar 17, 2021 at 4:19 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > From: Jan Kiszka <jan.kiszka@siemens.com>
> >
> > Add the required infrastructure to enable and report edge events
> > of the pins to the GPIO core. The actual hook-up of the event interrupt
> > will happen separately.
> >
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > Co-developed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> I can't believe it that nobody added irq support to this driver for 10
> years given how widely deployed it is! (Good work.)
> 
> Don't you need to add
> 
> select GPIOLIB_IRQCHIP
> 
> to Kconfig? So the gpio_chip contains the .irq member you're using.

Seems legit, thanks!

> > +       sch->irqchip.name = "sch_gpio";
> > +       sch->irqchip.irq_ack = sch_irq_ack;
> > +       sch->irqchip.irq_mask = sch_irq_mask;
> > +       sch->irqchip.irq_unmask = sch_irq_unmask;
> > +       sch->irqchip.irq_set_type = sch_irq_type;
> > +
> > +       sch->chip.irq.chip = &sch->irqchip;
> > +       sch->chip.irq.num_parents = 0;
> > +       sch->chip.irq.parents = NULL;
> > +       sch->chip.irq.parent_handler = NULL;
> > +       sch->chip.irq.default_type = IRQ_TYPE_NONE;
> > +       sch->chip.irq.handler = handle_bad_irq;
> 
> I always add a local variable like:
> 
> struct gpio_irq_chip *girq;
> 
> And assign with the arrow, so as to make it easier to read:
> 
> girq->parent_handler = NULL
> 
> etc.

OK!

> +/- the above:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks!

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2021-03-25 11:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 15:19 [PATCH v5 0/2] gpio: sch: Interrupt support Andy Shevchenko
2021-03-17 15:19 ` [PATCH v5 1/2] gpio: sch: Add edge event support Andy Shevchenko
2021-03-25  8:13   ` Linus Walleij
2021-03-25 11:33     ` Andy Shevchenko [this message]
2021-03-17 15:19 ` [PATCH v5 2/2] gpio: sch: Hook into ACPI GPE handler to catch GPIO edge events Andy Shevchenko
2021-03-25  8:16   ` Linus Walleij
2021-03-18 12:26 ` [PATCH v5 0/2] gpio: sch: Interrupt support 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=YFx08OhkBbyXBdZo@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=jan.kiszka@siemens.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@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 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.