4 CSI-2 is a data bus intended for transferring images from cameras to
5 the host SoC. It is defined by the `MIPI alliance`_.
7 .. _`MIPI alliance`: http://www.mipi.org/
12 CSI-2 transmitter, such as a sensor or a TV tuner, drivers need to
13 provide the CSI-2 receiver with information on the CSI-2 bus
14 configuration. These include the V4L2_CID_LINK_FREQ and
15 V4L2_CID_PIXEL_RATE controls and
16 (:c:type:`v4l2_subdev_video_ops`->s_stream() callback). These
17 interface elements must be present on the sub-device represents the
20 The V4L2_CID_LINK_FREQ control is used to tell the receiver driver the
21 frequency (and not the symbol rate) of the link. The
22 V4L2_CID_PIXEL_RATE is may be used by the receiver to obtain the pixel
23 rate the transmitter uses. The
24 :c:type:`v4l2_subdev_video_ops`->s_stream() callback provides an
25 ability to start and stop the stream.
27 The value of the V4L2_CID_PIXEL_RATE is calculated as follows::
29 pixel_rate = link_freq * 2 * nr_of_lanes / bits_per_sample
33 .. list-table:: variables in pixel rate calculation
36 * - variable or constant
39 - The value of the V4L2_CID_LINK_FREQ integer64 menu item.
41 - Number of data lanes used on the CSI-2 link. This can
42 be obtained from the OF endpoint configuration.
44 - Two bits are transferred per clock cycle per lane.
46 - Number of bits per sample.
48 The transmitter drivers must configure the CSI-2 transmitter to *LP-11
49 mode* whenever the transmitter is powered on but not active. Some
50 transmitters do this automatically but some have to be explicitly
56 Before the receiver driver may enable the CSI-2 transmitter by using
57 the :c:type:`v4l2_subdev_video_ops`->s_stream(), it must have powered
58 the transmitter up by using the
59 :c:type:`v4l2_subdev_core_ops`->s_power() callback. This may take
60 place either indirectly by using :c:func:`v4l2_pipeline_pm_use` or