xref: /linux/Documentation/userspace-api/gpio/gpio-get-lineinfo-ioctl.rst (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1.. SPDX-License-Identifier: GPL-2.0
2
3.. _GPIO_GET_LINEINFO_IOCTL:
4
5***********************
6GPIO_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
13Name
14====
15
16GPIO_GET_LINEINFO_IOCTL - Get the publicly available information for a line.
17
18Synopsis
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
25Arguments
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
35Description
36===========
37
38Get the publicly available information for a line.
39
40This 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
48Return Value
49============
50
51On success 0 and ``info`` is populated with the chip info.
52
53On error -1 and the ``errno`` variable is set appropriately.
54Common error codes are described in error-codes.rst.
55