xref: /linux/Documentation/userspace-api/gpio/gpio-handle-set-line-values-ioctl.rst (revision a1ff5a7d78a036d6c2178ee5acd6ba4946243800)
116b2bb7fSKent Gibson.. SPDX-License-Identifier: GPL-2.0
216b2bb7fSKent Gibson
316b2bb7fSKent Gibson.. _GPIO_HANDLE_SET_LINE_VALUES_IOCTL:
416b2bb7fSKent Gibson
516b2bb7fSKent Gibson*********************************
616b2bb7fSKent GibsonGPIO_HANDLE_SET_LINE_VALUES_IOCTL
716b2bb7fSKent Gibson*********************************
816b2bb7fSKent Gibson.. warning::
916b2bb7fSKent Gibson    This ioctl is part of chardev_v1.rst and is obsoleted by
1016b2bb7fSKent Gibson    gpio-v2-line-set-values-ioctl.rst.
1116b2bb7fSKent Gibson
1216b2bb7fSKent GibsonName
1316b2bb7fSKent Gibson====
1416b2bb7fSKent Gibson
1516b2bb7fSKent GibsonGPIO_HANDLE_SET_LINE_VALUES_IOCTL - Set the values of all requested output lines.
1616b2bb7fSKent Gibson
1716b2bb7fSKent GibsonSynopsis
1816b2bb7fSKent Gibson========
1916b2bb7fSKent Gibson
2016b2bb7fSKent Gibson.. c:macro:: GPIO_HANDLE_SET_LINE_VALUES_IOCTL
2116b2bb7fSKent Gibson
2216b2bb7fSKent Gibson``int ioctl(int handle_fd, GPIO_HANDLE_SET_LINE_VALUES_IOCTL, struct gpiohandle_data *values)``
2316b2bb7fSKent Gibson
2416b2bb7fSKent GibsonArguments
2516b2bb7fSKent Gibson=========
2616b2bb7fSKent Gibson
2716b2bb7fSKent Gibson``handle_fd``
2816b2bb7fSKent Gibson    The file descriptor of the GPIO character device, as returned in the
2916b2bb7fSKent Gibson    :c:type:`request.fd<gpiohandle_request>` by gpio-get-linehandle-ioctl.rst.
3016b2bb7fSKent Gibson
3116b2bb7fSKent Gibson``values``
3216b2bb7fSKent Gibson    The :c:type:`line_values<gpiohandle_data>` to set.
3316b2bb7fSKent Gibson
3416b2bb7fSKent GibsonDescription
3516b2bb7fSKent Gibson===========
3616b2bb7fSKent Gibson
3716b2bb7fSKent GibsonSet the values of all requested output lines.
3816b2bb7fSKent Gibson
39*5ca84d41SKent GibsonThe values set are logical, indicating if the line is to be active or inactive.
40*5ca84d41SKent GibsonThe ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` flag controls the mapping between logical
41*5ca84d41SKent Gibsonvalues (active/inactive) and physical values (high/low).
42*5ca84d41SKent GibsonIf  ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is not set then active is high and
43*5ca84d41SKent Gibsoninactive is low. If ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is set then active is low
44*5ca84d41SKent Gibsonand inactive is high.
45*5ca84d41SKent Gibson
4616b2bb7fSKent GibsonOnly the values of output lines may be set.
4716b2bb7fSKent GibsonAttempting to set the value of input lines is an error (**EPERM**).
4816b2bb7fSKent Gibson
4916b2bb7fSKent GibsonReturn Value
5016b2bb7fSKent Gibson============
5116b2bb7fSKent Gibson
5216b2bb7fSKent GibsonOn success 0.
5316b2bb7fSKent Gibson
5416b2bb7fSKent GibsonOn error -1 and the ``errno`` variable is set appropriately.
5516b2bb7fSKent GibsonCommon error codes are described in error-codes.rst.
56