[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfMKmJ074R2-04be0Ag6OuKcY=_xhhbRKsL2D0H8hZZLg@mail.gmail.com>
Date: Tue, 8 Dec 2020 16:19:07 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: "Enrico Weigelt, metux IT consult" <info@...ux.net>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
William Breathitt Gray <vilhelm.gray@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
joyce.ooi@...el.com, Andrew Jeffery <andrew@...id.au>,
Hoan Tran <hoan@...amperecomputing.com>,
Serge Semin <fancer.lancer@...il.com>, orsonzhai@...il.com,
baolin.wang7@...il.com, zhang.lyra@...il.com,
Andy Shevchenko <andy@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Grygorii Strashko <grygorii.strashko@...com>,
Santosh Shilimkar <ssantosh@...nel.org>,
Kevin Hilman <khilman@...nel.org>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Jun Nie <jun.nie@...aro.org>, Shawn Guo <shawnguo@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux OMAP Mailing List <linux-omap@...r.kernel.org>
Subject: Re: [RFC PATCH] RFC: drivers: gpio: helper for generic pin IRQ handling
On Tue, Dec 8, 2020 at 4:14 PM Enrico Weigelt, metux IT consult
<info@...ux.net> wrote:
>
> Many gpio drivers already use gpiolib's builtin irqchip handling
> (CONFIG_GPIOLIB_IRQCHIP), but still has some boilerplate for retrieving
> the actual Linux IRQ number and calling into the generic handler.
> That boilerplate can be reduced by moving that into a helper function.
>
> This is an RFC patch to outline how that could be done. Note: it's
> completely untested yet.
>
> Several drivers still have their completely IRQ own implementation and
> thus can't be converted yet. Some of them perhaps could be changed to
> store their irq domain in the struct gpio, so the new helper could
> also be used for those.
>
> Having all GPIO drivers doing their IRQ management entirely through the
> GPIO subsystem (eg. never calling generic_handle_irq() and using the builtin
> IRQ handling) would also allow a more direct (eg. callback-based) pin change
> notification for GPIO consumers, that doesn't involve registering them as
> generic IRQ handlers.
>
> Further reduction of boilerplate could be achieved by additional helpers
> for common patterns like for_each_set_bit() loops on irq masks.
Have you able to test them all?
As the PCA953x case showed us this is not so simple, besides the name
which sucks — we don't *raise* and IRQ we *handle* it.
NAK.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists