18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ci.. _remote_controllers_sysfs_nodes: 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci******************************* 68c2ecf20Sopenharmony_ciRemote Controller's sysfs nodes 78c2ecf20Sopenharmony_ci******************************* 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciAs defined at ``Documentation/ABI/testing/sysfs-class-rc``, those are 108c2ecf20Sopenharmony_cithe sysfs nodes that control the Remote Controllers: 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci.. _sys_class_rc: 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci/sys/class/rc/ 168c2ecf20Sopenharmony_ci============== 178c2ecf20Sopenharmony_ci 188c2ecf20Sopenharmony_ciThe ``/sys/class/rc/`` class sub-directory belongs to the Remote 198c2ecf20Sopenharmony_ciController core and provides a sysfs interface for configuring infrared 208c2ecf20Sopenharmony_ciremote controller receivers. 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci.. _sys_class_rc_rcN: 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_ci/sys/class/rc/rcN/ 268c2ecf20Sopenharmony_ci================== 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ciA ``/sys/class/rc/rcN`` directory is created for each remote control 298c2ecf20Sopenharmony_cireceiver device where N is the number of the receiver. 308c2ecf20Sopenharmony_ci 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci.. _sys_class_rc_rcN_protocols: 338c2ecf20Sopenharmony_ci 348c2ecf20Sopenharmony_ci/sys/class/rc/rcN/protocols 358c2ecf20Sopenharmony_ci=========================== 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ciReading this file returns a list of available protocols, something like:: 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci rc5 [rc6] nec jvc [sony] 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ciEnabled protocols are shown in [] brackets. 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ciWriting "+proto" will add a protocol to the list of enabled protocols. 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ciWriting "-proto" will remove a protocol from the list of enabled 468c2ecf20Sopenharmony_ciprotocols. 478c2ecf20Sopenharmony_ci 488c2ecf20Sopenharmony_ciWriting "proto" will enable only "proto". 498c2ecf20Sopenharmony_ci 508c2ecf20Sopenharmony_ciWriting "none" will disable all protocols. 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_ciWrite fails with ``EINVAL`` if an invalid protocol combination or unknown 538c2ecf20Sopenharmony_ciprotocol name is used. 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci.. _sys_class_rc_rcN_filter: 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci/sys/class/rc/rcN/filter 598c2ecf20Sopenharmony_ci======================== 608c2ecf20Sopenharmony_ci 618c2ecf20Sopenharmony_ciSets the scancode filter expected value. 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ciUse in combination with ``/sys/class/rc/rcN/filter_mask`` to set the 648c2ecf20Sopenharmony_ciexpected value of the bits set in the filter mask. If the hardware 658c2ecf20Sopenharmony_cisupports it then scancodes which do not match the filter will be 668c2ecf20Sopenharmony_ciignored. Otherwise the write will fail with an error. 678c2ecf20Sopenharmony_ci 688c2ecf20Sopenharmony_ciThis value may be reset to 0 if the current protocol is altered. 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ci.. _sys_class_rc_rcN_filter_mask: 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci/sys/class/rc/rcN/filter_mask 748c2ecf20Sopenharmony_ci============================= 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_ciSets the scancode filter mask of bits to compare. Use in combination 778c2ecf20Sopenharmony_ciwith ``/sys/class/rc/rcN/filter`` to set the bits of the scancode which 788c2ecf20Sopenharmony_cishould be compared against the expected value. A value of 0 disables the 798c2ecf20Sopenharmony_cifilter to allow all valid scancodes to be processed. 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ciIf the hardware supports it then scancodes which do not match the filter 828c2ecf20Sopenharmony_ciwill be ignored. Otherwise the write will fail with an error. 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ciThis value may be reset to 0 if the current protocol is altered. 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci.. _sys_class_rc_rcN_wakeup_protocols: 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci/sys/class/rc/rcN/wakeup_protocols 908c2ecf20Sopenharmony_ci================================== 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ciReading this file returns a list of available protocols to use for the 938c2ecf20Sopenharmony_ciwakeup filter, something like:: 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ciNote that protocol variants are listed, so ``nec``, ``sony``, ``rc-5``, ``rc-6`` 988c2ecf20Sopenharmony_cihave their different bit length encodings listed if available. 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ciNote that all protocol variants are listed. 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_ciThe enabled wakeup protocol is shown in [] brackets. 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ciOnly one protocol can be selected at a time. 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ciWriting "proto" will use "proto" for wakeup events. 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ciWriting "none" will disable wakeup. 1098c2ecf20Sopenharmony_ci 1108c2ecf20Sopenharmony_ciWrite fails with ``EINVAL`` if an invalid protocol combination or unknown 1118c2ecf20Sopenharmony_ciprotocol name is used, or if wakeup is not supported by the hardware. 1128c2ecf20Sopenharmony_ci 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci.. _sys_class_rc_rcN_wakeup_filter: 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_ci/sys/class/rc/rcN/wakeup_filter 1178c2ecf20Sopenharmony_ci=============================== 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ciSets the scancode wakeup filter expected value. Use in combination with 1208c2ecf20Sopenharmony_ci``/sys/class/rc/rcN/wakeup_filter_mask`` to set the expected value of 1218c2ecf20Sopenharmony_cithe bits set in the wakeup filter mask to trigger a system wake event. 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ciIf the hardware supports it and wakeup_filter_mask is not 0 then 1248c2ecf20Sopenharmony_ciscancodes which match the filter will wake the system from e.g. suspend 1258c2ecf20Sopenharmony_cito RAM or power off. Otherwise the write will fail with an error. 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ciThis value may be reset to 0 if the wakeup protocol is altered. 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_ci.. _sys_class_rc_rcN_wakeup_filter_mask: 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci/sys/class/rc/rcN/wakeup_filter_mask 1338c2ecf20Sopenharmony_ci==================================== 1348c2ecf20Sopenharmony_ci 1358c2ecf20Sopenharmony_ciSets the scancode wakeup filter mask of bits to compare. Use in 1368c2ecf20Sopenharmony_cicombination with ``/sys/class/rc/rcN/wakeup_filter`` to set the bits of 1378c2ecf20Sopenharmony_cithe scancode which should be compared against the expected value to 1388c2ecf20Sopenharmony_citrigger a system wake event. 1398c2ecf20Sopenharmony_ci 1408c2ecf20Sopenharmony_ciIf the hardware supports it and wakeup_filter_mask is not 0 then 1418c2ecf20Sopenharmony_ciscancodes which match the filter will wake the system from e.g. suspend 1428c2ecf20Sopenharmony_cito RAM or power off. Otherwise the write will fail with an error. 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ciThis value may be reset to 0 if the wakeup protocol is altered. 145