gpio-v2-line-set-values-ioctl.rst 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. .. SPDX-License-Identifier: GPL-2.0
  2. .. _GPIO_V2_LINE_SET_VALUES_IOCTL:
  3. *****************************
  4. GPIO_V2_LINE_SET_VALUES_IOCTL
  5. *****************************
  6. Name
  7. ====
  8. GPIO_V2_LINE_SET_VALUES_IOCTL - Set the values of requested output lines.
  9. Synopsis
  10. ========
  11. .. c:macro:: GPIO_V2_LINE_SET_VALUES_IOCTL
  12. ``int ioctl(int req_fd, GPIO_V2_LINE_SET_VALUES_IOCTL, struct gpio_v2_line_values *values)``
  13. Arguments
  14. =========
  15. ``req_fd``
  16. The file descriptor of the GPIO character device, as returned in the
  17. :c:type:`request.fd<gpio_v2_line_request>` by gpio-v2-get-line-ioctl.rst.
  18. ``values``
  19. The :c:type:`line_values<gpio_v2_line_values>` to set with the ``mask`` set
  20. to indicate the subset of requested lines to set and ``bits`` set to
  21. indicate the new value.
  22. Description
  23. ===========
  24. Set the values of requested output lines.
  25. The values set are logical, indicating if the line is to be active or inactive.
  26. The ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` flag controls the mapping between logical
  27. values (active/inactive) and physical values (high/low).
  28. If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is not set then active is high and inactive
  29. is low. If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is set then active is low and
  30. inactive is high.
  31. Only the values of output lines may be set.
  32. Attempting to set the value of an input line is an error (**EPERM**).
  33. Return Value
  34. ============
  35. On success 0.
  36. On error -1 and the ``errno`` variable is set appropriately.
  37. Common error codes are described in error-codes.rst.