Lines Matching +full:a +full:- +full:gpio
1 GPIO Sysfs Interface for Userspace
7 Documentation/ABI/obsolete/sysfs-gpio AND NEW USERSPACE CONSUMERS
11 Refer to the examples in tools/gpio/* for an introduction to the new
13 include/uapi/linux/gpio.h
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.
37 PLEASE READ THE DOCUMENT AT Documentation/driver-api/gpio/drivers-on-gpio.rst
41 --------------
42 There are three kinds of entries in /sys/class/gpio:
44 - Control interfaces used to get userspace control over GPIOs;
46 - GPIOs themselves; and
48 - GPIO controllers ("gpio_chip" instances).
52 The control interfaces are write-only:
54 /sys/class/gpio/
58 a GPIO to userspace by writing its number to this file.
60 Example: "echo 19 > export" will create a "gpio19" node
61 for GPIO #19, if that's not requested by kernel code.
66 Example: "echo 19 > unexport" will remove a "gpio19"
69 GPIO signals have paths like /sys/class/gpio/gpio42/ (for GPIO #42)
72 /sys/class/gpio/gpioN/
79 configure the GPIO as an output with that initial value.
82 doesn't support changing the direction of a GPIO, or
84 allow userspace to reconfigure this GPIO's direction.
87 reads as either 0 (low) or 1 (high). If the GPIO
91 If the pin can be configured as interrupt-generating interrupt
98 file and read the new value or close the file and re-open it
117 GPIO controllers have paths like /sys/class/gpio/gpiochip42/ (for the
119 read-only attributes:
121 /sys/class/gpio/gpiochipN/
124 same as N, the first GPIO managed by this chip
130 how many GPIOs this manages (N to N + ngpio - 1)
134 a daughtercard might be different depending on the base board being used,
137 the correct GPIO number to use for a given signal.
141 --------------------------
145 /* export the GPIO to userspace */
151 /* create a sysfs link to an exported GPIO node */
155 After a kernel driver requests a GPIO, it may only be made available in
161 of experiments easier), or can provide an always-there interface that's
162 suitable for documenting as part of a board support package.
164 After the GPIO has been exported, gpiod_export_link() allows creating
165 symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can
167 a descriptive name.