요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. _GPIO_HANDLE_SET_LINE_VALUES_IOCTL:
*********************************
GPIO_HANDLE_SET_LINE_VALUES_IOCTL
*********************************
.. warning::
This ioctl is part of chardev_v1.rst and is obsoleted by
gpio-v2-line-set-values-ioctl.rst.
Name
====
GPIO_HANDLE_SET_LINE_VALUES_IOCTL - Set the values of all requested output lines.
Synopsis
========
.. c:macro:: GPIO_HANDLE_SET_LINE_VALUES_IOCTL
``int ioctl(int handle_fd, GPIO_HANDLE_SET_LINE_VALUES_IOCTL, struct gpiohandle_data *values)``
Arguments
=========
``handle_fd``
The file descriptor of the GPIO character device, as returned in the
:c:type:`request.fd<gpiohandle_request>` by gpio-get-linehandle-ioctl.rst.
``values``
The :c:type:`line_values<gpiohandle_data>` to set.
Description
===========
Set the values of all requested output lines.
The values set are logical, indicating if the line is to be active or inactive.
The ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` flag controls the mapping between logical
values (active/inactive) and physical values (high/low).
If ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is not set then active is high and
inactive is low. If ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is set then active is low
and inactive is high.
Only the values of output lines may be set.
Attempting to set the value of input lines is an error (**EPERM**).
Return Value
============
On success 0.
On error -1 and the ``errno`` variable is set appropriately.
Common error codes are described in error-codes.rst.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
상태, 이름, 호출 형식
1-33`GPIO_HANDLE_SET_LINE_VALUES_IOCTL`은 요청한 모든 output line의 값을 설정합니다. ABI v1 ioctl이며 `gpio-v2-line-set-values-ioctl.rst`로 대체되었습니다.
호출 형식은 `int ioctl(int handle_fd, GPIO_HANDLE_SET_LINE_VALUES_IOCTL, struct gpiohandle_data *values)`입니다. `handle_fd`는 line handle descriptor이고 `values`는 적용할 logical value를 담은 `gpiohandle_data` 구조체입니다.
Handle의 output line에 logical value를 한 번에 적용합니다.
.. SPDX-License-Identifier: GPL-2.0
.. _GPIO_HANDLE_SET_LINE_VALUES_IOCTL:
*********************************
GPIO_HANDLE_SET_LINE_VALUES_IOCTL
*********************************
.. warning::
This ioctl is part of chardev_v1.rst and is obsoleted by
gpio-v2-line-set-values-ioctl.rst.
Name
====
GPIO_HANDLE_SET_LINE_VALUES_IOCTL - Set the values of all requested output lines.
Synopsis
========
.. c:macro:: GPIO_HANDLE_SET_LINE_VALUES_IOCTL
``int ioctl(int handle_fd, GPIO_HANDLE_SET_LINE_VALUES_IOCTL, struct gpiohandle_data *values)``
Arguments
=========
``handle_fd``
The file descriptor of the GPIO character device, as returned in the
:c:type:`request.fd<gpiohandle_request>` by gpio-get-linehandle-ioctl.rst.
``values``
The :c:type:`line_values<gpiohandle_data>` to set.
Polarity 변환과 output 제한
34-48설정하는 값은 line을 active 또는 inactive로 만들지를 나타내는 logical value입니다. `GPIOHANDLE_REQUEST_ACTIVE_LOW`가 logical active/inactive를 physical high/low로 변환하는 방식을 결정합니다.
`GPIOHANDLE_REQUEST_ACTIVE_LOW`가 없으면 active는 high, inactive는 low입니다. Flag가 있으면 active는 low, inactive는 high입니다.
Output line의 값만 설정할 수 있습니다. Input line의 값을 설정하려고 하면 `EPERM`입니다.
Logical request가 실제 physical level로 변환되는 규칙입니다.
Line 방향과 polarity를 검증한 뒤 physical level을 적용합니다.
Description
===========
Set the values of all requested output lines.
The values set are logical, indicating if the line is to be active or inactive.
The ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` flag controls the mapping between logical
values (active/inactive) and physical values (high/low).
If ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is not set then active is high and
inactive is low. If ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is set then active is low
and inactive is high.
Only the values of output lines may be set.
Attempting to set the value of input lines is an error (**EPERM**).
반환값
49-55성공하면 0을 반환합니다. 실패하면 -1을 반환하고 `errno`를 설정합니다. 공통 오류 코드는 `error-codes.rst`에 설명되어 있습니다.
Return Value
============
On success 0.
On error -1 and the ``errno`` variable is set appropriately.
Common error codes are described in error-codes.rst.
요약·해설
gpio-handle-set-line-values-ioctl.rst:1-55Output line의 logical value를 설정하고 ACTIVE_LOW polarity를 physical level로 변환하는 규칙을 설명합니다.
원문의 read/ioctl prototype, struct, flag, errno, clock, buffer 규칙과 줄 좌표를 보존해 전문 번역했습니다.