Skip to content

Commit

Permalink
media: rc: describe rc protocols and their scancodes
Browse files Browse the repository at this point in the history
This lists the rc protocols the kernel knows about and how they are
converted to and from scancodes.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
  • Loading branch information
Sean Young authored and Mauro Carvalho Chehab committed Aug 4, 2019
1 parent 16407a6 commit 7328d68
Show file tree
Hide file tree
Showing 5 changed files with 468 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Documentation/media/uapi/rc/lirc-dev-intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ on the following table.

For transmitting (aka sending), create a ``struct lirc_scancode`` with
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
the lirc device.
set to the :ref:`IR protocol <Remote_controllers_Protocols>`, and all other
members set to 0. Write this struct to 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
For receiving, you read ``struct lirc_scancode`` from the LIRC device.
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
in the ``keycode`` field, else it is set to ``KEY_RESERVED``.

Expand Down Expand Up @@ -146,7 +147,8 @@ on the following table.
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
to load an BPF program which does the decoding. This can only be done on
LIRC devices which support reading raw IR.
Expand Down
3 changes: 2 additions & 1 deletion Documentation/media/uapi/rc/lirc-read.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ read from the chardev.
Alternatively, :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` can be available,
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
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``.
Expand Down
3 changes: 2 additions & 1 deletion Documentation/media/uapi/rc/lirc-write.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ driver returns ``EINVAL``.
When in :ref:`LIRC_MODE_SCANCODE <lirc-mode-scancode>` mode, one
``struct lirc_scancode`` must be written to the chardev at a time, else
``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
for the protocol or the scancode is not valid for the specified protocol,
``EINVAL`` is returned. The write function blocks until the scancode
Expand Down
Loading

0 comments on commit 7328d68

Please sign in to comment.