linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Cc: "Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"John Thomson" <git@johnthomson.fastmail.com.au>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	NeilBrown <neil@brown.name>,
	"René van Dorst" <opensource@vdorst.com>,
	"Nicholas Mc Guire" <hofrat@osadl.org>
Subject: Re: [PATCH v2] gpio: mt7621: support gpio-line-names property
Date: Fri, 2 Jul 2021 12:18:12 +0200	[thread overview]
Message-ID: <CACRpkdaqSoyDUn3dVuVgzRK_7AabdY=1FzAnhHZzPs3qS+GfsA@mail.gmail.com> (raw)
In-Reply-To: <CAMhs-H_Ne4W79Awbmo6w_68X+h0-ybjvzNsbh=XuHMPJJ8-hDQ@mail.gmail.com>

On Fri, Jul 2, 2021 at 11:40 AM Sergio Paracuellos
<sergio.paracuellos@gmail.com> wrote:
> On Fri, Jul 2, 2021 at 11:27 AM Andy Shevchenko
> <andy.shevchenko@gmail.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

  parent reply	other threads:[~2021-07-02 10:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-26 16:18 [PATCH v2] gpio: mt7621: support gpio-line-names property Sergio Paracuellos
2021-06-27  9:33 ` Andy Shevchenko
2021-06-27  9:47   ` Sergio Paracuellos
2021-06-27 10:51     ` Andy Shevchenko
2021-06-27 10:56       ` Sergio Paracuellos
2021-06-27 13:00         ` Andy Shevchenko
2021-06-27 13:12           ` Sergio Paracuellos
2021-07-02  9:26             ` Andy Shevchenko
2021-07-02  9:40               ` Sergio Paracuellos
2021-07-02  9:56                 ` Andy Shevchenko
2021-07-02 10:18                 ` Linus Walleij [this message]
2021-07-02 11:30                   ` Sergio Paracuellos
2021-07-03 11:06                     ` Sergio Paracuellos
2021-07-03 11:32                       ` Andy Shevchenko
2021-07-03 12:05                         ` Sergio Paracuellos
2021-07-03 12:51                           ` Sergio Paracuellos
2021-07-03 19:36                             ` Andy Shevchenko
2021-07-04  5:57                               ` Sergio Paracuellos
2021-07-04  8:06                                 ` Sergio Paracuellos
2021-07-04 10:04                                   ` Andy Shevchenko
2021-07-04 11:25                                     ` Sergio Paracuellos
2021-07-04 11:35                                       ` Andy Shevchenko
2021-07-04 20:07                                         ` Sergio Paracuellos
2021-07-04 20:15                                           ` Sergio Paracuellos

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='CACRpkdaqSoyDUn3dVuVgzRK_7AabdY=1FzAnhHZzPs3qS+GfsA@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=git@johnthomson.fastmail.com.au \
    --cc=hofrat@osadl.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=neil@brown.name \
    --cc=opensource@vdorst.com \
    --cc=sergio.paracuellos@gmail.com \
    /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).