Documentation/driver-api/media/tx-rx.rst

Source file repositories/reference/linux-study-clean/Documentation/driver-api/media/tx-rx.rst

File Facts

System
Linux kernel
Corpus path
Documentation/driver-api/media/tx-rx.rst
Extension
.rst
Size
5331 bytes
Lines
146
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. SPDX-License-Identifier: GPL-2.0

.. _transmitter-receiver:

Pixel data transmitter and receiver drivers
===========================================

V4L2 supports various devices that transmit and receive pixel data. Examples of
these devices include a camera sensor, a TV tuner and a parallel, a BT.656 or a
CSI-2 receiver in an SoC.

Bus types
---------

The following buses are the most common. This section discusses these two only.

MIPI CSI-2
^^^^^^^^^^

CSI-2 is a data bus intended for transferring images from cameras to
the host SoC. It is defined by the `MIPI alliance`_.

.. _`MIPI alliance`: https://www.mipi.org/

Parallel and BT.656
^^^^^^^^^^^^^^^^^^^

The parallel and `BT.656`_ buses transport one bit of data on each clock cycle
per data line. The parallel bus uses synchronisation and other additional
signals whereas BT.656 embeds synchronisation.

.. _`BT.656`: https://en.wikipedia.org/wiki/ITU-R_BT.656

Transmitter drivers
-------------------

Transmitter drivers generally need to provide the receiver drivers with the
configuration of the transmitter. What is required depends on the type of the
bus. These are common for both buses.

Media bus pixel code
^^^^^^^^^^^^^^^^^^^^

See :ref:`v4l2-mbus-pixelcode`.

Link frequency
^^^^^^^^^^^^^^

The :ref:`V4L2_CID_LINK_FREQ <v4l2-cid-link-freq>` control is used to tell the
receiver the frequency of the bus (i.e. it is not the same as the symbol rate).

Drivers that do not have user-configurable link frequency should report it
through the ``.get_mbus_config()`` subdev pad operation, in the ``link_freq``
field of struct v4l2_mbus_config, instead of through controls.

Receiver drivers should use :c:func:`v4l2_get_link_freq` helper to obtain the
link frequency from the transmitter sub-device.

``.enable_streams()`` and ``.disable_streams()`` callbacks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The struct v4l2_subdev_pad_ops->enable_streams() and struct
v4l2_subdev_pad_ops->disable_streams() callbacks are used by the receiver driver
to control the transmitter driver's streaming state. These callbacks may not be
called directly, but by using ``v4l2_subdev_enable_streams()`` and
``v4l2_subdev_disable_streams()``.

Stopping the transmitter
^^^^^^^^^^^^^^^^^^^^^^^^

Annotation

Implementation Notes