요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. _GPIO_V2_LINE_SET_CONFIG_IOCTL:
*****************************
GPIO_V2_LINE_SET_CONFIG_IOCTL
*****************************
Name
====
GPIO_V2_LINE_SET_CONFIG_IOCTL - Update the configuration of previously requested lines.
Synopsis
========
.. c:macro:: GPIO_V2_LINE_SET_CONFIG_IOCTL
``int ioctl(int req_fd, GPIO_V2_LINE_SET_CONFIG_IOCTL, struct gpio_v2_line_config *config)``
Arguments
=========
``req_fd``
The file descriptor of the GPIO character device, as returned in the
:c:type:`request.fd<gpio_v2_line_request>` by gpio-v2-get-line-ioctl.rst.
``config``
The new :c:type:`configuration<gpio_v2_line_config>` to apply to the
requested lines.
Description
===========
Update the configuration of previously requested lines, without releasing the
line or introducing potential glitches.
The new configuration must specify a configuration for all requested lines.
The same :ref:`gpio-v2-get-line-config-rules` and
:ref:`gpio-v2-get-line-config-support` that apply when requesting the lines
also apply when updating the line configuration, with the additional
restriction that a direction flag must be set to enable reconfiguration.
If no direction flag is set in the configuration for a given line then the
configuration for that line is left unchanged.
The motivating use case for this command is changing direction of
bi-directional lines between input and output, but it may also be used to
dynamically control edge detection, or more generally move lines seamlessly
from one configuration state to another.
To only change the value of output lines, use
gpio-v2-line-set-values-ioctl.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.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
이름, 호출 형식, 인자
1-30`GPIO_V2_LINE_SET_CONFIG_IOCTL`은 이전에 요청한 GPIO line을 release하지 않은 채 configuration을 갱신합니다. 호출 형식은 `int ioctl(int req_fd, GPIO_V2_LINE_SET_CONFIG_IOCTL, struct gpio_v2_line_config *config)`입니다.
`req_fd`는 기존 line 요청 디스크립터이고 `config`는 요청된 line들에 적용할 새 `gpio_v2_line_config`입니다. 요청 소유권과 파일 디스크립터는 그대로 유지됩니다.
기존 요청을 대상으로 전체 configuration을 제출합니다.
.. SPDX-License-Identifier: GPL-2.0
.. _GPIO_V2_LINE_SET_CONFIG_IOCTL:
*****************************
GPIO_V2_LINE_SET_CONFIG_IOCTL
*****************************
Name
====
GPIO_V2_LINE_SET_CONFIG_IOCTL - Update the configuration of previously requested lines.
Synopsis
========
.. c:macro:: GPIO_V2_LINE_SET_CONFIG_IOCTL
``int ioctl(int req_fd, GPIO_V2_LINE_SET_CONFIG_IOCTL, struct gpio_v2_line_config *config)``
Arguments
=========
``req_fd``
The file descriptor of the GPIO character device, as returned in the
:c:type:`request.fd<gpio_v2_line_request>` by gpio-v2-get-line-ioctl.rst.
``config``
The new :c:type:`configuration<gpio_v2_line_config>` to apply to the
requested lines.
전체 구성, 방향 flag, 사용 사례
31-53Line을 release하고 다시 요청하지 않으므로 재요청 사이에 생길 수 있는 glitch를 피하면서 configuration을 바꿀 수 있습니다. 새 configuration은 요청된 모든 line에 대한 구성을 명시해야 합니다.
Line을 처음 요청할 때의 `gpio-v2-get-line-config-rules`와 `gpio-v2-get-line-config-support`가 재구성에도 그대로 적용됩니다. 여기에 재구성을 활성화하려면 direction flag를 설정해야 한다는 제약이 추가됩니다.
특정 line의 configuration에 direction flag가 없으면 그 line의 구성은 변경하지 않습니다. 따라서 전체 요청을 기술하면서 일부 line은 명시적으로 그대로 둘 수 있습니다.
주요 용도는 양방향 line을 input과 output 사이에서 전환하는 것입니다. Edge detection을 동적으로 제어하거나 line을 한 configuration 상태에서 다른 상태로 끊김 없이 옮길 수도 있습니다. 출력 값만 바꿀 때는 `GPIO_V2_LINE_SET_VALUES_IOCTL`을 사용합니다.
동일한 요청 디스크립터를 유지한 채 필요한 line만 전환합니다.
구조 변경과 값 변경은 서로 다른 ioctl을 사용합니다.
Description
===========
Update the configuration of previously requested lines, without releasing the
line or introducing potential glitches.
The new configuration must specify a configuration for all requested lines.
The same :ref:`gpio-v2-get-line-config-rules` and
:ref:`gpio-v2-get-line-config-support` that apply when requesting the lines
also apply when updating the line configuration, with the additional
restriction that a direction flag must be set to enable reconfiguration.
If no direction flag is set in the configuration for a given line then the
configuration for that line is left unchanged.
The motivating use case for this command is changing direction of
bi-directional lines between input and output, but it may also be used to
dynamically control edge detection, or more generally move lines seamlessly
from one configuration state to another.
To only change the value of output lines, use
gpio-v2-line-set-values-ioctl.rst.
반환값
54-61성공하면 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-v2-line-set-config-ioctl.rst:1-61기존 GPIO v2 요청을 유지하면서 방향·edge·bias 등을 glitch 없이 재구성하는 규칙을 설명합니다.
원문의 호출 형식, 구조체, flag, buffer 정책, 오류 코드와 줄 좌표를 보존해 전문 번역했습니다.