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

Linux 6.18.37 · ABI / testing

Remote Controller class sysfs ABI

Infrared remote receiver별 protocol 선택, scancode filter와 system wakeup filter 구성을 설명합니다.

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

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

1. 요약·해설

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

Remote Controller class and receiver

sysfs-class-rc:1-17

Remote Controller core가 각 infrared receiver를 /sys/class/rc/rcN directory로 제공합니다.

Runtime protocol selection

sysfs-class-rc:18-41

Available protocol 목록에서 bracket으로 enabled 항목을 표시하고 add, remove, exclusive enable, disable-all 쓰기를 지원합니다.

Runtime scancode filter

sysfs-class-rc:43-73

filter expected value와 filter_mask를 결합해 비교할 scancode bit를 정하며 mask 0은 모든 valid scancode를 허용합니다.

Wakeup protocol selection

sysfs-class-rc:75-99

Protocol variant별 wakeup encoding을 나열하고 hardware가 지원하는 protocol 하나만 선택하거나 wakeup을 끕니다.

Wakeup scancode filter

sysfs-class-rc:101-137

wakeup_filter와 mask가 일치하는 scancode를 suspend-to-RAM 또는 power-off 상태의 system wake event로 사용합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/class/rc/
2 Date: Apr 2010
3 KernelVersion: 2.6.35
4 Contact: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
5 Description:
6 The rc/ class sub-directory belongs to the Remote Controller
7 core and provides a sysfs interface for configuring infrared
8 remote controller receivers.
9
10 What: /sys/class/rc/rc<N>/
11 Date: Apr 2010
12 KernelVersion: 2.6.35
13 Contact: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
14 Description:
15 A /sys/class/rc/rcN directory is created for each remote
16 control receiver device where N is the number of the receiver.
17
18 What: /sys/class/rc/rc<N>/protocols
19 Date: Jun 2010
20 KernelVersion: 2.6.36
21 Contact: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
22 Description:
23 Reading this file returns a list of available protocols,
24 something like::
25
26 "rc5 [rc6] nec jvc [sony]"
27
28 Enabled protocols are shown in [] brackets.
29
30 Writing "+proto" will add a protocol to the list of enabled
31 protocols.
32
33 Writing "-proto" will remove a protocol from the list of enabled
34 protocols.
35
36 Writing "proto" will enable only "proto".
37
38 Writing "none" will disable all protocols.
39
40 Write fails with EINVAL if an invalid protocol combination or
41 unknown protocol name is used.
42
43 What: /sys/class/rc/rc<N>/filter
44 Date: Jan 2014
45 KernelVersion: 3.15
46 Contact: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
47 Description:
48 Sets the scancode filter expected value.
49
50 Use in combination with /sys/class/rc/rcN/filter_mask to set the
51 expected value of the bits set in the filter mask.
52 If the hardware supports it then scancodes which do not match
53 the filter will be ignored. Otherwise the write will fail with
54 an error.
55
56 This value may be reset to 0 if the current protocol is altered.
57
58 What: /sys/class/rc/rc<N>/filter_mask
59 Date: Jan 2014
60 KernelVersion: 3.15
61 Contact: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
62 Description:
63 Sets the scancode filter mask of bits to compare.
64 Use in combination with /sys/class/rc/rcN/filter to set the bits
65 of the scancode which should be compared against the expected
66 value. A value of 0 disables the filter to allow all valid
67 scancodes to be processed.
68
69 If the hardware supports it then scancodes which do not match
70 the filter will be ignored. Otherwise the write will fail with
71 an error.
72
73 This value may be reset to 0 if the current protocol is altered.
74
75 What: /sys/class/rc/rc<N>/wakeup_protocols
76 Date: Feb 2017
77 KernelVersion: 4.11
78 Contact: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
79 Description:
80 Reading this file returns a list of available protocols to use
81 for the wakeup filter, something like::
82
83 "rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce"
84
85 Note that protocol variants are listed, so "nec", "sony",
86 "rc-5", "rc-6" have their different bit length encodings
87 listed if available.
88
89 The enabled wakeup protocol is shown in [] brackets.
90
91 Only one protocol can be selected at a time.
92
93 Writing "proto" will use "proto" for wakeup events.
94
95 Writing "none" will disable wakeup.
96
97 Write fails with EINVAL if an invalid protocol combination or
98 unknown protocol name is used, or if wakeup is not supported by
99 the hardware.
100
101 What: /sys/class/rc/rc<N>/wakeup_filter
102 Date: Jan 2014
103 KernelVersion: 3.15
104 Contact: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
105 Description:
106 Sets the scancode wakeup filter expected value.
107
108 Use in combination with /sys/class/rc/rcN/wakeup_filter_mask to
109 set the expected value of the bits set in the wakeup filter mask
110 to trigger a system wake event.
111
112 If the hardware supports it and wakeup_filter_mask is not 0 then
113 scancodes which match the filter will wake the system from e.g.
114 suspend to RAM or power off.
115
116 Otherwise the write will fail with an error.
117
118 This value may be reset to 0 if the wakeup protocol is altered.
119
120 What: /sys/class/rc/rc<N>/wakeup_filter_mask
121 Date: Jan 2014
122 KernelVersion: 3.15
123 Contact: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
124 Description:
125 Sets the scancode wakeup filter mask of bits to compare.
126
127 Use in combination with /sys/class/rc/rcN/wakeup_filter to set
128 the bits of the scancode which should be compared against the
129 expected value to trigger a system wake event.
130
131 If the hardware supports it and wakeup_filter_mask is not 0 then
132 scancodes which match the filter will wake the system from e.g.
133 suspend to RAM or power off.
134
135 Otherwise the write will fail with an error.
136
137 This value may be reset to 0 if the wakeup protocol is altered.
138

