Commit 7328d682 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: rc: describe rc protocols and their scancodes

This lists the rc protocols the kernel knows about and how they are
converted to and from scancodes.
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 16407a6a
...@@ -66,11 +66,12 @@ on the following table. ...@@ -66,11 +66,12 @@ on the following table.
For transmitting (aka sending), create a ``struct lirc_scancode`` with For transmitting (aka sending), create a ``struct lirc_scancode`` with
the desired scancode set in the ``scancode`` member, :c:type:`rc_proto` the desired scancode set in the ``scancode`` member, :c:type:`rc_proto`
set the IR protocol, and all other members set to 0. Write this struct to set to the :ref:`IR protocol <Remote_controllers_Protocols>`, and all other
the lirc device. members set to 0. Write this struct to the lirc device.
For receiving, you read ``struct lirc_scancode`` from the lirc device, For receiving, you read ``struct lirc_scancode`` from the LIRC device.
with ``scancode`` set to the received scancode and the IR protocol The ``scancode`` field is set to the received scancode and the
:ref:`IR protocol <Remote_controllers_Protocols>` is set in
:c:type:`rc_proto`. If the scancode maps to a valid key code, this is set :c:type:`rc_proto`. If the scancode maps to a valid key code, this is set
in the ``keycode`` field, else it is set to ``KEY_RESERVED``. in the ``keycode`` field, else it is set to ``KEY_RESERVED``.
...@@ -146,7 +147,8 @@ on the following table. ...@@ -146,7 +147,8 @@ on the following table.
BPF based IR decoder BPF based IR decoder
******************** ********************
The kernel has support for decoding the most common IR protocols, but there The kernel has support for decoding the most common
:ref:`IR protocols <Remote_controllers_Protocols>`, but there
are many protocols which are not supported. To support these, it is possible are many protocols which are not supported. To support these, it is possible
to load an BPF program which does the decoding. This can only be done on to load an BPF program which does the decoding. This can only be done on
LIRC devices which support reading raw IR. LIRC devices which support reading raw IR.
......
...@@ -62,7 +62,8 @@ read from the chardev. ...@@ -62,7 +62,8 @@ read from the chardev.
Alternatively, :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` can be available, Alternatively, :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` can be available,
in this mode scancodes which are either decoded by software decoders, or in this mode scancodes which are either decoded by software decoders, or
by hardware decoders. The :c:type:`rc_proto` member is set to the by hardware decoders. The :c:type:`rc_proto` member is set to the
protocol used for transmission, and ``scancode`` to the decoded scancode, :ref:`IR protocol <Remote_controllers_Protocols>`
used for transmission, and ``scancode`` to the decoded scancode,
and the ``keycode`` set to the keycode or ``KEY_RESERVED``. and the ``keycode`` set to the keycode or ``KEY_RESERVED``.
......
...@@ -64,7 +64,8 @@ driver returns ``EINVAL``. ...@@ -64,7 +64,8 @@ driver returns ``EINVAL``.
When in :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` mode, one When in :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` mode, one
``struct lirc_scancode`` must be written to the chardev at a time, else ``struct lirc_scancode`` must be written to the chardev at a time, else
``EINVAL`` is returned. Set the desired scancode in the ``scancode`` member, ``EINVAL`` is returned. Set the desired scancode in the ``scancode`` member,
and the protocol in the :c:type:`rc_proto`: member. All other members must be and the :ref:`IR protocol <Remote_controllers_Protocols>` in the
:c:type:`rc_proto`: member. All other members must be
set to 0, else ``EINVAL`` is returned. If there is no protocol encoder set to 0, else ``EINVAL`` is returned. If there is no protocol encoder
for the protocol or the scancode is not valid for the specified protocol, for the protocol or the scancode is not valid for the specified protocol,
``EINVAL`` is returned. The write function blocks until the scancode ``EINVAL`` is returned. The write function blocks until the scancode
......
This diff is collapsed.
...@@ -27,6 +27,7 @@ Part III - Remote Controller API ...@@ -27,6 +27,7 @@ Part III - Remote Controller API
rc-intro rc-intro
rc-sysfs-nodes rc-sysfs-nodes
rc-protos
rc-tables rc-tables
rc-table-change rc-table-change
lirc-dev lirc-dev
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment