Re: [PATCH v2 0/4] gpio: deprecate and track the removal of GPIO workarounds for regulators
From: Bartosz Golaszewski
Date: Thu Apr 17 2025 - 15:01:38 EST
On Tue, Apr 15, 2025 at 11:33 PM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
>
> Hi Bartosz,
>
> this caused me to think about a thing:
>
> On Wed, Apr 2, 2025 at 12:05 PM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
>
> > This is bothering me. This is the abstraction reversal I'm talking
> > about. Should the regulator drivers even be concerned about whether
> > they share resources or not?
> (...)
> > The part where "the higher level users want to understand that there
> > is GPIO sharing going on" does not sound correct.
>
> There are precedents for this type of semantic IRQF_SHARED
> is used whenever two devices share the same IRQ line,
> and that is something the drivers have to specify, i.e. the
> driver has to be aware that it may be sharing the IRQ
> with other devices, and whenever it gets an IRQ it has
> to check "was it for me?" and in case it was, return
> IRQ_HANDLED else IRQ_NONE.
>
First: this flag has existed (as SA_SHIRQ) since before git days and
could be considered legacy. But also: it's a bit of a different story
as sometimes you get an interrupt and need to read a specific register
to check from the status bits whether it concerns you. This never
happens with a GPIO so I don't think it's a good argument for this
specific case.
Bartosz