From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Martyn Welch <martyn.welch@collabora.co.uk>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Martyn Welch <martyn.welch@collabora.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/5] dt-bindings: gpio: pca95xx: add entry for pcal6534 and PI4IOE5V6534Q
Date: Tue, 6 Sep 2022 16:53:03 +0300 [thread overview]
Message-ID: <YxdQv99FoFNx+11c@smile.fi.intel.com> (raw)
In-Reply-To: <CACRpkdaQ+0wbreyCEaoBnjKT0rtgPEnotZQw_Eh=y4xktwrwHQ@mail.gmail.com>
On Tue, Sep 06, 2022 at 03:33:34PM +0200, Linus Walleij wrote:
> On Tue, Sep 6, 2022 at 3:20 PM Andy Shevchenko
> <andriy.shevchenko@intel.com> wrote:
> > On Tue, Sep 06, 2022 at 03:08:00PM +0200, Linus Walleij wrote:
> > > On Tue, Sep 6, 2022 at 2:19 PM Andy Shevchenko
> > > <andriy.shevchenko@intel.com> wrote:
> > > > On Tue, Sep 06, 2022 at 09:28:16AM +0100, Martyn Welch wrote:
...
> > > > > + oneOf:
> > > > > + - items:
> > > > > + - const: diodes,pi4ioe5v6534q
> > > > > + - const: nxp,pcal6534
> > > >
> > > > ^^^
> > > >
> > > > > + - items:
> > > > > + - enum:
> > > >
> > > > > + - nxp,pcal6534
> > > >
> > > > ^^^
> > > >
> > > > Not sure why is this dup?
> > >
> > > No that is how DT compatibles work. One version of the component,
> > > bought from NXP will look like this:
> > >
> > > compatible = "nxp,pcal6534";
> > >
> > > Another version bought from diodes will look like this:
> > >
> > > compatible = "diodes,pi4ioe5v6534q", "nxp,pcal6534";
> > >
> > > Then the drivers are probed matching from left to right,
> > > with the "most compatible" matching first.
> > >
> > > This also answers your question on the implementation.
> >
> > Then I don't understand why the const list above is only for new chips
> > and not for the old one where the same can be applied.
>
> That's YAML. It's because the const list is the most compact way
> to express two precise items following after each other, and the enum
> list is an implicit list of single-item const:s, as you cannot enum
> tuples.
This makes a lot of sense, thank you for explaining this. Indeed, now I
understand the absence of Diodes in the code.
> > Mysterious ways of DT...
>
> It's not DT, it's YAML that is mysterious. DT itself is a pretty
> straight-forward
> grammar, while YAML is a meta-grammar describing the DT grammar
> (ML stands for Meta Language).
>
> All meta languages are mysterious.
Yeah :-)
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2022-09-06 14:31 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-06 8:28 [PATCH v2 1/5] dt-bindings: vendor-prefixes: add Diodes Martyn Welch
2022-09-06 8:28 ` [PATCH v2 2/5] dt-bindings: gpio: pca95xx: add entry for pcal6534 and PI4IOE5V6534Q Martyn Welch
2022-09-06 8:37 ` Krzysztof Kozlowski
2022-09-06 12:19 ` Andy Shevchenko
2022-09-06 13:08 ` Linus Walleij
2022-09-06 13:19 ` Andy Shevchenko
2022-09-06 13:33 ` Linus Walleij
2022-09-06 13:53 ` Andy Shevchenko [this message]
2022-09-06 14:19 ` Rob Herring
2022-09-06 14:31 ` Andy Shevchenko
2022-09-06 13:05 ` Linus Walleij
2022-09-06 13:40 ` Rob Herring
2022-09-06 8:28 ` [PATCH v2 3/5] gpio: pca953x: Fix pca953x_gpio_set_pull_up_down() Martyn Welch
2022-09-06 8:28 ` [PATCH v2 4/5] gpio: pca953x: Swap if statements to save later complexity Martyn Welch
2022-09-06 8:28 ` [PATCH v2 5/5] gpio: pca953x: Add support for PCAL6534 Martyn Welch
2022-09-06 12:24 ` Andy Shevchenko
2022-09-06 14:01 ` Martyn Welch
2022-09-06 14:28 ` Andy Shevchenko
2022-09-09 13:27 ` [PATCH v2 1/5] dt-bindings: vendor-prefixes: add Diodes Bartosz Golaszewski
2022-09-09 13:28 ` Bartosz Golaszewski
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=YxdQv99FoFNx+11c@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=brgl@bgdev.pl \
--cc=devicetree@vger.kernel.org \
--cc=krzk@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martyn.welch@collabora.co.uk \
--cc=martyn.welch@collabora.com \
--cc=robh+dt@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox