← Documents Documentation/userspace-api/gpio/gpio-get-lineinfo-ioctl.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API

GPIO_GET_LINEINFO_IOCTL

ABI v1 line metadata 조회와 실제 line 값 접근의 차이 및 반환 규약을 설명합니다.

Source pathDocumentation/userspace-api/gpio/gpio-get-lineinfo-ioctl.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

gpio-get-lineinfo-ioctl.rst:1-54

ABI v1 line metadata 조회와 실제 line 값 접근의 차이 및 반환 규약을 설명합니다.

원문의 ioctl prototype, struct, flag, errno, source path와 줄 좌표를 보존해 전문 번역했습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 .. _GPIO_GET_LINEINFO_IOCTL:
4
5 ***********************
6 GPIO_GET_LINEINFO_IOCTL
7 ***********************
8
9 .. warning::
10 This ioctl is part of chardev_v1.rst and is obsoleted by
11 gpio-v2-get-lineinfo-ioctl.rst.
12
13 Name
14 ====
15
16 GPIO_GET_LINEINFO_IOCTL - Get the publicly available information for a line.
17
18 Synopsis
19 ========
20
21 .. c:macro:: GPIO_GET_LINEINFO_IOCTL
22
23 ``int ioctl(int chip_fd, GPIO_GET_LINEINFO_IOCTL, struct gpioline_info *info)``
24
25 Arguments
26 =========
27
28 ``chip_fd``
29 The file descriptor of the GPIO character device returned by `open()`.
30
31 ``info``
32 The :c:type:`line_info<gpioline_info>` to be populated, with the
33 ``offset`` field set to indicate the line to be collected.
34
35 Description
36 ===========
37
38 Get the publicly available information for a line.
39
40 This information is available independent of whether the line is in use.
41
42 .. note::
43 The line info does not include the line value.
44
45 The line must be requested using gpio-get-linehandle-ioctl.rst or
46 gpio-get-lineevent-ioctl.rst to access its value.
47
48 Return Value
49 ============
50
51 On success 0 and ``info`` is populated with the chip info.
52
53 On error -1 and the ``errno`` variable is set appropriately.
54 Common error codes are described in error-codes.rst.
55

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

상태, 이름, 호출 형식

1-34

`GPIO_GET_LINEINFO_IOCTL`은 한 GPIO line에 관해 공개 가능한 정보를 가져옵니다. 이 ioctl은 `chardev_v1.rst`의 ABI v1에 속하며 `gpio-v2-get-lineinfo-ioctl.rst`로 대체되었습니다.

호출 형식은 `int ioctl(int chip_fd, GPIO_GET_LINEINFO_IOCTL, struct gpioline_info *info)`입니다. `chip_fd`는 GPIO character device를 `open()`해 얻습니다. `info`는 kernel이 채울 `gpioline_info` 구조체이며, 조회할 line을 지정하도록 호출 전에 `offset` field를 설정해야 합니다.

Line info 조회 인자
항목설명
chip_fdGPIO character device file descriptor
info.offset조회할 line offset
info채워질 struct gpioline_info

입출력 구조체의 offset이 조회 대상을 선택합니다.

.. SPDX-License-Identifier: GPL-2.0

.. _GPIO_GET_LINEINFO_IOCTL:

***********************
GPIO_GET_LINEINFO_IOCTL
***********************

.. warning::
    This ioctl is part of chardev_v1.rst and is obsoleted by
    gpio-v2-get-lineinfo-ioctl.rst.

Name
====

GPIO_GET_LINEINFO_IOCTL - Get the publicly available information for a line.

Synopsis
========

.. c:macro:: GPIO_GET_LINEINFO_IOCTL

``int ioctl(int chip_fd, GPIO_GET_LINEINFO_IOCTL, struct gpioline_info *info)``

Arguments
=========

``chip_fd``
    The file descriptor of the GPIO character device returned by `open()`.

``info``
    The :c:type:`line_info<gpioline_info>` to be populated, with the
    ``offset`` field set to indicate the line to be collected.

조회 범위와 값 접근 제한

35-47

호출은 한 line의 공개 정보를 가져오며, 해당 line이 현재 사용 중인지와 관계없이 조회할 수 있습니다.

Line info에는 line 값이 포함되지 않습니다. 값을 읽으려면 `gpio-get-linehandle-ioctl.rst` 또는 `gpio-get-lineevent-ioctl.rst`로 line을 먼저 요청해야 합니다.

Line 정보와 값 접근
info.offset에 line 지정GPIO_GET_LINEINFO_IOCTL로 공개 정보 조회Line 값은 반환되지 않음값이 필요하면 line handle 또는 line event 요청

Metadata 조회와 실제 값 접근은 서로 다른 ABI 경로입니다.

Description
===========

Get the publicly available information for a line.

This information is available independent of whether the line is in use.

.. note::
    The line info does not include the line value.

    The line must be requested using gpio-get-linehandle-ioctl.rst or
    gpio-get-lineevent-ioctl.rst to access its value.

반환값

48-54

성공하면 0을 반환하고 `info`를 채웁니다. 원문은 이 결과를 chip info라고 표현하지만, 인자와 본문 문맥상 조회한 line의 `gpioline_info`를 뜻합니다. 실패하면 -1을 반환하고 `errno`를 설정하며 공통 오류는 `error-codes.rst`를 따릅니다.

Return Value
============

On success 0 and ``info`` is populated with the chip info.

On error -1 and the ``errno`` variable is set appropriately.
Common error codes are described in error-codes.rst.