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