[PATCH 6/6] gpio: TODO: add an item to track reworking the sysfs interface

Bartosz Golaszewski posted 6 patches 9 months ago
[PATCH 6/6] gpio: TODO: add an item to track reworking the sysfs interface
Posted by Bartosz Golaszewski 9 months ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

It seems there really exists the need for a simple sysfs interface that
can be easily used from minimal initramfs images that don't contain much
more than busybox. However the current interface poses a challenge to
the removal of global GPIO numberspace. Add an item that tracks
extending the existing ABI with a per-chip export/unexport attribute
pair.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 drivers/gpio/TODO | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO
index 3abf4805335f1..b5f0a7a2e1bf1 100644
--- a/drivers/gpio/TODO
+++ b/drivers/gpio/TODO
@@ -173,3 +173,16 @@ value back to the caller.
 We've now added new variants - set_rv() and set_multiple_rv() that return an
 integer. Let's convert all GPIO drivers treewide to use the new callbacks,
 remove the old ones and finally rename the new ones back to the old names.
+
+-------------------------------------------------------------------------------
+
+Extend the sysfs ABI to allow exporting lines by their HW offsets
+
+The need to support the sysfs GPIO class is one of the main obstacles to
+removing the global GPIO numberspace from the kernel. In order to wean users
+off using global numbers from user-space, extend the existing interface with
+new per-gpiochip export/unexport attributes that allow to refer to GPIOs using
+their hardware offsets within the chip.
+
+Encourage users to switch to using them and eventually remove the existing
+global export/unexport attribues.

-- 
2.45.2
Re: [PATCH 6/6] gpio: TODO: add an item to track reworking the sysfs interface
Posted by Linus Walleij 8 months, 4 weeks ago
On Fri, Mar 21, 2025 at 4:49 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:

> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> It seems there really exists the need for a simple sysfs interface that
> can be easily used from minimal initramfs images that don't contain much
> more than busybox. However the current interface poses a challenge to
> the removal of global GPIO numberspace. Add an item that tracks
> extending the existing ABI with a per-chip export/unexport attribute
> pair.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

100% agreed.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij