← Documents Documentation/ABI/testing/sysfs-class-extcon GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

External connector class sysfs ABI

Extcon object와 cable 이름, atomic global state, cable별 attach 상태와 mutually-exclusive cable 집합 표현을 설명합니다.

Source pathDocumentation/ABI/testing/sysfs-class-extcon
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Object model and name

sysfs-class-extcon:1-29

External connector port 하나에 여러 cable을 동시에 연결하는 extcon model, object 이름과 선택적 show_name callback을 정의합니다.

Atomic global cable state

sysfs-class-extcon:31-66

Cable별 attach·detach 출력과 hexadecimal 전체 상태 쓰기, mutual-exclusion 검증과 여러 cable의 atomic update를 설명합니다.

Cable metadata and exclusion sets

sysfs-class-extcon:68-101

0-31 cable의 이름·binary state와 file 이름으로 인코딩한 mutually_exclusive 집합을 제공합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/class/extcon/.../
2 Date: February 2012
3 Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
4 Description:
5 Provide a place in sysfs for the extcon objects.
6 This allows accessing extcon specific variables.
7 The name of extcon object denoted as ... is the name given
8 with extcon_dev_register.
9
10 One extcon device denotes a single external connector
11 port. An external connector may have multiple cables
12 attached simultaneously. Many of docks, cradles, and
13 accessory cables have such capability. For example,
14 the 30-pin port of Nuri board (/arch/arm/mach-exynos)
15 may have both HDMI and Charger attached, or analog audio,
16 video, and USB cables attached simultaneously.
17
18 If there are cables mutually exclusive with each other,
19 such binary relations may be expressed with extcon_dev's
20 mutually_exclusive array.
21
22 What: /sys/class/extcon/.../name
23 Date: February 2012
24 Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
25 Description:
26 The /sys/class/extcon/.../name shows the name of the extcon
27 object. If the extcon object has an optional callback
28 "show_name" defined, the callback will provide the name with
29 this sysfs node.
30
31 What: /sys/class/extcon/.../state
32 Date: February 2012
33 Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
34 Description:
35 The /sys/class/extcon/.../state shows and stores the cable
36 attach/detach information of the corresponding extcon object.
37 If the extcon object has an optional callback "show_state"
38 defined, the showing function is overridden with the optional
39 callback.
40
41 If the default callback for showing function is used, the
42 format is like this::
43
44 # cat state
45 USB_OTG=1
46 HDMI=0
47 TA=1
48 EAR_JACK=0
49 #
50
51 In this example, the extcon device has USB_OTG and TA
52 cables attached and HDMI and EAR_JACK cables detached.
53
54 In order to update the state of an extcon device, enter a hex
55 state number starting with 0x::
56
57 # echo 0xHEX > state
58
59 This updates the whole state of the extcon device.
60 Inputs of all the methods are required to meet the
61 mutually_exclusive conditions if they exist.
62
63 It is recommended to use this "global" state interface if
64 you need to set the value atomically. The later state
65 interface associated with each cable cannot update
66 multiple cable states of an extcon device simultaneously.
67
68 What: /sys/class/extcon/.../cable.X/name
69 Date: February 2012
70 Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
71 Description:
72 The /sys/class/extcon/.../cable.X/name shows the name of cable
73 "X" (integer between 0 and 31) of an extcon device.
74
75 What: /sys/class/extcon/.../cable.X/state
76 Date: February 2012
77 Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
78 Description:
79 The /sys/class/extcon/.../cable.X/state shows and stores the
80 state of cable "X" (integer between 0 and 31) of an extcon
81 device. The state value is either 0 (detached) or 1
82 (attached).
83
84 What: /sys/class/extcon/.../mutually_exclusive/...
85 Date: December 2011
86 Contact: MyungJoo Ham <myungjoo.ham@samsung.com>
87 Description:
88 Shows the relations of mutually exclusiveness. For example,
89 if the mutually_exclusive array of extcon device is
90 {0x3, 0x5, 0xC, 0x0}, then the output is::
91
92 # ls mutually_exclusive/
93 0x3
94 0x5
95 0xc
96 #
97
98 Note that mutually_exclusive is a sub-directory of the extcon
99 device and the file names under the mutually_exclusive
100 directory show the mutually-exclusive sets, not the contents
101 of the files.
102

3. 한국어 전문 번역

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

External connector object directory

