devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexander Stein <alexander.stein@ew.tq-group.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Markus Niebel <Markus.Niebel@ew.tq-group.com>
Subject: Re: [PATCH 1/1] gpiolib: allow device numbering using OF alias
Date: Tue, 14 Mar 2023 15:52:44 +0100	[thread overview]
Message-ID: <ZBCKPMll1yt5gMf0@hovoldconsulting.com> (raw)
In-Reply-To: <CACRpkdZbcs4zgGtuF5U4_JghHJ=A31T8jp2NTcN68P2Eh2azxg@mail.gmail.com>

Hi Linus,

and sorry about the late reply on this.

On Wed, Feb 15, 2023 at 03:43:41PM +0100, Linus Walleij wrote:
> Top-posting because important people are missing from the to:line.
> 
> It seems you are trying to enforce topology here,
> i.e. hammering down what should come first, second etc, despite the
> probe order.
> 
> First the DT people need to acknowledge that this is a valid way to use
> device tree aliases. I'm not so sure about that. Remember that DT
> is mostly OS neutral, but we do have aliases for some use cases that
> can be the same tricky in any OS.

Yeah, I believe the idea is that aliases should generally be avoided
expect possibly for the console (or named) serial ports and first
ethernet interface.

> Second I want Johan Hovolds input on this from the Linux sysfs side, as
> he keeps reminding me that sysfs already has topology and should be
> discovered from there (loosely paraphrased from memory). It might
> be that you are fixing something that should not be fixed.

If user space needs to access some gpios directly then you can name
those resources and that should not rely on having stable gpiochip
ids.

> On Wed, Feb 15, 2023 at 10:24 AM Alexander Stein
> <alexander.stein@ew.tq-group.com> wrote:
> 
> > From: Markus Niebel <Markus.Niebel@ew.tq-group.com>
> >
> > This is useful e.g. for the following cases
> >
> > - GPIO IP name order is not aligned with SOC addresses
> >   (i.MX93 from NXP)
> > - reproducible naming for GPIO expander chips
> >
> > The implementation is a mix of the one found for MMC and RTC.
> >
> > Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
> > Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> > ---
> > imx93 specifies alias for 4 on-chip GPIO controllers. But they are
> > ignored:
> > $ ls -o -g /sys/bus/gpio/devices/
> > total 0
> > lrwxrwxrwx 1 0 Feb 15 10:03 gpiochip0 -> ../../../devices/platform/soc@0/42000000.bus/42530000.i2c/i2c-2/2-0071/gpiochip0
> > lrwxrwxrwx 1 0 Feb 15 10:03 gpiochip1 -> ../../../devices/platform/soc@0/42000000.bus/42530000.i2c/i2c-2/2-0072/gpiochip1
> > lrwxrwxrwx 1 0 Feb 15 10:03 gpiochip2 -> ../../../devices/platform/soc@0/43810080.gpio/gpiochip2
> > lrwxrwxrwx 1 0 Feb 15 10:03 gpiochip3 -> ../../../devices/platform/soc@0/43820080.gpio/gpiochip3
> > lrwxrwxrwx 1 0 Feb 15 10:03 gpiochip4 -> ../../../devices/platform/soc@0/43830080.gpio/gpiochip4
> > lrwxrwxrwx 1 0 Feb 15 10:03 gpiochip5 -> ../../../devices/platform/soc@0/47400080.gpio/gpiochip5
> > lrwxrwxrwx 1 0 Feb 15 10:03 gpiochip6 -> ../../../devices/platform/soc@0/42000000.bus/42530000.i2c/i2c-2/2-0070/gpiochip6

Johan

      reply	other threads:[~2023-03-14 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230215092421.143199-1-alexander.stein@ew.tq-group.com>
2023-02-15 14:43 ` [PATCH 1/1] gpiolib: allow device numbering using OF alias Linus Walleij
2023-03-14 14:52   ` Johan Hovold [this message]

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=ZBCKPMll1yt5gMf0@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=Markus.Niebel@ew.tq-group.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=brgl@bgdev.pl \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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).