[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdaqSoyDUn3dVuVgzRK_7AabdY=1FzAnhHZzPs3qS+GfsA@mail.gmail.com>
Date: Fri, 2 Jul 2021 12:18:12 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Sergio Paracuellos <sergio.paracuellos@...il.com>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Matthias Brugger <matthias.bgg@...il.com>,
John Thomson <git@...nthomson.fastmail.com.au>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
NeilBrown <neil@...wn.name>,
René van Dorst <opensource@...rst.com>,
Nicholas Mc Guire <hofrat@...dl.org>
Subject: Re: [PATCH v2] gpio: mt7621: support gpio-line-names property
On Fri, Jul 2, 2021 at 11:40 AM Sergio Paracuellos
<sergio.paracuellos@...il.com> wrote:
> On Fri, Jul 2, 2021 at 11:27 AM Andy Shevchenko
> <andy.shevchenko@...il.com> wrote:
> > > There are no child nodes, all the stuff is in the same parent node
> > > and, as I said, belongs to the same device but internally uses three
> > > gpiochips.
> >
> > And it can't be split into three children in the overlay?
>
> Original code before this being mainlined was using three children and
> I was told in the review that three children were not allowed:
>
> See https://patchwork.ozlabs.org/project/linux-gpio/patch/1527924610-13135-3-git-send-email-sergio.paracuellos@gmail.com/#1932827
Yeah this is one of those unfortunate cases where the DT representation
(or ACPI for that matter) of the device and the Linux internal representation
differs.
> > Let's assume it can't, then the GPIO library function should be
> > refactored in a way that it takes parameters like base index for the
> > names and tries to satisfy the caller.
>
> Bartosz, Linus, any thoughts on this?
This would be ideal, is there a reasonably simple way to get to this helper?
In gpiolib.c devprop_gpiochip_set_names() need to be refactored to
take a base number, devprop_gpiochip_set_names_base() that
function exposed in <linux/gpio/driver.h> and then the old function
devprop_gpiochip_set_names() wrapped in the new
one so all old users continue to work without modification.
Sprinkle some kerneldoc on top so we do not make mistakes
in the future.
This should work I think.
Any similar drivers (several gpio_chip per FW node) that want to
set line names need to do the same thing.
Sorry that you ran into this, I hate it when I'm first at hairy stuff
like this.
Yours,
Linus Walleij
Powered by blists - more mailing lists