From: Linus Walleij <linusw@kernel.org>
To: Conor Dooley <conor@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Conor Dooley <conor.dooley@microchip.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org,
Valentina.FernandezAlanis@microchip.com,
Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: [RFC v1 2/4] pinctrl: add polarfire soc mssio pinctrl driver
Date: Tue, 25 Nov 2025 14:24:55 +0100 [thread overview]
Message-ID: <CAD++jLkehJNGxxQJV6vOA9xurBjwpYcL1ufYBQEOqRjNG-h-fg@mail.gmail.com> (raw)
In-Reply-To: <20251124-crayfish-lard-cc7519e1119e@spud>
On Mon, Nov 24, 2025 at 8:14 PM Conor Dooley <conor@kernel.org> wrote:
> Started looking at this today too, and I found one of my sources of
> confusion - the recently added helper which I think is confusingly
> named. pinconf_generic_dt_node_to_map_pinmux() works differently to
> pinconf_generic_dt_node_to_map(), because it only works if you have
> the following setup:
>
> label: group {
> pinmux = <asjhdasjhlajskd>;
> config-item1;
> };
>
> It does not work if you have:
>
> label: cfg {
> group1 {
> pinmux = <dsjhlfka>;
> config-item2;
> };
> group2 {
> pinmux = <lsdjhaf>;
> config-item1;
> };
> };
>
> Specifically, the label must point to a group.
> pinconf_generic_dt_node_to_map() does not work like this, it accepts both!
My feeling is that this is a bug, it should certainly handle configs
with subnodes.
> I think the pinconf_generic_dt_node_to_map_pinmux() function should
> actually be called pinconf_generic_dt_subnode_to_map_pinmux(), because
> it operates at the same level as pinconf_generic_dt_subnode_to_map().
If it should be renamed, yes. But I think it should be fixed to
parse subnodes, if present.
> Probably there should be a "real" pinconf_generic_dt_node_to_map() that
> accepts both setups, since AFAICT it is pretty normal to have different
> pins in a group that get different pinconf settings. Obviously
I think it should be fine to augment the existing function to handle
both cases? (configs inside the current node or in subnodes
alike) I don't see it causing any regressions.
> label: cfg {
> group1 {
> pinmux = <dsjhlfka>;
> config-item2;
> };
> group2 {
> pinmux = <lsdjhaf>;
> config-item1;
> };
> };
>
> peripheral {
> pinctrl-0 = <&label>;
> }
>
> isn't the only way to do things, and the amlogic user of the current
> setup could just go and do
>
> cfg {
> label1: group1 {
> pinmux = <dsjhlfka>;
> config-item2;
> };
> label2: group2 {
> pinmux = <lsdjhaf>;
> config-item1;
> };
> };
>
> peripheral {
> pinctrl-0 = <&label1>, <&label2>;
> }
That works too, because sometimes you want to pick a few
different configs and collect them as one.
> Even then though, I'm not really sure that this function does what I
> would have expected it to do, because it won't work as a replacement for
> the custom dt_node_to_map in the spacemit k1 driver, for example, even
> ignoring the requirement about how the labels are done in the dt. That's
> because it doesn't actually do anything with the pinmux property, despite
> that being in the name. It never actually interacts with the pinmux property
> at all AFAICT!
I think it's unfortunate naming, people sometimes use the word
"pinmux" as a DT property, sometimes to describe the subsystem,
sometimes a part of the subsystem, sometimes anything related
to pins.
I know I should perhaps have shepherded this better :/
> It seems to depend on aml_pctl_parse_functions() being called
> during probe which creates the groups and functions.
> There's a weird warning about expecting a function parent node that seems
> very amlogic specific too.
>
> In my eyes, there should be some generic dt_node_to_map helpers that
> do it all for you on the "configuration entirely described in dt"
> platforms because that's what stuff like spacemit k1 driver that do
> this in their dt_node_to_map implementations.
I think you're right!
> I'm not gonna get in over my head, and just make a helper for doing the
> pins + function thing that I need for my driver, but would you be open
> to an equivalent for the pinmux scenario?
Yes!
> I'm thinking of something
> that'd work for both the amlogic platform and for the spacemit k1.
That's a good start!
Yours,
Linus Walleij
next prev parent reply other threads:[~2025-11-25 13:25 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 14:31 [RFC v1 0/4] Microchip mpfs/pic64gx pinctrl part 2 Conor Dooley
2025-11-12 14:31 ` [RFC v1 1/4] dt-bindings: pinctrl: document polarfire soc mssio pin controller Conor Dooley
2025-11-19 9:13 ` Linus Walleij
2025-11-12 14:31 ` [RFC v1 2/4] pinctrl: add polarfire soc mssio pinctrl driver Conor Dooley
2025-11-19 12:08 ` Linus Walleij
2025-11-19 18:23 ` Conor Dooley
2025-11-19 21:48 ` Linus Walleij
2025-11-20 0:26 ` Conor Dooley
2025-11-20 23:13 ` Linus Walleij
2025-11-21 10:46 ` Conor Dooley
2025-11-21 11:21 ` Conor Dooley
2025-11-24 17:16 ` Conor Dooley
2025-11-25 0:31 ` Linus Walleij
2025-11-25 1:03 ` Conor Dooley
2025-11-25 16:09 ` Linus Walleij
2025-11-25 0:10 ` Linus Walleij
2025-11-25 0:24 ` Conor Dooley
2025-11-24 19:14 ` Conor Dooley
2025-11-25 13:24 ` Linus Walleij [this message]
2025-11-25 17:47 ` Conor Dooley
2025-11-25 19:28 ` Linus Walleij
2025-11-25 19:55 ` Conor Dooley
2025-11-25 19:59 ` Linus Walleij
2025-11-12 14:31 ` [RFC v1 3/4] MAINTAINERS: add Microchip mpfs mssio driver/bindings to entry Conor Dooley
2025-11-12 14:31 ` [RFC v1 4/4] riscv: dts: microchip: add pinctrl nodes for mpfs/icicle kit Conor Dooley
2025-11-19 12:16 ` [RFC v1 0/4] Microchip mpfs/pic64gx pinctrl part 2 Linus Walleij
2025-11-19 18:06 ` Conor Dooley
2025-11-19 21:31 ` Linus Walleij
2025-11-20 0:25 ` Conor Dooley
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=CAD++jLkehJNGxxQJV6vOA9xurBjwpYcL1ufYBQEOqRjNG-h-fg@mail.gmail.com \
--to=linusw@kernel.org \
--cc=Valentina.FernandezAlanis@microchip.com \
--cc=brgl@bgdev.pl \
--cc=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@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;
as well as URLs for NNTP newsgroup(s).