Debian Codegraph @

Documentation/userspace-api/gpio/gpio-get-lineinfo-ioctl.rst

raw
1 .. SPDX-License-Identifier: GPL-2.0
2
3 .. _GPIO_GET_LINEINFO_IOCTL:
4
5 ***********************
6 GPIO_GET_LINEINFO_IOCTL
7 ***********************
8
9 .. warning::
10 This ioctl is part of chardev_v1.rst and is obsoleted by
11 gpio-v2-get-lineinfo-ioctl.rst.
12
13 Name
14 ====
15
16 GPIO_GET_LINEINFO_IOCTL - Get the publicly available information for a line.
17
18 Synopsis
19 ========
20
21 .. c:macro:: GPIO_GET_LINEINFO_IOCTL
22
23 ``int ioctl(int chip_fd, GPIO_GET_LINEINFO_IOCTL, struct gpioline_info *info)``
24
25 Arguments
26 =========
27
28 ``chip_fd``
29 The file descriptor of the GPIO character device returned by `open()`.
30
31 ``info``
32 The :c:type:`line_info<gpioline_info>` to be populated, with the
33 ``offset`` field set to indicate the line to be collected.
34
35 Description
36 ===========
37
38 Get the publicly available information for a line.
39
40 This information is available independent of whether the line is in use.
41
42 .. note::
43 The line info does not include the line value.
44
45 The line must be requested using gpio-get-linehandle-ioctl.rst or
46 gpio-get-lineevent-ioctl.rst to access its value.
47
48 Return Value
49 ============
50
51 On success 0 and ``info`` is populated with the chip info.
52
53 On error -1 and the ``errno`` variable is set appropriately.
54 Common error codes are described in error-codes.rst.