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

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