gpio-v2-get-lineinfo-ioctl.rst 1.1 KB

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