From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Prathamesh Shete <pshete@nvidia.com>,
jonathanh@nvidia.com, linus.walleij@linaro.org,
robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
devicetree@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-gpio@vger.kernel.org, smangipudi@nvidia.com
Subject: Re: [PATCH 1/3] dt-bindings: pinctrl: tegra234: Add DT binding doc
Date: Wed, 8 Feb 2023 12:57:50 +0100 [thread overview]
Message-ID: <9e7e1762-1c2e-28cd-c7a7-b0577addf51e@linaro.org> (raw)
In-Reply-To: <Y+OGdMFQkL9Dtaq/@orome>
On 08/02/2023 12:24, Thierry Reding wrote:
> On Tue, Feb 07, 2023 at 04:33:08PM +0100, Krzysztof Kozlowski wrote:
>>> + type: object
>>> + additionalProperties:
>>> + properties:
>>> + nvidia,pins:
>>> + description: An array of strings. Each string contains the name
>>> + of a pin or group. Valid values for these names are listed
>>> + below.
>>
>> Define properties in top level, which points to the complexity of your
>> if-else, thus probably this should be split into two bindings. Dunno,
>> your other bindings repeat this pattern :(
>
> The property itself is already defined in the common schema found in
> nvidia,tegra-pinmux-common.yaml and we're overriding this here for each
> instance since each has its own set of pins.
>
> This was a compromise to avoid too many bindings. Originally I attempted
> to roll all Tegra pinctrl bindings into a single dt-schema, but that
> turned out truly horrible =) Splitting this into per-SoC bindings is
> already causing a lot of duplication in these files,
What would be duplicated? Almost eveerything should be coming from
shared binding, so you will have only compatible,
patternProperties(pinmux) and nvidia,pins. And an example. Maybe I miss
something but I would say this would create many but very easy to read
bindings, referencing common pieces.
> though splitting
> off the common bits into nvidi,tegra-pinmux-common.yaml helps a bit with
> that already. Splitting this into per-instance bindings would
> effectively duplicate everything but the pin array here, so we kind of
> settled on this compromise for Tegra194.
OK, but are you sure it is now readable? You have if:then: with
patternProperties: with additionalProperties: with properties: with
nvidia,pins.
>
> We're taking a bit of a shortcut here already, since technically not all
> pins support all the functions listed above. On the other hand, fully
> accurately describing per-pin functions would make this a total mess, so
> again, we use this simplified representation as a compromise.
That's okay, many platforms do the same way.
(...)
>>> +
>>> + pex_rst_c5_out_state: pinmux-pex-rst-c5-out {
>>> + pex_rst {
>>
>> Underscores are not valid in node names.
>
> We have supported underscore in older bindings for historical reasons.
> But I suppose for these newer bindings we could disallow them.
>
> Some of the older DTs have a large number of underscores, so I'm not
> sure it makes sense to go back and fix those. Maybe something to keep in
> mind for when we're done with all the conversions...
I understand, up to you. I think that if such older platform is still
supported/maintained/used, then such cleanups are positive. Underscores
are reported by dtc at W=2, so it is not that critical. But many other
nits like generic node names are being enforced by dtschema, thus if you
want to achieve 0-warning state, at some point you will need to address
these. Of course different question is on what tasks you want to spend
your time. :)
Best regards,
Krzysztof
next prev parent reply other threads:[~2023-02-08 11:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 11:56 [PATCH 1/3] dt-bindings: pinctrl: tegra234: Add DT binding doc Prathamesh Shete
2023-02-07 11:56 ` [PATCH 2/3] pinctrl: tegra: Add Tegra234 pinmux driver Prathamesh Shete
2023-02-07 11:56 ` [PATCH 3/3] arm64: tegra: Add Tegra234 pinmux device Prathamesh Shete
2023-02-07 15:33 ` Krzysztof Kozlowski
2023-02-08 11:00 ` Thierry Reding
2023-02-08 12:01 ` Krzysztof Kozlowski
2023-02-08 12:06 ` Krzysztof Kozlowski
2023-02-08 15:46 ` Thierry Reding
2023-02-07 14:37 ` [PATCH 1/3] dt-bindings: pinctrl: tegra234: Add DT binding doc Rob Herring
2023-02-08 11:29 ` Thierry Reding
2023-02-07 15:33 ` Krzysztof Kozlowski
2023-02-08 11:24 ` Thierry Reding
2023-02-08 11:57 ` Krzysztof Kozlowski [this message]
2023-03-08 11:45 ` Prathamesh Shete
2023-03-08 12:24 ` Krzysztof Kozlowski
2023-03-23 14:11 ` Thierry Reding
2023-03-26 12:19 ` Krzysztof Kozlowski
2023-03-28 12:39 ` Thierry Reding
2023-03-30 13:58 ` Krzysztof Kozlowski
2023-03-30 16:32 ` Thierry Reding
2023-04-20 17:06 ` Thierry Reding
2023-04-20 17:16 ` Krzysztof Kozlowski
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=9e7e1762-1c2e-28cd-c7a7-b0577addf51e@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=jonathanh@nvidia.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=pshete@nvidia.com \
--cc=robh+dt@kernel.org \
--cc=smangipudi@nvidia.com \
--cc=thierry.reding@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).