← Documents Documentation/userspace-api/media/rc/rc-sysfs-nodes.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / Remote Controller

Remote Controller sysfs node

RC receiver의 protocol 선택, 일반 scancode filter와 wakeup filter를 제어하는 sysfs ABI를 설명합니다.

Source pathDocumentation/userspace-api/media/rc/rc-sysfs-nodes.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

rc-sysfs-nodes.rst:1-144

`/sys/class/rc/rcN/` 아래의 node는 receiver protocol과 scancode filter를 제어합니다. 일반 filter는 일치하지 않는 입력을 버리고, wakeup filter는 일치하는 입력으로 system을 깨운다는 방향 차이가 핵심입니다. Hardware 지원 여부와 protocol 변경에 따른 0 reset 가능성을 함께 확인해야 합니다.

2. 영어 원문 전체

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

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

3. 한국어 전문 번역

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

Remote Controller sysfs node 개요

1-12

`Documentation/ABI/testing/sysfs-class-rc`에 정의된 다음 sysfs node는 Remote Controller를 제어합니다. 이 문서는 각 경로에서 읽거나 쓸 수 있는 값과 실패 조건을 설명합니다.

.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later

.. _remote_controllers_sysfs_nodes:

*******************************
Remote Controller's sysfs nodes
*******************************

As defined at Documentation/ABI/testing/sysfs-class-rc, those are
the sysfs nodes that control the Remote Controllers:

/sys/class/rc/

13-21

`/sys/class/rc/` class 하위 directory는 Remote Controller core에 속합니다. 적외선 remote controller receiver를 설정하는 sysfs interface를 제공합니다.

RC class 역할
항목설명
경로/sys/class/rc/
소유 subsystemRemote Controller core
용도Infrared remote controller receiver 설정

Remote Controller core가 노출하는 최상위 sysfs 경로입니다.

.. _sys_class_rc:

/sys/class/rc/
==============

The ``/sys/class/rc/`` class sub-directory belongs to the Remote
Controller core and provides a sysfs interface for configuring infrared
remote controller receivers.

/sys/class/rc/rcN/

22-30

각 remote control receiver device마다 `/sys/class/rc/rcN` directory가 하나 생성됩니다. `N`은 해당 receiver의 번호입니다.


.. _sys_class_rc_rcN:

/sys/class/rc/rcN/
==================

A ``/sys/class/rc/rcN`` directory is created for each remote control
receiver device where N is the number of the receiver.

/sys/class/rc/rcN/protocols

31-54

이 file을 읽으면 사용할 수 있는 protocol 목록이 반환됩니다. 대괄호 `[]`로 둘러싸인 protocol이 현재 활성화된 protocol입니다.

rc5 [rc6] nec jvc [sony]
protocol 쓰기 명령
쓰기 값동작
+proto기존 활성 목록에 proto 추가
-proto활성 목록에서 proto 제거
protoproto 하나만 활성화
none모든 protocol 비활성화

쓰기 문자열에 따라 활성 protocol 집합을 변경합니다.

유효하지 않은 protocol 조합이나 알 수 없는 protocol 이름을 쓰면 write는 `EINVAL`로 실패합니다.


.. _sys_class_rc_rcN_protocols:

/sys/class/rc/rcN/protocols
===========================

Reading this file returns a list of available protocols, something like::

	rc5 [rc6] nec jvc [sony]

Enabled protocols are shown in [] brackets.

Writing "+proto" will add a protocol to the list of enabled protocols.

Writing "-proto" will remove a protocol from the list of enabled
protocols.

Writing "proto" will enable only "proto".

Writing "none" will disable all protocols.

Write fails with ``EINVAL`` if an invalid protocol combination or unknown
protocol name is used.

/sys/class/rc/rcN/filter

55-69

`filter`는 scancode filter가 기대하는 값을 설정합니다. `/sys/class/rc/rcN/filter_mask`와 함께 사용해 mask에서 1인 bit가 어떤 값을 가져야 하는지 지정합니다.

Hardware가 filtering을 지원하면 filter와 일치하지 않는 scancode를 무시합니다. 지원하지 않으면 write가 error로 실패합니다. 현재 protocol을 바꾸면 이 값은 0으로 reset될 수 있습니다.

일반 scancode filter
filter_mask에서 비교할 bit 선택filter에 선택된 bit의 expected value 설정수신 scancode와 선택 bit 비교일치하지 않으면 scancode 무시

mask가 선택한 bit를 expected value와 비교합니다.


.. _sys_class_rc_rcN_filter:

/sys/class/rc/rcN/filter
========================

Sets the scancode filter expected value.

Use in combination with ``/sys/class/rc/rcN/filter_mask`` to set the
expected value of the bits set in the filter mask. If the hardware
supports it then scancodes which do not match the filter will be
ignored. Otherwise the write will fail with an error.

This value may be reset to 0 if the current protocol is altered.

/sys/class/rc/rcN/filter_mask

70-85

`filter_mask`는 비교할 scancode bit의 mask를 설정합니다. `/sys/class/rc/rcN/filter`와 함께 사용해 expected value와 비교할 bit를 고릅니다.

값이 0이면 filter를 비활성화하여 유효한 모든 scancode를 처리합니다. Hardware가 filtering을 지원하지 않으면 write가 error로 실패하며, 현재 protocol이 변경되면 값이 0으로 reset될 수 있습니다.

