summaryrefslogtreecommitdiff
path: root/drivers/gpio/TODO
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-12-04 11:35:33 +0300
committerLinus Walleij <linus.walleij@linaro.org>2020-12-06 02:13:17 +0300
commitdd0fa81143f60cbc90cd6ce1c9a2c51a7b40046e (patch)
tree8b103e6992dd3d359242eb231ca0419d8b784610 /drivers/gpio/TODO
parentc47d9e1b734361a5d809fae02a268b85ab0f95ee (diff)
downloadlinux-dd0fa81143f60cbc90cd6ce1c9a2c51a7b40046e.tar.xz
gpio: Add TODO item for debugfs interface
The idea to create a debugfs to replace the aging and dangerous sysfs ABI for hacking and tinkering came up on the list. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Cc: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20201204083533.65830-1-linus.walleij@linaro.org
Diffstat (limited to 'drivers/gpio/TODO')
-rw-r--r--drivers/gpio/TODO36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpio/TODO b/drivers/gpio/TODO
index cd04e0b60159..0229fa79499e 100644
--- a/drivers/gpio/TODO
+++ b/drivers/gpio/TODO
@@ -142,3 +142,39 @@ use of the global GPIO numbers. Once the above is complete, it may
make sense to simply join the subsystems into one and make pin
multiplexing, pin configuration, GPIO, etc selectable options in one
and the same pin control and GPIO subsystem.
+
+
+Debugfs in place of sysfs
+
+The old sysfs code that enables simple uses of GPIOs from the
+command line is still popular despite the existance of the proper
+character device. The reason is that it is simple to use on
+root filesystems where you only have a minimal set of tools such
+as "cat", "echo" etc.
+
+The old sysfs still need to be strongly deprecated and removed
+as it relies on the global GPIO numberspace that assume a strict
+order of global GPIO numbers that do not change between boots
+and is independent of probe order.
+
+To solve this and provide an ABI that people can use for hacks
+and development, implement a debugfs interface to manipulate
+GPIO lines that can do everything that sysfs can do today: one
+directory per gpiochip and one file entry per line:
+
+/sys/kernel/debug/gpiochip/gpiochip0
+/sys/kernel/debug/gpiochip/gpiochip0/gpio0
+/sys/kernel/debug/gpiochip/gpiochip0/gpio1
+/sys/kernel/debug/gpiochip/gpiochip0/gpio2
+/sys/kernel/debug/gpiochip/gpiochip0/gpio3
+...
+/sys/kernel/debug/gpiochip/gpiochip1
+/sys/kernel/debug/gpiochip/gpiochip1/gpio0
+/sys/kernel/debug/gpiochip/gpiochip1/gpio1
+...
+
+The exact files and design of the debugfs interface can be
+discussed but the idea is to provide a low-level access point
+for debugging and hacking and to expose all lines without the
+need of any exporting. Also provide ample ammunition to shoot
+oneself in the foot, because this is debugfs after all.