1-20
항목한국어 전문 번역
What/sys/class/extcon/.../
Date2012년 2월
ContactMyungJoo Ham <myungjoo.ham@samsung.com>
DescriptionExtcon object를 위한 sysfs 위치를 제공하며 extcon 전용 변수에 접근할 수 있게 합니다. ...로 표시한 extcon object 이름은 extcon_dev_register에 전달한 이름입니다. Extcon device 하나는 external connector port 하나를 나타냅니다. External connector에는 여러 cable이 동시에 연결될 수 있으며 많은 dock, cradle, accessory cable이 이 기능을 갖습니다. 예를 들어 Nuri board(/arch/arm/mach-exynos)의 30-pin port에는 HDMI와 Charger가 함께 연결되거나 analog audio, video, USB cable이 동시에 연결될 수 있습니다. 서로 배타적인 cable이 있으면 extcon_dev의 mutually_exclusive array로 이러한 이진 관계를 나타낼 수 있습니다.

Extcon object 이름

22-29
항목한국어 전문 번역
What/sys/class/extcon/.../name
Date2012년 2월
ContactMyungJoo Ham <myungjoo.ham@samsung.com>
Description/sys/class/extcon/.../name은 extcon object 이름을 표시합니다. Extcon object에 선택적 callback "show_name"이 정의되어 있으면 이 callback이 해당 sysfs node를 통해 이름을 제공합니다.

Extcon 전체 cable 상태

31-66
항목한국어 전문 번역
What/sys/class/extcon/.../state
Date2012년 2월
ContactMyungJoo Ham <myungjoo.ham@samsung.com>
Description/sys/class/extcon/.../state는 해당 extcon object의 cable attach·detach 정보를 표시하고 저장합니다. Extcon object에 선택적 callback "show_state"가 정의되어 있으면 표시 함수가 이 callback으로 대체됩니다. 기본 표시 callback을 사용하면 아래 예시 형식으로 출력합니다. 이 예시에서는 USB_OTG와 TA cable이 연결되어 있고 HDMI와 EAR_JACK cable은 분리되어 있습니다. Extcon device 상태를 갱신하려면 0x로 시작하는 hexadecimal state number를 입력합니다. 이 쓰기는 extcon device의 전체 상태를 갱신하며 모든 방식의 입력은 mutually_exclusive 조건이 있다면 이를 만족해야 합니다. 값을 atomic하게 설정해야 한다면 이 "global" state interface 사용을 권장합니다. 뒤에서 설명하는 cable별 state interface는 extcon device의 여러 cable 상태를 동시에 갱신할 수 없습니다.
# cat state
USB_OTG=1
HDMI=0
TA=1
EAR_JACK=0
#
# echo 0xHEX > state
Extcon state 출력 예시
Cable상태
USB_OTG1Attached
HDMI0Detached
TA1Attached
EAR_JACK0Detached

1은 attached, 0은 detached인 예시 cable 상태입니다.

Cable별 이름

68-73
항목한국어 전문 번역
What/sys/class/extcon/.../cable.X/name
Date2012년 2월
ContactMyungJoo Ham <myungjoo.ham@samsung.com>
Description/sys/class/extcon/.../cable.X/name은 extcon device의 cable "X" 이름을 표시합니다. X는 0부터 31 사이의 정수입니다.

Cable별 연결 상태

75-82
항목한국어 전문 번역
What/sys/class/extcon/.../cable.X/state
Date2012년 2월
ContactMyungJoo Ham <myungjoo.ham@samsung.com>
Description/sys/class/extcon/.../cable.X/state는 extcon device의 cable "X" 상태를 표시하고 저장합니다. X는 0부터 31 사이의 정수이며 state 값은 0(detached) 또는 1(attached)입니다.
cable.X state 값
상태
0Detached
1Attached

각 cable node에서 사용하는 두 가지 연결 상태입니다.

Cable 상호 배타 관계

84-101
항목한국어 전문 번역
What/sys/class/extcon/.../mutually_exclusive/...
Date2011년 12월
ContactMyungJoo Ham <myungjoo.ham@samsung.com>
DescriptionCable 사이의 상호 배타 관계를 표시합니다. 예를 들어 extcon device의 mutually_exclusive array가 {0x3, 0x5, 0xC, 0x0}이면 아래와 같이 출력됩니다. mutually_exclusive는 extcon device의 sub-directory이며, 그 아래 file 이름이 상호 배타적인 집합을 나타냅니다. File 내용이 집합을 나타내는 것이 아닙니다.
# ls mutually_exclusive/
0x3
0x5
0xc
#
mutually_exclusive file 이름
Array 값Directory entry의미
0x30x3상호 배타 cable 집합
0x50x5상호 배타 cable 집합
0xC0xc상호 배타 cable 집합

Array의 종료값 0x0은 file로 나타나지 않으며 각 file 이름이 배타 집합을 인코딩합니다.