일반 filter 조합
항목설명
filtermask가 선택한 bit의 expected value
filter_mask비교할 scancode bit 선택
filter_mask = 0filter 비활성화, 모든 유효 scancode 허용
현재 protocol 변경filter와 filter_mask가 0으로 reset될 수 있음

filter와 mask의 역할 및 protocol 변경 효과입니다.


.. _sys_class_rc_rcN_filter_mask:

/sys/class/rc/rcN/filter_mask
=============================

Sets the scancode filter mask of bits to compare. Use in combination
with ``/sys/class/rc/rcN/filter`` to set the bits of the scancode which
should be compared against the expected value. A value of 0 disables the
filter to allow all valid scancodes to be processed.

If the hardware supports it then scancodes which do not match the filter
will be ignored. Otherwise the write will fail with an error.

This value may be reset to 0 if the current protocol is altered.

/sys/class/rc/rcN/wakeup_protocols

86-113

이 file을 읽으면 wakeup filter에 사용할 수 있는 protocol 목록이 반환됩니다. 가능한 경우 `nec`, `sony`, `rc-5`, `rc-6` 같은 protocol의 bit 길이별 variant가 모두 별도 항목으로 표시됩니다.

rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce

대괄호 `[]` 안의 항목이 현재 활성 wakeup protocol입니다. Wakeup protocol은 한 번에 하나만 선택할 수 있습니다.

wakeup protocol 쓰기 명령
쓰기 값동작
protowakeup event에 proto 사용
nonewakeup 비활성화

일반 protocols node와 달리 하나의 protocol만 선택합니다.

유효하지 않은 protocol 조합, 알 수 없는 protocol 이름, 또는 hardware가 wakeup을 지원하지 않는 경우 write는 `EINVAL`로 실패합니다.


.. _sys_class_rc_rcN_wakeup_protocols:

/sys/class/rc/rcN/wakeup_protocols
==================================

Reading this file returns a list of available protocols to use for the
wakeup filter, something like::

	rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce

Note that protocol variants are listed, so ``nec``, ``sony``, ``rc-5``, ``rc-6``
have their different bit length encodings listed if available.

Note that all protocol variants are listed.

The enabled wakeup protocol is shown in [] brackets.

Only one protocol can be selected at a time.

Writing "proto" will use "proto" for wakeup events.

Writing "none" will disable wakeup.

Write fails with ``EINVAL`` if an invalid protocol combination or unknown
protocol name is used, or if wakeup is not supported by the hardware.

/sys/class/rc/rcN/wakeup_filter

114-128

`wakeup_filter`는 scancode wakeup filter가 기대하는 값을 설정합니다. `/sys/class/rc/rcN/wakeup_filter_mask`에서 선택한 bit가 이 값과 일치하면 system wake event를 발생시킵니다.

Hardware가 이를 지원하고 `wakeup_filter_mask`가 0이 아니면 filter와 일치하는 scancode가 suspend-to-RAM이나 power-off 상태에서 system을 깨웁니다. 그렇지 않으면 write가 error로 실패합니다. Wakeup protocol을 변경하면 값이 0으로 reset될 수 있습니다.

wakeup scancode filter
wakeup_filter_mask에서 비교할 bit 선택wakeup_filter에 expected value 설정저전력 상태에서 scancode 수신선택 bit가 일치하면 system wake event 발생

일반 filter와 달리 일치하는 scancode가 system wakeup을 유발합니다.

.. _sys_class_rc_rcN_wakeup_filter:

/sys/class/rc/rcN/wakeup_filter
===============================

Sets the scancode wakeup filter expected value. Use in combination with
``/sys/class/rc/rcN/wakeup_filter_mask`` to set the expected value of
the bits set in the wakeup filter mask to trigger a system wake event.

If the hardware supports it and wakeup_filter_mask is not 0 then
scancodes which match the filter will wake the system from e.g. suspend
to RAM or power off. Otherwise the write will fail with an error.

This value may be reset to 0 if the wakeup protocol is altered.

/sys/class/rc/rcN/wakeup_filter_mask

129-144

`wakeup_filter_mask`는 wakeup 판단에서 비교할 scancode bit를 선택합니다. `/sys/class/rc/rcN/wakeup_filter`와 조합해 system wake event를 일으킬 expected value와 비교 범위를 정합니다.

Hardware가 이를 지원하고 mask가 0이 아니면 filter와 일치하는 scancode가 suspend-to-RAM이나 power-off 상태에서 system을 깨웁니다. 지원하지 않으면 write가 error로 실패하고, wakeup protocol이 변경되면 mask는 0으로 reset될 수 있습니다.

wakeup filter 조합
항목설명
wakeup_filtermask가 선택한 bit의 expected value
wakeup_filter_maskwakeup 판단에서 비교할 scancode bit 선택
wakeup_filter_mask != 0지원 hardware에서 일치하는 scancode가 system wakeup 유발
wakeup protocol 변경wakeup_filter와 mask가 0으로 reset될 수 있음

wakeup_filter와 mask의 역할 및 protocol 변경 효과입니다.


.. _sys_class_rc_rcN_wakeup_filter_mask:

/sys/class/rc/rcN/wakeup_filter_mask
====================================

Sets the scancode wakeup filter mask of bits to compare. Use in
combination with ``/sys/class/rc/rcN/wakeup_filter`` to set the bits of
the scancode which should be compared against the expected value to
trigger a system wake event.

If the hardware supports it and wakeup_filter_mask is not 0 then
scancodes which match the filter will wake the system from e.g. suspend
to RAM or power off. Otherwise the write will fail with an error.

This value may be reset to 0 if the wakeup protocol is altered.