3. 한국어 전문 번역

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

Remote Controller core class

1-8
항목한국어 전문 번역
What/sys/class/rc/
Date2010년 4월
KernelVersion2.6.35
ContactMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Descriptionrc/ class subdirectory는 Remote Controller core에 속하며 infrared remote controller receiver를 구성하는 sysfs interface를 제공합니다.

Remote control receiver instance

10-16
항목한국어 전문 번역
What/sys/class/rc/rc<N>/
Date2010년 4월
KernelVersion2.6.35
ContactMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Description각 remote control receiver device마다 /sys/class/rc/rcN directory를 생성하며 N은 receiver 번호입니다.

Enabled infrared protocols

18-41
항목한국어 전문 번역
What/sys/class/rc/rc<N>/protocols
Date2010년 6월
KernelVersion2.6.36
ContactMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Description읽으면 available protocol 목록을 반환하고 enabled protocol은 [] bracket 안에 표시합니다. "+proto"를 쓰면 enabled 목록에 protocol을 추가하고, "-proto"는 제거하며, "proto"는 해당 protocol만 enable합니다. "none"은 모든 protocol을 disable합니다. Invalid protocol 조합이나 unknown protocol name이면 write가 EINVAL로 실패합니다.
"rc5 [rc6] nec jvc [sony]"
RC protocol write commands
Write동작
+protoEnabled protocol 목록에 proto 추가
-protoEnabled protocol 목록에서 proto 제거
protoproto만 enable
none모든 protocol disable

protocols attribute에 쓰는 값과 enabled set 변화입니다.

Scancode filter expected value

43-56
항목한국어 전문 번역
What/sys/class/rc/rc<N>/filter
Date2014년 1월
KernelVersion3.15
ContactMauro Carvalho Chehab <mchehab+samsung@kernel.org>
DescriptionScancode filter의 expected value를 설정합니다. /sys/class/rc/rcN/filter_mask와 함께 사용해 mask에서 set된 bit의 expected value를 지정합니다. Hardware가 지원하면 filter와 일치하지 않는 scancode를 무시하고, 지원하지 않으면 write가 error로 실패합니다. Current protocol을 바꾸면 이 값이 0으로 reset될 수 있습니다.

