gpio-get-lineinfo-ioctl.rst 1.2 KB

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