162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later 262306a36Sopenharmony_ci 362306a36Sopenharmony_ci.. _remote_controllers_sysfs_nodes: 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci******************************* 662306a36Sopenharmony_ciRemote Controller's sysfs nodes 762306a36Sopenharmony_ci******************************* 862306a36Sopenharmony_ci 962306a36Sopenharmony_ciAs defined at ``Documentation/ABI/testing/sysfs-class-rc``, those are 1062306a36Sopenharmony_cithe sysfs nodes that control the Remote Controllers: 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci.. _sys_class_rc: 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci/sys/class/rc/ 1662306a36Sopenharmony_ci============== 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ciThe ``/sys/class/rc/`` class sub-directory belongs to the Remote 1962306a36Sopenharmony_ciController core and provides a sysfs interface for configuring infrared 2062306a36Sopenharmony_ciremote controller receivers. 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci.. _sys_class_rc_rcN: 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci/sys/class/rc/rcN/ 2662306a36Sopenharmony_ci================== 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ciA ``/sys/class/rc/rcN`` directory is created for each remote control 2962306a36Sopenharmony_cireceiver device where N is the number of the receiver. 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci.. _sys_class_rc_rcN_protocols: 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci/sys/class/rc/rcN/protocols 3562306a36Sopenharmony_ci=========================== 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ciReading this file returns a list of available protocols, something like:: 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_ci rc5 [rc6] nec jvc [sony] 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ciEnabled protocols are shown in [] brackets. 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ciWriting "+proto" will add a protocol to the list of enabled protocols. 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ciWriting "-proto" will remove a protocol from the list of enabled 4662306a36Sopenharmony_ciprotocols. 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ciWriting "proto" will enable only "proto". 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_ciWriting "none" will disable all protocols. 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ciWrite fails with ``EINVAL`` if an invalid protocol combination or unknown 5362306a36Sopenharmony_ciprotocol name is used. 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci.. _sys_class_rc_rcN_filter: 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci/sys/class/rc/rcN/filter 5962306a36Sopenharmony_ci======================== 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ciSets the scancode filter expected value. 6262306a36Sopenharmony_ci 6362306a36Sopenharmony_ciUse in combination with ``/sys/class/rc/rcN/filter_mask`` to set the 6462306a36Sopenharmony_ciexpected value of the bits set in the filter mask. If the hardware 6562306a36Sopenharmony_cisupports it then scancodes which do not match the filter will be 6662306a36Sopenharmony_ciignored. Otherwise the write will fail with an error. 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ciThis value may be reset to 0 if the current protocol is altered. 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci.. _sys_class_rc_rcN_filter_mask: 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ci/sys/class/rc/rcN/filter_mask 7462306a36Sopenharmony_ci============================= 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ciSets the scancode filter mask of bits to compare. Use in combination 7762306a36Sopenharmony_ciwith ``/sys/class/rc/rcN/filter`` to set the bits of the scancode which 7862306a36Sopenharmony_cishould be compared against the expected value. A value of 0 disables the 7962306a36Sopenharmony_cifilter to allow all valid scancodes to be processed. 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ciIf the hardware supports it then scancodes which do not match the filter 8262306a36Sopenharmony_ciwill be ignored. Otherwise the write will fail with an error. 8362306a36Sopenharmony_ci 8462306a36Sopenharmony_ciThis value may be reset to 0 if the current protocol is altered. 8562306a36Sopenharmony_ci 8662306a36Sopenharmony_ci 8762306a36Sopenharmony_ci.. _sys_class_rc_rcN_wakeup_protocols: 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci/sys/class/rc/rcN/wakeup_protocols 9062306a36Sopenharmony_ci================================== 9162306a36Sopenharmony_ci 9262306a36Sopenharmony_ciReading this file returns a list of available protocols to use for the 9362306a36Sopenharmony_ciwakeup filter, something like:: 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce 9662306a36Sopenharmony_ci 9762306a36Sopenharmony_ciNote that protocol variants are listed, so ``nec``, ``sony``, ``rc-5``, ``rc-6`` 9862306a36Sopenharmony_cihave their different bit length encodings listed if available. 9962306a36Sopenharmony_ci 10062306a36Sopenharmony_ciNote that all protocol variants are listed. 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ciThe enabled wakeup protocol is shown in [] brackets. 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ciOnly one protocol can be selected at a time. 10562306a36Sopenharmony_ci 10662306a36Sopenharmony_ciWriting "proto" will use "proto" for wakeup events. 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ciWriting "none" will disable wakeup. 10962306a36Sopenharmony_ci 11062306a36Sopenharmony_ciWrite fails with ``EINVAL`` if an invalid protocol combination or unknown 11162306a36Sopenharmony_ciprotocol name is used, or if wakeup is not supported by the hardware. 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ci.. _sys_class_rc_rcN_wakeup_filter: 11562306a36Sopenharmony_ci 11662306a36Sopenharmony_ci/sys/class/rc/rcN/wakeup_filter 11762306a36Sopenharmony_ci=============================== 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ciSets the scancode wakeup filter expected value. Use in combination with 12062306a36Sopenharmony_ci``/sys/class/rc/rcN/wakeup_filter_mask`` to set the expected value of 12162306a36Sopenharmony_cithe bits set in the wakeup filter mask to trigger a system wake event. 12262306a36Sopenharmony_ci 12362306a36Sopenharmony_ciIf the hardware supports it and wakeup_filter_mask is not 0 then 12462306a36Sopenharmony_ciscancodes which match the filter will wake the system from e.g. suspend 12562306a36Sopenharmony_cito RAM or power off. Otherwise the write will fail with an error. 12662306a36Sopenharmony_ci 12762306a36Sopenharmony_ciThis value may be reset to 0 if the wakeup protocol is altered. 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_ci.. _sys_class_rc_rcN_wakeup_filter_mask: 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci/sys/class/rc/rcN/wakeup_filter_mask 13362306a36Sopenharmony_ci==================================== 13462306a36Sopenharmony_ci 13562306a36Sopenharmony_ciSets the scancode wakeup filter mask of bits to compare. Use in 13662306a36Sopenharmony_cicombination with ``/sys/class/rc/rcN/wakeup_filter`` to set the bits of 13762306a36Sopenharmony_cithe scancode which should be compared against the expected value to 13862306a36Sopenharmony_citrigger a system wake event. 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ciIf the hardware supports it and wakeup_filter_mask is not 0 then 14162306a36Sopenharmony_ciscancodes which match the filter will wake the system from e.g. suspend 14262306a36Sopenharmony_cito RAM or power off. Otherwise the write will fail with an error. 14362306a36Sopenharmony_ci 14462306a36Sopenharmony_ciThis value may be reset to 0 if the wakeup protocol is altered. 145