gpio-v2-line-set-config-ioctl.rst 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. .. SPDX-License-Identifier: GPL-2.0
  2. .. _GPIO_V2_LINE_SET_CONFIG_IOCTL:
  3. *****************************
  4. GPIO_V2_LINE_SET_CONFIG_IOCTL
  5. *****************************
  6. Name
  7. ====
  8. GPIO_V2_LINE_SET_CONFIG_IOCTL - Update the configuration of previously requested lines.
  9. Synopsis
  10. ========
  11. .. c:macro:: GPIO_V2_LINE_SET_CONFIG_IOCTL
  12. ``int ioctl(int req_fd, GPIO_V2_LINE_SET_CONFIG_IOCTL, struct gpio_v2_line_config *config)``
  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. ``config``
  19. The new :c:type:`configuration<gpio_v2_line_config>` to apply to the
  20. requested lines.
  21. Description
  22. ===========
  23. Update the configuration of previously requested lines, without releasing the
  24. line or introducing potential glitches.
  25. The new configuration must specify a configuration for all requested lines.
  26. The same :ref:`gpio-v2-get-line-config-rules` and
  27. :ref:`gpio-v2-get-line-config-support` that apply when requesting the lines
  28. also apply when updating the line configuration, with the additional
  29. restriction that a direction flag must be set to enable reconfiguration.
  30. If no direction flag is set in the configuration for a given line then the
  31. configuration for that line is left unchanged.
  32. The motivating use case for this command is changing direction of
  33. bi-directional lines between input and output, but it may also be used to
  34. dynamically control edge detection, or more generally move lines seamlessly
  35. from one configuration state to another.
  36. To only change the value of output lines, use
  37. gpio-v2-line-set-values-ioctl.rst.
  38. Return Value
  39. ============
  40. On success 0.
  41. On error -1 and the ``errno`` variable is set appropriately.
  42. Common error codes are described in error-codes.rst.