Commit 01fae02d authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: docs: make CEC documents compatible with Sphinx 3.1+



Sphinx 3.x broke support for the cdomain.py extension, as the
c domain code was rewritten. Due to that, the c tags need to
be re-written, in order to use the new c domain notation.

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent c51d9b04
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: CEC

.. _cec-func-close:

@@ -11,7 +12,6 @@ Name

cec-close - Close a cec device


Synopsis
========

@@ -19,16 +19,13 @@ Synopsis

    #include <unistd.h>


.. c:function:: int close( int fd )
    :name: cec-close

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open() <cec-open>`.

    File descriptor returned by :c:func:`open()`.

Description
===========
@@ -36,11 +33,10 @@ Description
Closes the cec device. Resources associated with the file descriptor are
freed. The device configuration remain unchanged.


Return Value
============

:c:func:`close() <cec-close>` returns 0 on success. On error, -1 is returned, and
:c:func:`close()` returns 0 on success. On error, -1 is returned, and
``errno`` is set appropriately. Possible error codes are:

``EBADF``
+4 −7
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: CEC

.. _cec-func-ioctl:

@@ -18,15 +19,13 @@ Synopsis

    #include <sys/ioctl.h>


.. c:function:: int ioctl( int fd, int request, void *argp )
   :name: cec-ioctl
``int ioctl(int fd, int request, void *argp)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open() <cec-open>`.
    File descriptor returned by :c:func:`open()`.

``request``
    CEC ioctl request code as defined in the cec.h header file, for
@@ -35,11 +34,10 @@ Arguments
``argp``
    Pointer to a request-specific structure.


Description
===========

The :c:func:`ioctl() <cec-ioctl>` function manipulates cec device parameters. The
The :c:func:`ioctl()` function manipulates cec device parameters. The
argument ``fd`` must be an open file descriptor.

The ioctl ``request`` code specifies the cec function to be called. It
@@ -51,7 +49,6 @@ their parameters are located in the cec.h header file. All cec ioctl
requests, their respective function and parameters are specified in
:ref:`cec-user-func`.


Return Value
============

+3 −7
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: CEC

.. _cec-func-open:

@@ -18,10 +19,7 @@ Synopsis

    #include <fcntl.h>


.. c:function:: int open( const char *device_name, int flags )
   :name: cec-open


Arguments
=========
@@ -42,11 +40,10 @@ Arguments

    Other flags have no effect.


Description
===========

To open a cec device applications call :c:func:`open() <cec-open>` with the
To open a cec device applications call :c:func:`open()` with the
desired device name. The function has no side effects; the device
configuration remain unchanged.

@@ -54,11 +51,10 @@ When the device is opened in read-only mode, attempts to modify its
configuration will result in an error, and ``errno`` will be set to
EBADF.


Return Value
============

:c:func:`open() <cec-open>` returns the new file descriptor on success. On error,
:c:func:`open()` returns the new file descriptor on success. On error,
-1 is returned, and ``errno`` is set appropriately. Possible error codes
include:

+5 −9
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: CEC

.. _cec-func-poll:

@@ -11,7 +12,6 @@ Name

cec-poll - Wait for some event on a file descriptor


Synopsis
========

@@ -19,9 +19,7 @@ Synopsis

    #include <sys/poll.h>


.. c:function:: int poll( struct pollfd *ufds, unsigned int nfds, int timeout )
   :name: cec-poll

Arguments
=========
@@ -35,14 +33,13 @@ Arguments
``timeout``
   Timeout to wait for events


Description
===========

With the :c:func:`poll() <cec-poll>` function applications can wait for CEC
With the :c:func:`poll()` function applications can wait for CEC
events.

On success :c:func:`poll() <cec-poll>` returns the number of file descriptors
On success :c:func:`poll()` returns the number of file descriptors
that have been selected (that is, file descriptors for which the
``revents`` field of the respective struct :c:type:`pollfd`
is non-zero). CEC devices set the ``POLLIN`` and ``POLLRDNORM`` flags in
@@ -53,13 +50,12 @@ then the ``POLLPRI`` flag is set. When the function times out it returns
a value of zero, on failure it returns -1 and the ``errno`` variable is
set appropriately.

For more details see the :c:func:`poll() <cec-poll>` manual page.

For more details see the :c:func:`poll()` manual page.

Return Value
============

On success, :c:func:`poll() <cec-poll>` returns the number structures which have
On success, :c:func:`poll()` returns the number structures which have
non-zero ``revents`` fields, or zero if the call timed out. On error -1
is returned, and the ``errno`` variable is set appropriately:

+5 −5
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: CEC

.. _CEC_ADAP_G_CAPS:

@@ -14,18 +15,18 @@ CEC_ADAP_G_CAPS - Query device capabilities
Synopsis
========

.. c:function:: int ioctl( int fd, CEC_ADAP_G_CAPS, struct cec_caps *argp )
    :name: CEC_ADAP_G_CAPS
.. c:macro:: CEC_ADAP_G_CAPS

``int ioctl(int fd, CEC_ADAP_G_CAPS, struct cec_caps *argp)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open() <cec-open>`.
    File descriptor returned by :c:func:`open()`.

``argp``


Description
===========

@@ -62,7 +63,6 @@ returns the information to the application. The ioctl never fails.
      - CEC Framework API version, formatted with the ``KERNEL_VERSION()``
	macro.


.. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.6cm}|

.. _cec-capabilities:
Loading