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