Re: [PATCH dt-schema] schemas: i2c: add optional GPIO binding for SMBALERT# line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rob,

On Mon, Sep 9, 2024 at 3:40 PM Rob Herring <robh@xxxxxxxxxx> wrote:
> On Mon, Sep 9, 2024 at 8:31 AM Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> > On Mon, Sep 9, 2024 at 3:07 PM Rob Herring <robh@xxxxxxxxxx> wrote:
> > > On Mon, Sep 9, 2024 at 5:58 AM Wolfram Sang
> > > <wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
> > > >
> > > > Most I2C controllers do not have a dedicated pin for SMBus Alerts. Allow
> > > > them to define a GPIO as a side-channel.
> > >
> > > Most GPIOs are also interrupts, so shouldn't the existing binding be
> > > sufficient? The exception is if the GPIO needs to be polled.
> >
> > If the GPIO pin supports multiple functions, it must be configured as
> > a GPIO  first. devm_gpiod_get() takes care of that.  Just calling
> > request_irq() does not.  In addition, the mapping from GPIO to IRQ
> > number may not be fixed, e.g. in case the GPIO controller supports
> > less interrupt inputs than GPIOs, and needs to map them when requested.
>
> All sounds like Linux problems...

;-)

> > See also the different handling of interrupts and gpios by gpio-keys.
>
> I believe "gpios" is what was originally supported, but now it is
> preferred if GPIOs are used as interrupts then we use interrupts in
> DT.

You really do not want to use gpio-keys with interrupts, unless you
have no choice.  Some shortcomings are outlined in "[PATCH RFC 3/3]
Input: gpio-keys - Fix ghost events with both-edge irqs" [1].
They do not matter for SMBALERT, though.

[1] https://lore.kernel.org/r/356b31ade897af77a06d6567601f038f56b3b2a2.1638538079.git.geert+renesas@xxxxxxxxx

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds





[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux