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