devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@baylibre.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>
Cc: devicetree@vger.kernel.org, linux-pm@vger.kernel.org,
	arm-scmi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] of: Add of_parse_map_iter() helper for nexus node map iteration
Date: Wed, 19 Nov 2025 17:01:39 -0800	[thread overview]
Message-ID: <7h8qg1frf0.fsf@baylibre.com> (raw)
In-Reply-To: <20251119-topic-lpm-of-map-iterator-v6-18-v1-1-1f0075d771a3@baylibre.com>

"Kevin Hilman (TI.com)" <khilman@baylibre.com> writes:

> Add a new helper function of_parse_map_iter() to iterate over nexus
> node maps (c.f. DT spec, section 2.5.1.)
>
> This function provides an iterator interface for traversing map
> entries, handling the complexity of variable-sized entries based on
> <stem>-cells properties, as well as handling the <stem>-skip and
> <stem>-pass-thru properties.
>
> RFC: There's a lot of overlap between this function and
> of_parse_phandle_with_args_map().  However the key differences are:
>
>   - of_parse_phandle_with_args_map() does matching
>     it searches for an entry that matches specific child args
>   - of_parse_map_iter() does iteration
>     it simply walks through all entries sequentially
>
> There are likely ways to extract some shared code between these two
> functions into some shared helpers, but I'm hoping someone more
> familiar with this OF code can help here.
>
> However, before refactoring the shared code, it would be good to have
> some feedback on this approach.

For a bit more context, the need for this comes from the work in
drivers/pmdomain to be able to create pmdomain hierarchies using a
power-domain-map property.

I just posted an example user of this functionality here:
https://lore.kernel.org/r/20251119-pmdomain-hierarchy-onecell-v4-0-f25a1d5022f8@baylibre.com

Kevin

  reply	other threads:[~2025-11-20  1:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20  0:41 [PATCH RFC] of: Add of_parse_map_iter() helper for nexus node map iteration Kevin Hilman (TI.com)
2025-11-20  1:01 ` Kevin Hilman [this message]
2025-11-20 14:08 ` Rob Herring
2025-11-25  1:50   ` Kevin Hilman
2025-11-25  7:55     ` Herve Codina
2025-11-25 19:13       ` Kevin Hilman

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=7h8qg1frf0.fsf@baylibre.com \
    --to=khilman@baylibre.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=ulf.hansson@linaro.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).