Re: [PATCH] regulator: Start using standard gpios property anddeprecate some custom properties

From: Mark Brown
Date: Mon Dec 16 2013 - 16:41:27 EST


On Mon, Dec 16, 2013 at 01:05:13PM -0800, Tony Lindgren wrote:
> * Mark Brown <broonie@xxxxxxxxxx> [131216 12:12]:

> > This is the first time anyone's mentioned this so it probably isn't that
> > serious an issue and bear in mind that the patch was also handling all
> > the named GPIO specifiers too.

> I've certainly debugged this same exact issue twice already and that
> probably means that same issue has been debugged tens or hundreds
> of times by other people.

That surprises me to be honest, but then the fact that the convention
was even defined surprises me. Like I say you're the first person to
mention it; I suspect you might write more DTs than most.

> Personally I don't see any value for a regulator describing the names of
> the GPIOs in the binding, it's really up to the driver to make sense of
> them. Especially if there are one or more similar GPIOs. We're not

Devices like PMICs frequently have a *lot* of possible pin functions
some of which can get mapped onto GPIOs (in either direction), many of
which are going to be fixed by system design and generally all muxed
onto a much smaller set of physical pins. If you try to specify those
through an unnamed gpios property you end up with a very large array
(say 30 elements, more wouldn't be too surprising) most of which will be
empty. That is not at all usable, it's error prone to write and very
hard to read even with the preprocessor support that only got added
quite recently.

> naming interrupts either.

There's typically a much more limited set of interrupts a device can
have (and many of the more optional ones end up getting expressed via
the GPIO binding since you also need to read the state to use them) so
they don't run into the issue so much.

> > In any case, the thing is that there's a difference between parsing both
> > and deprecation - deprecation implies an intention to remove the old one
> > which would just reintroduce the problem the other way around since
> > people are likely to drop or forget the plural, use old DTs and so on.
> > Adding a gpios property in parallel with plain gpio is fine and what I
> > was mostly suggesting.

> Deprecation _may_ imply that it will get removed, but not always.
> Naturally we're going to have to keep the old bindings in place since
> they were merged. I can changed that to obsoleted if that's any better.

Yes, that's better.

> > Exactly, I think it's way more trouble than it's worth to try to change
> > for named single element lists. The standard property makes more sense.

> I don't think there should be any named GPIOs. If we want names, then
> the GPIO usage should be possible to group quite easily rather than create
> a new property for everything. Something like "enable-gpio" comes to mind.

I don't understand the difference between your suggestion and named
GPIOs.

Attachment: signature.asc
Description: Digital signature