devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Rob Herring <robh@kernel.org>
Cc: Orson Zhai <orson.zhai@unisoc.com>,
	Lee Jones <lee.jones@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	DTML <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kevin.tang@unisoc.com, baolin.wang@unisoc.com,
	Chunyan Zhang <chunyan.zhang@unisoc.com>
Subject: Re: [PATCH V2 1/2] dt-bindings: syscon: Add syscon-names to refer to syscon easily
Date: Thu, 5 Dec 2019 10:20:03 +0100	[thread overview]
Message-ID: <CAK8P3a165hqB=5LmMiTPGJxvsSJqrbFf5EC9WnqtFRYFok+xKw@mail.gmail.com> (raw)
In-Reply-To: <20191204192639.GA15786@bogus>

On Wed, Dec 4, 2019 at 8:26 PM Rob Herring <robh@kernel.org> wrote:
> On Wed, Dec 04, 2019 at 06:00:17PM +0100, Arnd Bergmann wrote:
> > On Wed, Dec 4, 2019 at 5:38 PM Rob Herring <robh@kernel.org> wrote:

> > I think generally speaking this would be useful for random registers that
> > logically belong to one device but are grouped with other unrelated
> > registers in a syscon, and that are in a different register offset for
> > each chip that has them. Using named properties instead of a list
> > of phandle/arg tuples with names is clearly a simpler alternative
> > and more like we do it today, but I can also see some API simplification
> > with Orson's patch without the binding getting out of hand.
>
> I understand when a phandle to a syscon is used. That's nothing new.
> What's special about Unisoc SoC that needs something new/different?
> I saw there's a large number of syscons, but I don't understand what's
> in them.
>
> If the API is this:
>
> struct regmap *syscon_regmap_lookup_by_name(struct device_node *np,
>                                        const char *name,
>                                        int arg_count, __u32 *out_args)
>
> How is 'name' being an entry in syscon-names simpler than just being the
> property name? The implementation for the latter would certainly be
> simpler.
>
> It also makes the property unparseable without knowledge outside of the
> DT (i.e. in the driver). I suppose if the number of cells for each entry
> is fixed, we could count the number of syscon-names entries to figure
> out the stride. But then if one entry needs a lot of cells, then they
> all have to have padding cells.

Good point. The syscon_regmap_lookup_by_name() interface would
work just as well when passing a property name compared to
a name listed in another property, and this would still be more in
line with what we do on other SoCs.

The only advantage I can see in having a list of phandle/arg tuples
rather than a set of properties is that it is a slightly more compact
representation in source form, but otherwise they should be equivalent
and agree about this being harder to parse in an automated way.

Orson, do you see any other reason for the combined property?
If not, could you respin the series once more with
syscon_regmap_lookup_by_name() replaced by something like:?

struct regmap *
syscon_regmap_lookup_args_by_phandle(struct device_node *np,
                                        const char *property,
                                        int arg_count, __u32 *out_args)

         Arnd

  reply	other threads:[~2019-12-05  9:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 15:41 [PATCH V2 0/2] Add syscon name support Orson Zhai
2019-11-20 15:41 ` [PATCH V2 1/2] dt-bindings: syscon: Add syscon-names to refer to syscon easily Orson Zhai
2019-11-21 14:59   ` Arnd Bergmann
2019-12-04 16:38   ` Rob Herring
2019-12-04 17:00     ` Arnd Bergmann
2019-12-04 19:26       ` Rob Herring
2019-12-05  9:20         ` Arnd Bergmann [this message]
2019-12-05 12:55           ` Orson Zhai
2019-12-05 15:12             ` Rob Herring
     [not found]               ` <CA+H2tpEZ_d-c6DcfQ3yZPf4s_0GTe-q5q4FnVydYm2cdi0im=g@mail.gmail.com>
2019-12-05 16:55                 ` Orson Zhai
2019-11-20 15:41 ` [PATCH V2 2/2] mfd: syscon: Find syscon by names with arguments support Orson Zhai
2019-11-21 15:04   ` Arnd Bergmann
2019-11-22 16:21     ` Orson Zhai

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='CAK8P3a165hqB=5LmMiTPGJxvsSJqrbFf5EC9WnqtFRYFok+xKw@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=baolin.wang@unisoc.com \
    --cc=chunyan.zhang@unisoc.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kevin.tang@unisoc.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=orson.zhai@unisoc.com \
    --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).