mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-30 21:52:21 +00:00

As a way to allow the user-space to stop referring to GPIOs by their global numbers, introduce a parallel group of line attributes for exported GPIO that live inside the GPIO chip class device and are referred to by their HW offset within their parent chip. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20250704-gpio-sysfs-chip-export-v4-8-9289d8758243@linaro.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
41 lines
1.7 KiB
Plaintext
41 lines
1.7 KiB
Plaintext
What: /sys/class/gpio/
|
|
Date: July 2008
|
|
KernelVersion: 2.6.27
|
|
Contact: Linus Walleij <linusw@kernel.org>
|
|
Description:
|
|
|
|
As a Kconfig option, individual GPIO signals may be accessed from
|
|
userspace. GPIOs are only made available to userspace by an explicit
|
|
"export" operation. If a given GPIO is not claimed for use by
|
|
kernel code, it may be exported by userspace (and unexported later).
|
|
Kernel code may export it for complete or partial access.
|
|
|
|
GPIOs are identified as they are inside the kernel, using integers in
|
|
the range 0..INT_MAX. See Documentation/admin-guide/gpio for more information.
|
|
|
|
::
|
|
|
|
/sys/class/gpio
|
|
/export ... asks the kernel to export a GPIO to userspace
|
|
/unexport ... to return a GPIO to the kernel
|
|
/gpioN ... for each exported GPIO #N OR
|
|
/value ... always readable, writes fail for input GPIOs
|
|
/direction ... r/w as: in, out (default low); write: high, low
|
|
/edge ... r/w as: none, falling, rising, both
|
|
/active_low ... r/w as: 0, 1
|
|
/gpiochipN ... for each gpiochip; #N is its first GPIO
|
|
/base ... (r/o) same as N
|
|
/label ... (r/o) descriptive chip name
|
|
/ngpio ... (r/o) number of GPIOs; numbered N to N + (ngpio - 1)
|
|
/gpio<OFFSET>
|
|
/value ... always readable, writes fail for input GPIOs
|
|
/direction ... r/w as: in, out (default low); write: high, low
|
|
/chipX ... for each gpiochip; #X is the gpio device ID
|
|
/export ... asks the kernel to export a GPIO at HW offset X to userspace
|
|
/unexport ... to return a GPIO at HW offset X to the kernel
|
|
/label ... (r/o) descriptive chip name
|
|
/ngpio ... (r/o) number of GPIOs exposed by the chip
|
|
|
|
This ABI is obsoleted by Documentation/ABI/testing/gpio-cdev and will be
|
|
removed after 2020.
|