[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7h8qg1frf0.fsf@baylibre.com>
Date: Wed, 19 Nov 2025 17:01:39 -0800
From: Kevin Hilman <khilman@...libre.com>
To: Ulf Hansson <ulf.hansson@...aro.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>
Cc: devicetree@...r.kernel.org, linux-pm@...r.kernel.org,
arm-scmi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC] of: Add of_parse_map_iter() helper for nexus node
map iteration
"Kevin Hilman (TI.com)" <khilman@...libre.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
Powered by blists - more mailing lists