Lines Matching +full:gpio +full:- +full:lines
1 .. SPDX-License-Identifier: GPL-2.0
4 GPIO Character Device Userspace API
8 ``include/uapi/linux/gpio.h.``
18 Read Documentation/driver-api/gpio/drivers-on-gpio.rst to avoid reinventing
21 Similarly, for multi-function lines there may be other subsystems, such as
23 Documentation/driver-api/pwm.rst, Documentation/w1/index.rst etc, that
26 Basic examples using the character device API can be found in ``tools/gpio/*``.
28 The API is based around two major objects, the :ref:`gpio-v2-chip` and the
29 :ref:`gpio-v2-line-request`.
31 .. _gpio-v2-chip:
36 The Chip represents a single GPIO chip and is exposed to userspace using device
39 Each chip supports a number of GPIO lines,
40 :c:type:`chip.lines<gpiochip_info>`. Lines on the chip are identified by an
41 ``offset`` in the range from 0 to ``chip.lines - 1``, i.e. `[0,chip.lines)`.
43 Lines are requested from the chip using gpio-v2-get-line-ioctl.rst
44 and the resulting line request is used to access the GPIO chip's lines or
45 monitor the lines for edge events.
48 on the GPIO device file is referred to as ``chip_fd``.
51 ----------
58 Get Line <gpio-v2-get-line-ioctl>
59 Get Chip Info <gpio-get-chipinfo-ioctl>
60 Get Line Info <gpio-v2-get-lineinfo-ioctl>
61 Watch Line Info <gpio-v2-get-lineinfo-watch-ioctl>
62 Unwatch Line Info <gpio-get-lineinfo-unwatch-ioctl>
63 Read Line Info Changed Events <gpio-v2-lineinfo-changed-read>
65 .. _gpio-v2-line-request:
70 Line requests are created by gpio-v2-get-line-ioctl.rst and provide
71 access to a set of requested lines. The line request is exposed to userspace
73 :c:type:`request.fd<gpio_v2_line_request>` by gpio-v2-get-line-ioctl.rst.
79 ----------
86 Get Line Values <gpio-v2-line-get-values-ioctl>
87 Set Line Values <gpio-v2-line-set-values-ioctl>
88 Read Line Edge Events <gpio-v2-line-event-read>
89 Reconfigure Lines <gpio-v2-line-set-config-ioctl>
95 as defined in ``include/uapi/linux/gpio.h``.
97 .. kernel-doc:: include/uapi/linux/gpio.h
116 error-codes