linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Marek Vasut" <marex@denx.de>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	"Ahmad Fatoum" <a.fatoum@pengutronix.de>,
	"Kent Gibson" <warthog618@gmail.com>,
	"Jan Lübbe" <jlu@pengutronix.de>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: Replacing global GPIO numbers in sysfs with hardware offsets
Date: Fri, 28 Feb 2025 09:49:53 +0100	[thread overview]
Message-ID: <CAMuHMdW=bttP01Jigtn1DPyzVzTNr3GguNTo4Kw=NOBhhhthRA@mail.gmail.com> (raw)
In-Reply-To: <CACRpkda-0+9u1mu8gJPwE_2ykY0TeoDS3t2_D-HoPgUQ45gfiw@mail.gmail.com>

Hi Linus,

On Fri, 28 Feb 2025 at 08:50, Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Feb 26, 2025 at 1:43 PM Marek Vasut <marex@denx.de> wrote:
> > > I understand, I'm fine with sysfs if it needs to be a "support forever"
> > > ABI, as long as it's:
> > >
> > > - Using the per-chip HW numberspace
> >
> > This is no issue for me.

So that would be 0..<N-1>, not <base>..<base+N-1>?
Hence you cannot have global (un)export files in sysfs, but need
per-chip (un)export files?

> > > - Doesn't need any echo NN > export to see the lines in
> > >    sysfs.
> >
> > Can we really make do without export/unexport ?
>
> I was more thinking that we should not need export/unexport
> just to see the line. Propsal elsewhere in this thread:
>
> /sys/bus/gpio/gpiochip0
> /sys/bus/gpio/gpiochip0/gpio0
> /sys/bus/gpio/gpiochip0/gpio0/userspace
> /sys/bus/gpio/gpiochip0/gpio0/value
> /sys/bus/gpio/gpiochip0/gpio1
> /sys/bus/gpio/gpiochip0/gpio1/userspace
> /sys/bus/gpio/gpiochip0/gpio1/value
>
> Take a GPIO, shake it, give it back to the kernel:
> echo 1 > /sys/bus/gpio/gpiochip0/gpio1/userspace
> echo 0 > /sys/bus/gpio/gpiochip0/gpio1/value
> sleep 1
> echo 1 > /sys/bus/gpio/gpiochip0/gpio1/value
> echo 0 > /sys/bus/gpio/gpiochip0/gpio1/userspace
>
> So we can always "see" this GPIO line, instead of
> exporting/unexporting there is a knob to assign/unassign
> it to userspace.

Why would you want to always "see" all GPIO lines?
What is the use case for that? What am I missing?

If it is recommended not to use this interface, I think all GPIOs
should be invisible by default.  Hence I still prefer the (un)export
interface.

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2025-02-28  8:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-02 12:45 Replacing global GPIO numbers in sysfs with hardware offsets Bartosz Golaszewski
2025-02-03 14:23 ` Geert Uytterhoeven
2025-02-07 20:18   ` Bartosz Golaszewski
2025-02-09  9:40     ` Geert Uytterhoeven
2025-02-25 18:25       ` Ayush Singh
2025-02-25 20:20         ` Linus Walleij
2025-02-26  6:25           ` Ayush Singh
2025-02-14  9:14 ` Linus Walleij
2025-02-21 18:01   ` Marek Vasut
2025-02-25 19:54     ` Linus Walleij
2025-02-26 12:36       ` Marek Vasut
2025-02-26 19:07         ` Bartosz Golaszewski
2025-02-28  7:49         ` Linus Walleij
2025-02-28  8:49           ` Geert Uytterhoeven [this message]
2025-02-28  8:55             ` Linus Walleij
2025-02-28  9:53               ` Geert Uytterhoeven
2025-03-05  8:22                 ` Linus Walleij
2025-03-05  8:41                   ` Kent Gibson
2025-03-11 10:28                 ` Bartosz Golaszewski
2025-03-11 10:52                   ` Geert Uytterhoeven
2025-03-11 11:53                     ` Bartosz Golaszewski
2025-03-11 15:26                       ` Geert Uytterhoeven
2025-02-21 19:56   ` Ahmad Fatoum
2025-02-25 19:56     ` Linus Walleij
2025-02-24  1:49 ` Kent Gibson
2025-02-24  8:28   ` Geert Uytterhoeven
2025-02-26  9:23   ` Bartosz Golaszewski
2025-02-26 10:58     ` Kent Gibson

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='CAMuHMdW=bttP01Jigtn1DPyzVzTNr3GguNTo4Kw=NOBhhhthRA@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=a.fatoum@pengutronix.de \
    --cc=brgl@bgdev.pl \
    --cc=geert+renesas@glider.be \
    --cc=jlu@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=warthog618@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).