xref: /openbmc/linux/Documentation/userspace-api/media/rc/rc-sysfs-nodes.rst (revision cdd38c5f1ce4398ec58fec95904b75824daab7b5)
1*ac7f9d02SMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later
254f38fcaSMauro Carvalho Chehab
354f38fcaSMauro Carvalho Chehab.. _remote_controllers_sysfs_nodes:
454f38fcaSMauro Carvalho Chehab
554f38fcaSMauro Carvalho Chehab*******************************
654f38fcaSMauro Carvalho ChehabRemote Controller's sysfs nodes
754f38fcaSMauro Carvalho Chehab*******************************
854f38fcaSMauro Carvalho Chehab
954f38fcaSMauro Carvalho ChehabAs defined at ``Documentation/ABI/testing/sysfs-class-rc``, those are
1054f38fcaSMauro Carvalho Chehabthe sysfs nodes that control the Remote Controllers:
1154f38fcaSMauro Carvalho Chehab
1254f38fcaSMauro Carvalho Chehab
1354f38fcaSMauro Carvalho Chehab.. _sys_class_rc:
1454f38fcaSMauro Carvalho Chehab
1554f38fcaSMauro Carvalho Chehab/sys/class/rc/
1654f38fcaSMauro Carvalho Chehab==============
1754f38fcaSMauro Carvalho Chehab
1854f38fcaSMauro Carvalho ChehabThe ``/sys/class/rc/`` class sub-directory belongs to the Remote
1954f38fcaSMauro Carvalho ChehabController core and provides a sysfs interface for configuring infrared
2054f38fcaSMauro Carvalho Chehabremote controller receivers.
2154f38fcaSMauro Carvalho Chehab
2254f38fcaSMauro Carvalho Chehab
2354f38fcaSMauro Carvalho Chehab.. _sys_class_rc_rcN:
2454f38fcaSMauro Carvalho Chehab
2554f38fcaSMauro Carvalho Chehab/sys/class/rc/rcN/
2654f38fcaSMauro Carvalho Chehab==================
2754f38fcaSMauro Carvalho Chehab
2854f38fcaSMauro Carvalho ChehabA ``/sys/class/rc/rcN`` directory is created for each remote control
2954f38fcaSMauro Carvalho Chehabreceiver device where N is the number of the receiver.
3054f38fcaSMauro Carvalho Chehab
3154f38fcaSMauro Carvalho Chehab
3254f38fcaSMauro Carvalho Chehab.. _sys_class_rc_rcN_protocols:
3354f38fcaSMauro Carvalho Chehab
3454f38fcaSMauro Carvalho Chehab/sys/class/rc/rcN/protocols
3554f38fcaSMauro Carvalho Chehab===========================
3654f38fcaSMauro Carvalho Chehab
3754f38fcaSMauro Carvalho ChehabReading this file returns a list of available protocols, something like::
3854f38fcaSMauro Carvalho Chehab
3954f38fcaSMauro Carvalho Chehab	rc5 [rc6] nec jvc [sony]
4054f38fcaSMauro Carvalho Chehab
4154f38fcaSMauro Carvalho ChehabEnabled protocols are shown in [] brackets.
4254f38fcaSMauro Carvalho Chehab
4354f38fcaSMauro Carvalho ChehabWriting "+proto" will add a protocol to the list of enabled protocols.
4454f38fcaSMauro Carvalho Chehab
4554f38fcaSMauro Carvalho ChehabWriting "-proto" will remove a protocol from the list of enabled
4654f38fcaSMauro Carvalho Chehabprotocols.
4754f38fcaSMauro Carvalho Chehab
4854f38fcaSMauro Carvalho ChehabWriting "proto" will enable only "proto".
4954f38fcaSMauro Carvalho Chehab
5054f38fcaSMauro Carvalho ChehabWriting "none" will disable all protocols.
5154f38fcaSMauro Carvalho Chehab
5254f38fcaSMauro Carvalho ChehabWrite fails with ``EINVAL`` if an invalid protocol combination or unknown
5354f38fcaSMauro Carvalho Chehabprotocol name is used.
5454f38fcaSMauro Carvalho Chehab
5554f38fcaSMauro Carvalho Chehab
5654f38fcaSMauro Carvalho Chehab.. _sys_class_rc_rcN_filter:
5754f38fcaSMauro Carvalho Chehab
5854f38fcaSMauro Carvalho Chehab/sys/class/rc/rcN/filter
5954f38fcaSMauro Carvalho Chehab========================
6054f38fcaSMauro Carvalho Chehab
6154f38fcaSMauro Carvalho ChehabSets the scancode filter expected value.
6254f38fcaSMauro Carvalho Chehab
6354f38fcaSMauro Carvalho ChehabUse in combination with ``/sys/class/rc/rcN/filter_mask`` to set the
6454f38fcaSMauro Carvalho Chehabexpected value of the bits set in the filter mask. If the hardware
6554f38fcaSMauro Carvalho Chehabsupports it then scancodes which do not match the filter will be
6654f38fcaSMauro Carvalho Chehabignored. Otherwise the write will fail with an error.
6754f38fcaSMauro Carvalho Chehab
6854f38fcaSMauro Carvalho ChehabThis value may be reset to 0 if the current protocol is altered.
6954f38fcaSMauro Carvalho Chehab
7054f38fcaSMauro Carvalho Chehab
7154f38fcaSMauro Carvalho Chehab.. _sys_class_rc_rcN_filter_mask:
7254f38fcaSMauro Carvalho Chehab
7354f38fcaSMauro Carvalho Chehab/sys/class/rc/rcN/filter_mask
7454f38fcaSMauro Carvalho Chehab=============================
7554f38fcaSMauro Carvalho Chehab
7654f38fcaSMauro Carvalho ChehabSets the scancode filter mask of bits to compare. Use in combination
7754f38fcaSMauro Carvalho Chehabwith ``/sys/class/rc/rcN/filter`` to set the bits of the scancode which
7854f38fcaSMauro Carvalho Chehabshould be compared against the expected value. A value of 0 disables the
7954f38fcaSMauro Carvalho Chehabfilter to allow all valid scancodes to be processed.
8054f38fcaSMauro Carvalho Chehab
8154f38fcaSMauro Carvalho ChehabIf the hardware supports it then scancodes which do not match the filter
8254f38fcaSMauro Carvalho Chehabwill be ignored. Otherwise the write will fail with an error.
8354f38fcaSMauro Carvalho Chehab
8454f38fcaSMauro Carvalho ChehabThis value may be reset to 0 if the current protocol is altered.
8554f38fcaSMauro Carvalho Chehab
8654f38fcaSMauro Carvalho Chehab
8754f38fcaSMauro Carvalho Chehab.. _sys_class_rc_rcN_wakeup_protocols:
8854f38fcaSMauro Carvalho Chehab
8954f38fcaSMauro Carvalho Chehab/sys/class/rc/rcN/wakeup_protocols
9054f38fcaSMauro Carvalho Chehab==================================
9154f38fcaSMauro Carvalho Chehab
9254f38fcaSMauro Carvalho ChehabReading this file returns a list of available protocols to use for the
9354f38fcaSMauro Carvalho Chehabwakeup filter, something like::
9454f38fcaSMauro Carvalho Chehab
9554f38fcaSMauro Carvalho Chehab	rc-5 nec nec-x rc-6-0 rc-6-6a-24 [rc-6-6a-32] rc-6-mce
9654f38fcaSMauro Carvalho Chehab
9754f38fcaSMauro Carvalho ChehabNote that protocol variants are listed, so ``nec``, ``sony``, ``rc-5``, ``rc-6``
9854f38fcaSMauro Carvalho Chehabhave their different bit length encodings listed if available.
9954f38fcaSMauro Carvalho Chehab
10054f38fcaSMauro Carvalho ChehabNote that all protocol variants are listed.
10154f38fcaSMauro Carvalho Chehab
10254f38fcaSMauro Carvalho ChehabThe enabled wakeup protocol is shown in [] brackets.
10354f38fcaSMauro Carvalho Chehab
10454f38fcaSMauro Carvalho ChehabOnly one protocol can be selected at a time.
10554f38fcaSMauro Carvalho Chehab
10654f38fcaSMauro Carvalho ChehabWriting "proto" will use "proto" for wakeup events.
10754f38fcaSMauro Carvalho Chehab
10854f38fcaSMauro Carvalho ChehabWriting "none" will disable wakeup.
10954f38fcaSMauro Carvalho Chehab
11054f38fcaSMauro Carvalho ChehabWrite fails with ``EINVAL`` if an invalid protocol combination or unknown
11154f38fcaSMauro Carvalho Chehabprotocol name is used, or if wakeup is not supported by the hardware.
11254f38fcaSMauro Carvalho Chehab
11354f38fcaSMauro Carvalho Chehab
11454f38fcaSMauro Carvalho Chehab.. _sys_class_rc_rcN_wakeup_filter:
11554f38fcaSMauro Carvalho Chehab
11654f38fcaSMauro Carvalho Chehab/sys/class/rc/rcN/wakeup_filter
11754f38fcaSMauro Carvalho Chehab===============================
11854f38fcaSMauro Carvalho Chehab
11954f38fcaSMauro Carvalho ChehabSets the scancode wakeup filter expected value. Use in combination with
12054f38fcaSMauro Carvalho Chehab``/sys/class/rc/rcN/wakeup_filter_mask`` to set the expected value of
12154f38fcaSMauro Carvalho Chehabthe bits set in the wakeup filter mask to trigger a system wake event.
12254f38fcaSMauro Carvalho Chehab
12354f38fcaSMauro Carvalho ChehabIf the hardware supports it and wakeup_filter_mask is not 0 then
12454f38fcaSMauro Carvalho Chehabscancodes which match the filter will wake the system from e.g. suspend
12554f38fcaSMauro Carvalho Chehabto RAM or power off. Otherwise the write will fail with an error.
12654f38fcaSMauro Carvalho Chehab
12754f38fcaSMauro Carvalho ChehabThis value may be reset to 0 if the wakeup protocol is altered.
12854f38fcaSMauro Carvalho Chehab
12954f38fcaSMauro Carvalho Chehab
13054f38fcaSMauro Carvalho Chehab.. _sys_class_rc_rcN_wakeup_filter_mask:
13154f38fcaSMauro Carvalho Chehab
13254f38fcaSMauro Carvalho Chehab/sys/class/rc/rcN/wakeup_filter_mask
13354f38fcaSMauro Carvalho Chehab====================================
13454f38fcaSMauro Carvalho Chehab
13554f38fcaSMauro Carvalho ChehabSets the scancode wakeup filter mask of bits to compare. Use in
13654f38fcaSMauro Carvalho Chehabcombination with ``/sys/class/rc/rcN/wakeup_filter`` to set the bits of
13754f38fcaSMauro Carvalho Chehabthe scancode which should be compared against the expected value to
13854f38fcaSMauro Carvalho Chehabtrigger a system wake event.
13954f38fcaSMauro Carvalho Chehab
14054f38fcaSMauro Carvalho ChehabIf the hardware supports it and wakeup_filter_mask is not 0 then
14154f38fcaSMauro Carvalho Chehabscancodes which match the filter will wake the system from e.g. suspend
14254f38fcaSMauro Carvalho Chehabto RAM or power off. Otherwise the write will fail with an error.
14354f38fcaSMauro Carvalho Chehab
14454f38fcaSMauro Carvalho ChehabThis value may be reset to 0 if the wakeup protocol is altered.
145