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

Geert Uytterhoeven <[email protected]>
Newsgroups org.kernel.vger.devicetree-spec,org.kernel.vger.linux-i2c,org.kernel.vger.linux-renesas-soc
Message-ID <CAMuHMdWGtuAuQ3M3HonY8zfODTTz_izV6g9555iwuPLSY+P9_g@mail.gmail.com>
Hi Rob,

On Mon, Sep 9, 2024 at 3:07 PM Rob Herring <[email protected]> wrote:
> On Mon, Sep 9, 2024 at 5:58 AM Wolfram Sang
> <[email protected]> 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.

See also the different handling of interrupts and gpios by gpio-keys.

> > --- a/dtschema/schemas/i2c/i2c-controller.yaml
> > +++ b/dtschema/schemas/i2c/i2c-controller.yaml
> > @@ -135,6 +135,11 @@ properties:
> >        use this information to detect a stalled bus more reliably, for example.
> >        Can not be combined with 'multi-master'.
> >
> > +  smbalert-gpios:
> > +    maxItems: 1
> > +    description:
> > +      Specifies the GPIO used for the SMBALERT# line. Optional.
> > +
> >    smbus:
> >      type: boolean
> >      description:

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.