xref: /linux/Documentation/userspace-api/gpio/gpio-v2-line-set-values-ioctl.rst (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
132a0a0daSKent Gibson.. SPDX-License-Identifier: GPL-2.0
232a0a0daSKent Gibson
332a0a0daSKent Gibson.. _GPIO_V2_LINE_SET_VALUES_IOCTL:
432a0a0daSKent Gibson
532a0a0daSKent Gibson*****************************
632a0a0daSKent GibsonGPIO_V2_LINE_SET_VALUES_IOCTL
732a0a0daSKent Gibson*****************************
832a0a0daSKent Gibson
932a0a0daSKent GibsonName
1032a0a0daSKent Gibson====
1132a0a0daSKent Gibson
1232a0a0daSKent GibsonGPIO_V2_LINE_SET_VALUES_IOCTL - Set the values of requested output lines.
1332a0a0daSKent Gibson
1432a0a0daSKent GibsonSynopsis
1532a0a0daSKent Gibson========
1632a0a0daSKent Gibson
1732a0a0daSKent Gibson.. c:macro:: GPIO_V2_LINE_SET_VALUES_IOCTL
1832a0a0daSKent Gibson
1932a0a0daSKent Gibson``int ioctl(int req_fd, GPIO_V2_LINE_SET_VALUES_IOCTL, struct gpio_v2_line_values *values)``
2032a0a0daSKent Gibson
2132a0a0daSKent GibsonArguments
2232a0a0daSKent Gibson=========
2332a0a0daSKent Gibson
2432a0a0daSKent Gibson``req_fd``
2532a0a0daSKent Gibson    The file descriptor of the GPIO character device, as returned in the
2632a0a0daSKent Gibson    :c:type:`request.fd<gpio_v2_line_request>` by gpio-v2-get-line-ioctl.rst.
2732a0a0daSKent Gibson
2832a0a0daSKent Gibson``values``
2932a0a0daSKent Gibson    The :c:type:`line_values<gpio_v2_line_values>` to set with the ``mask`` set
3032a0a0daSKent Gibson    to indicate the subset of requested lines to set and ``bits`` set to
3132a0a0daSKent Gibson    indicate the new value.
3232a0a0daSKent Gibson
3332a0a0daSKent GibsonDescription
3432a0a0daSKent Gibson===========
3532a0a0daSKent Gibson
3632a0a0daSKent GibsonSet the values of requested output lines.
3732a0a0daSKent Gibson
38*5ca84d41SKent GibsonThe values set are logical, indicating if the line is to be active or inactive.
39*5ca84d41SKent GibsonThe ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` flag controls the mapping between logical
40*5ca84d41SKent Gibsonvalues (active/inactive) and physical values (high/low).
41*5ca84d41SKent GibsonIf ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is not set then active is high and inactive
42*5ca84d41SKent Gibsonis low.  If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is set then active is low and
43*5ca84d41SKent Gibsoninactive is high.
44*5ca84d41SKent Gibson
4532a0a0daSKent GibsonOnly the values of output lines may be set.
4632a0a0daSKent GibsonAttempting to set the value of an input line is an error (**EPERM**).
4732a0a0daSKent Gibson
4832a0a0daSKent GibsonReturn Value
4932a0a0daSKent Gibson============
5032a0a0daSKent Gibson
5132a0a0daSKent GibsonOn success 0.
5232a0a0daSKent Gibson
5332a0a0daSKent GibsonOn error -1 and the ``errno`` variable is set appropriately.
5432a0a0daSKent GibsonCommon error codes are described in error-codes.rst.
55