요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
.. _GPIOHANDLE_SET_CONFIG_IOCTL:
***************************
GPIOHANDLE_SET_CONFIG_IOCTL
***************************
.. warning::
This ioctl is part of chardev_v1.rst and is obsoleted by
gpio-v2-line-set-config-ioctl.rst.
Name
====
GPIOHANDLE_SET_CONFIG_IOCTL - Update the configuration of previously requested lines.
Synopsis
========
.. c:macro:: GPIOHANDLE_SET_CONFIG_IOCTL
``int ioctl(int handle_fd, GPIOHANDLE_SET_CONFIG_IOCTL, struct gpiohandle_config *config)``
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.
``config``
The new :c:type:`configuration<gpiohandle_config>` to apply to the
requested lines.
Description
===========
Update the configuration of previously requested lines, without releasing the
line or introducing potential glitches.
The configuration applies to all requested lines.
The same :ref:`gpio-get-linehandle-config-rules` and
:ref:`gpio-get-linehandle-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. Requesting an invalid
configuration, including without a direction flag set, is an error
(**EINVAL**).
The motivating use case for this command is changing direction of
bi-directional lines between input and output, but it may be used more
generally to move lines seamlessly from one configuration state to another.
To only change the value of output lines, use
gpio-handle-set-line-values-ioctl.rst.
First added in 5.5.
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-34`GPIOHANDLE_SET_CONFIG_IOCTL`은 이미 요청한 GPIO line의 configuration을 갱신합니다. ABI v1 ioctl이며 `gpio-v2-line-set-config-ioctl.rst`로 대체되었습니다.
호출 형식은 `int ioctl(int handle_fd, GPIOHANDLE_SET_CONFIG_IOCTL, struct gpiohandle_config *config)`입니다. `handle_fd`는 line handle descriptor이고 `config`는 요청한 line에 적용할 새 `gpiohandle_config`입니다.
기존 handle의 모든 line에 새 구성을 적용합니다.
.. SPDX-License-Identifier: GPL-2.0
.. _GPIOHANDLE_SET_CONFIG_IOCTL:
***************************
GPIOHANDLE_SET_CONFIG_IOCTL
***************************
.. warning::
This ioctl is part of chardev_v1.rst and is obsoleted by
gpio-v2-line-set-config-ioctl.rst.
Name
====
GPIOHANDLE_SET_CONFIG_IOCTL - Update the configuration of previously requested lines.
Synopsis
========
.. c:macro:: GPIOHANDLE_SET_CONFIG_IOCTL
``int ioctl(int handle_fd, GPIOHANDLE_SET_CONFIG_IOCTL, struct gpiohandle_config *config)``
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.
``config``
The new :c:type:`configuration<gpiohandle_config>` to apply to the
requested lines.
무중단 재구성과 제약
35-59Line을 해제하거나 잠재적인 glitch를 만들지 않고 이미 요청한 line의 구성을 갱신합니다. 새 구성은 handle에 포함된 모든 line에 적용됩니다.
Line을 처음 요청할 때 적용한 `gpio-get-linehandle-config-rules`와 `gpio-get-linehandle-config-support`가 갱신에도 그대로 적용됩니다. 추가로 방향 flag를 반드시 설정해야 합니다. 방향 flag가 없거나 그 밖에 유효하지 않은 구성이면 `EINVAL`입니다.
주요 사용 사례는 bidirectional line을 input과 output 사이에서 전환하는 것이지만, 일반적으로 line을 한 구성 상태에서 다른 상태로 끊김 없이 옮기는 데 사용할 수 있습니다. Output line의 값만 바꾸려면 `gpio-handle-set-line-values-ioctl.rst`를 사용합니다. 이 ioctl은 Linux 5.5에서 처음 추가되었습니다.
기존 요청 규칙에 방향 flag 필수 조건이 추가됩니다.
Handle과 소유권을 유지한 채 구성 상태를 바꿉니다.
Description
===========
Update the configuration of previously requested lines, without releasing the
line or introducing potential glitches.
The configuration applies to all requested lines.
The same :ref:`gpio-get-linehandle-config-rules` and
:ref:`gpio-get-linehandle-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. Requesting an invalid
configuration, including without a direction flag set, is an error
(**EINVAL**).
The motivating use case for this command is changing direction of
bi-directional lines between input and output, but it may be used more
generally to move lines seamlessly from one configuration state to another.
To only change the value of output lines, use
gpio-handle-set-line-values-ioctl.rst.
First added in 5.5.
반환값
60-66성공하면 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-config-ioctl.rst:1-66기존 line handle을 유지한 채 모든 requested line을 무중단 재구성하는 ioctl과 제약을 설명합니다.
원문의 read/ioctl prototype, struct, flag, errno, clock, buffer 규칙과 줄 좌표를 보존해 전문 번역했습니다.