Re: [PATCH v2] gpiolib: Disallow identical line names in the same chip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 6, 2021 at 4:25 PM Bartosz Golaszewski
<bgolaszewski@xxxxxxxxxxxx> wrote:
> On Wed, Jan 6, 2021 at 2:34 PM Andy Shevchenko
> <andy.shevchenko@xxxxxxxxx> wrote:
> > On Wed, Jan 6, 2021 at 12:09 PM Bartosz Golaszewski
> > <bgolaszewski@xxxxxxxxxxxx> wrote:
> > > On Wed, Jan 6, 2021 at 12:24 AM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:

...

> > > I can do it alright. But in the context of user-space I think this
> > > doesn't really change anything. DT users still can use non-unique
> > > names and libgpiod still has to account for that if the API is to be
> > > considered correct. Is this change really useful?
> >
> > IMHO it is useful and the earliest we do the better.
>
> I'm wondering if user-space should make this assumption too then. That
> a non-unique name is either an error or signifies some special value
> (N/A).

My understanding that names are basically aliases to the pin numbers
inside a chip, so
gpiochipX:Y should == gpiochipX:$NAME
Obviously we can't guarantee that if there is no uniqueness assumption made.
Otherwise the idea behind naming the lines sounds controversial to me.

That said, if we allow non-unique names inside one chip, then the name
field is basically *informative*, which means we may not take it
anyhow as a parameter to any of the tools or anything.

> > > How does it affect
> > > ACPI users that already define non-unique names?
> >
> > I suppose that in ACPI we don't have many users that do it on their
> > own (for IoT Intel platforms GPIO expanders have unique names).
> > Also see above. I prefer to have a bug report with a clear source of
> > the issue (like a table that the user can't / won't change which
> > predates the date of kernel release with a patch.
> >
> > +cc: to the user who lately was active in the area.
> >
> > Flavio, perhaps one more rule to the gpio-line-names property has to
> > be added into documentation (Bart, same to DT docs?):
> >  - names inside one chip must be unique
> >
>
> Once we have a proper, core yaml binding for all GPIO devices, we'll
> be able to even enforce it if we agree on a set of exceptions.


-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux