Commit 937e6805 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: docs: make MC documents more 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 f9b2e8aa
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:: MC

.. _media-func-close:

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

media-close - Close a media device


Synopsis
========

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

    #include <unistd.h>


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

Arguments
=========

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

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

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


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

:ref:`close() <media-func-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
+3 −7
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: MC

.. _media-func-ioctl:

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

media-ioctl - Control a media device


Synopsis
========

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

    #include <sys/ioctl.h>


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

Arguments
=========

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

``request``
    Media ioctl request code as defined in the media.h header file, for
@@ -36,7 +34,6 @@ Arguments
``argp``
    Pointer to a request-specific structure.


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

@@ -52,7 +49,6 @@ their parameters are located in the media.h header file. All media ioctl
requests, their respective function and parameters are specified in
:ref:`media-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:: MC

.. _media-func-open:

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

media-open - Open a media device


Synopsis
========

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

    #include <fcntl.h>


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

Arguments
=========
@@ -33,11 +31,10 @@ Arguments
    Open flags. Access mode must be either ``O_RDONLY`` or ``O_RDWR``.
    Other flags have no effect.


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

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

@@ -45,11 +42,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
============

:ref:`open() <func-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
are:

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

.. _media_ioc_device_info:

@@ -11,24 +12,22 @@ Name

MEDIA_IOC_DEVICE_INFO - Query device information


Synopsis
========

.. c:function:: int ioctl( int fd, MEDIA_IOC_DEVICE_INFO, struct media_device_info *argp )
    :name: MEDIA_IOC_DEVICE_INFO
.. c:macro:: MEDIA_IOC_DEVICE_INFO

``int ioctl(int fd, MEDIA_IOC_DEVICE_INFO, struct media_device_info *argp)``

Arguments
=========

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

``argp``
    Pointer to struct :c:type:`media_device_info`.


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

@@ -38,7 +37,6 @@ a struct :c:type:`media_device_info`. The driver
fills the structure and returns the information to the application. The
ioctl never fails.


.. c:type:: media_device_info

.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
@@ -48,7 +46,6 @@ ioctl never fails.
    :stub-columns: 0
    :widths:       1 1 2


    *  -  char
       -  ``driver``\ [16]
       -  Name of the driver implementing the media API as a NUL-terminated
@@ -94,7 +91,6 @@ ioctl never fails.
       -  Reserved for future extensions. Drivers and applications must set
	  this array to zero.


The ``serial`` and ``bus_info`` fields can be used to distinguish
between multiple instances of otherwise identical hardware. The serial
number takes precedence when provided and can be assumed to be unique.
@@ -102,7 +98,6 @@ If the serial number is an empty string, the ``bus_info`` field can be
used instead. The ``bus_info`` field is guaranteed to be unique, but can
vary across reboots or device unplug/replug.


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

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

.. _media_ioc_enum_entities:

@@ -11,24 +12,22 @@ Name

MEDIA_IOC_ENUM_ENTITIES - Enumerate entities and their properties


Synopsis
========

.. c:function:: int ioctl( int fd, MEDIA_IOC_ENUM_ENTITIES, struct media_entity_desc *argp )
    :name: MEDIA_IOC_ENUM_ENTITIES
.. c:macro:: MEDIA_IOC_ENUM_ENTITIES

``int ioctl(int fd, MEDIA_IOC_ENUM_ENTITIES, struct media_entity_desc *argp)``

Arguments
=========

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

``argp``
    Pointer to struct :c:type:`media_entity_desc`.


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

@@ -49,7 +48,6 @@ Entity IDs can be non-contiguous. Applications must *not* try to
enumerate entities by calling MEDIA_IOC_ENUM_ENTITIES with increasing
id's until they get an error.


.. c:type:: media_entity_desc

.. tabularcolumns:: |p{1.5cm}|p{1.7cm}|p{1.6cm}|p{1.5cm}|p{11.2cm}|
@@ -136,7 +134,6 @@ id's until they get an error.
    *  - }
       -


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

Loading