Lines Matching +full:a +full:- +full:gpio
1 GPIO Sysfs Interface for Userspace
6 been moved to Documentation/ABI/obsolete/sysfs-gpio.
16 ----------------------
18 configure a sysfs user interface to GPIOs. This is different from the
19 debugfs interface, since it provides control over GPIO direction and
20 value instead of just showing a gpio state summary. Plus, it could be
24 know for example that GPIO #23 controls the write protect line used to
26 may need to temporarily remove that protection, first importing a GPIO,
27 then changing its output state, then updating the code before re-enabling
28 the write protection. In normal use, GPIO #23 would never be touched,
32 userspace GPIO can be used to determine system configuration data that
34 GPIO drivers could be all that the system really needs.
38 Please read Documentation/driver-api/gpio/drivers-on-gpio.rst
44 --------------
45 There are three kinds of entries in /sys/class/gpio:
47 - Control interfaces used to get userspace control over GPIOs;
49 - GPIOs themselves; and
51 - GPIO controllers ("gpio_chip" instances).
55 The control interfaces are write-only:
57 /sys/class/gpio/
61 a GPIO to userspace by writing its number to this file.
63 Example: "echo 19 > export" will create a "gpio19" node
64 for GPIO #19, if that's not requested by kernel code.
69 Example: "echo 19 > unexport" will remove a "gpio19"
72 GPIO signals have paths like /sys/class/gpio/gpio42/ (for GPIO #42)
75 /sys/class/gpio/gpioN/
82 configure the GPIO as an output with that initial value.
85 doesn't support changing the direction of a GPIO, or
87 allow userspace to reconfigure this GPIO's direction.
90 reads as either 0 (inactive) or 1 (active). If the GPIO
94 If the pin can be configured as interrupt-generating interrupt
103 re-open it to read the value.
121 GPIO controllers have paths like /sys/class/gpio/gpiochip42/ (for the
123 read-only attributes:
125 /sys/class/gpio/gpiochipN/
128 same as N, the first GPIO managed by this chip
134 how many GPIOs this manages (N to N + ngpio - 1)
138 a daughtercard might be different depending on the base board being used,
141 the correct GPIO number to use for a given signal.
145 --------------------------
149 /* export the GPIO to userspace */
155 /* create a sysfs link to an exported GPIO node */
159 After a kernel driver requests a GPIO, it may only be made available in
165 of experiments easier), or can provide an always-there interface that's
166 suitable for documenting as part of a board support package.
168 After the GPIO has been exported, gpiod_export_link() allows creating
169 symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can
171 a descriptive name.