linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"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: Sun, 27 Jun 2021 11:47:03 +0200	[thread overview]
Message-ID: <CAMhs-H_fcNDAOHm=tZB4ku9fzeea_7f4ZLg7w5KEmcNu+8wbQQ@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VfM-35tQMRh98mtg2XmDOJFnmjdYRKZZoi9ADm=AT2xUw@mail.gmail.com>

Hi Andy,

On Sun, Jun 27, 2021 at 11:33 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Sat, Jun 26, 2021 at 7:18 PM Sergio Paracuellos
> <sergio.paracuellos@gmail.com> wrote:
> >
> > The default handling of the gpio-line-names property by the
> > gpiolib-of implementation does not work with the multiple
> > gpiochip banks per device structure used by the gpio-mt7621
> > driver.
> >
> > This commit adds driver level support for the device tree
> > property so that GPIO lines can be assigned friendly names.
>
>
>
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> > Hi,
> >
> > This driver has three gpiochips with 32 gpios each. Core implementation
>
> implementation
>
>
> > got gpio's repeated along each gpio chip if chip.names is not assigned.
> > To avoid this behaviour driver will set this names as empty or
>
> the driver
> these names
>
> > with desired friendly line names. Consider the following sample with
> > minimal entries for the first chip with this patch changes applied:
>
> The same comment as per v1:
>
> Any idea why it's not a duplicate of
> https://elixir.bootlin.com/linux/v5.13-rc7/C/ident/devprop_gpiochip_set_names,
> and why the latter is not called in your case?

The core properly calls this function but not in the way expected.
This driver implements three banks of 32 gpios each internally using
one gpiochip per bank, all of them in the same device. So the core
code you are pointing out here duplicates the same names along the
three gpiochips which is not the expected behaviour. So implementing
in this way and setting names at least reserved avoids the core code
to be run and also avoids the duplication getting expected behaviour
for all the banks and each line friendly name.

Best regards,
    Sergio Paracuellos

>
>
> --
> With Best Regards,
> Andy Shevchenko

  reply	other threads:[~2021-06-27  9:47 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 [this message]
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
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='CAMhs-H_fcNDAOHm=tZB4ku9fzeea_7f4ZLg7w5KEmcNu+8wbQQ@mail.gmail.com' \
    --to=sergio.paracuellos@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=git@johnthomson.fastmail.com.au \
    --cc=hofrat@osadl.org \
    --cc=linus.walleij@linaro.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 \
    /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).