media: RC docs: add enum rc_proto description at the docs

This is part of the uAPI. Add it to the documentation again,
and fix cross-references.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Acked-by: Sean Young <sean@mess.org>
This commit is contained in:
Mauro Carvalho Chehab 2017-11-30 08:00:45 -05:00
parent 57c642cb45
commit c6b73bfcea
3 changed files with 16 additions and 9 deletions

View File

@ -46,13 +46,13 @@ on the following table.
This mode is for both sending and receiving IR. This mode is for both sending and receiving IR.
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, ``rc_proto`` set the desired scancode set in the ``scancode`` member, :c:type:`rc_proto`
the IR protocol, and all other members set to 0. Write this struct to set the IR protocol, and all other members set to 0. Write this struct to
the lirc device. 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 with ``scancode`` set to the received scancode and the IR protocol
``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``.
The ``flags`` can have ``LIRC_SCANCODE_FLAG_TOGGLE`` set if the toggle The ``flags`` can have ``LIRC_SCANCODE_FLAG_TOGGLE`` set if the toggle
@ -74,9 +74,6 @@ on the following table.
The ``timestamp`` field is filled with the time nanoseconds The ``timestamp`` field is filled with the time nanoseconds
(in ``CLOCK_MONOTONIC``) when the scancode was decoded. (in ``CLOCK_MONOTONIC``) when the scancode was decoded.
An ``enum rc_proto`` in the :ref:`lirc_header` lists all the supported
IR protocols.
.. _lirc-mode-mode2: .. _lirc-mode-mode2:
``LIRC_MODE_MODE2`` ``LIRC_MODE_MODE2``
@ -125,3 +122,13 @@ on the following table.
of entries. of entries.
This mode is used only for IR send. This mode is used only for IR send.
**************************
Remote Controller protocol
**************************
An enum :c:type:`rc_proto` in the :ref:`lirc_header` lists all the
supported IR protocols:
.. kernel-doc:: include/uapi/linux/lirc.h

View File

@ -54,7 +54,7 @@ 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 ``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, protocol 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``.

View File

@ -57,8 +57,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 ``rc_proto`` member. All other members must be set and the protocol in the :c:type:`rc_proto`: member. All other members must be
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 may not wait until the scancode ``EINVAL`` is returned. The write function may not wait until the scancode
is transmitted. is transmitted.