Scancode filter comparison mask

58-73
항목한국어 전문 번역
What/sys/class/rc/rc<N>/filter_mask
Date2014년 1월
KernelVersion3.15
ContactMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Description비교할 scancode bit의 filter mask를 설정합니다. /sys/class/rc/rcN/filter와 함께 사용해 expected value와 비교할 scancode bit를 정합니다. 0은 filter를 disable하여 모든 valid scancode를 처리하게 합니다. Hardware가 지원하면 일치하지 않는 scancode를 무시하고, 지원하지 않으면 write가 error로 실패합니다. Current protocol을 바꾸면 이 값이 0으로 reset될 수 있습니다.
Runtime scancode filter pair
Attribute역할특수 상태
filterMasked bit의 expected valueProtocol 변경 시 0 reset 가능
filter_mask비교할 scancode bit 선택0이면 모든 valid scancode 허용

filter는 expected value, filter_mask는 실제 비교할 bit를 정합니다.

Wakeup protocol selection

75-99
항목한국어 전문 번역
What/sys/class/rc/rc<N>/wakeup_protocols
Date2017년 2월
KernelVersion4.11
ContactMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Description읽으면 wakeup filter에 사용할 available protocol을 반환합니다. nec, sony, rc-5, rc-6 등의 bit-length encoding variant를 available한 범위에서 따로 나열하고, enabled wakeup protocol은 [] bracket 안에 표시합니다. 한 번에 protocol 하나만 선택할 수 있습니다. "proto"를 쓰면 wakeup event에 해당 protocol을 사용하고 "none"은 wakeup을 disable합니다. Invalid 조합, unknown protocol, 또는 hardware가 wakeup을 지원하지 않으면 write가 EINVAL로 실패합니다.
"rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce"
Wakeup protocol rules
Write 또는 표기의미
[proto]현재 enabled wakeup protocol
proto해당 protocol을 wakeup event에 사용
noneWakeup disable
Selection count최대 1개

Runtime protocols와 달리 wakeup protocol은 하나만 선택합니다.

Wakeup scancode expected value

101-118
항목한국어 전문 번역
What/sys/class/rc/rc<N>/wakeup_filter
Date2014년 1월
KernelVersion3.15
ContactMauro Carvalho Chehab <mchehab+samsung@kernel.org>
DescriptionScancode wakeup filter의 expected value를 설정합니다. /sys/class/rc/rcN/wakeup_filter_mask와 함께 사용해 system wake event를 trigger할 mask bit의 expected value를 지정합니다. Hardware가 지원하고 wakeup_filter_mask가 0이 아니면 filter와 일치하는 scancode가 suspend-to-RAM 또는 power-off 같은 상태에서 system을 깨웁니다. 그 밖에는 write가 error로 실패합니다. Wakeup protocol을 바꾸면 이 값이 0으로 reset될 수 있습니다.

Wakeup scancode comparison mask

120-137
항목한국어 전문 번역
What/sys/class/rc/rc<N>/wakeup_filter_mask
Date2014년 1월
KernelVersion3.15
ContactMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Description비교할 scancode bit의 wakeup filter mask를 설정합니다. /sys/class/rc/rcN/wakeup_filter와 함께 사용해 system wake event를 trigger할 expected value와 비교할 scancode bit를 정합니다. Hardware가 지원하고 wakeup_filter_mask가 0이 아니면 filter와 일치하는 scancode가 suspend-to-RAM 또는 power-off 상태에서 system을 깨웁니다. 그 밖에는 write가 error로 실패합니다. Wakeup protocol을 바꾸면 이 값이 0으로 reset될 수 있습니다.
RC wakeup filter path
Wakeup protocol 하나 선택wakeup_filter expected value 설정wakeup_filter_mask에서 비교 bit 선택Matching scancodeSystem wake event

선택한 protocol과 nonzero mask에 맞는 scancode만 system wake event가 됩니다.