# Common Properties for Video Receiver and Transmitter Devices

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Media bindings_

> Device-tree binding reference for Common Properties for Video Receiver and Transmitter Devices.

<!-- SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) -->


<a id="dt-root"></a>

**Schema identifier (<code>&#36;id</code>):** <span id="dt-09f478f44eb202ea573e"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;schemas&#47;media&#47;video&#45;interface&#45;devices&#46;yaml&#35;&#34;</code></span>

**Schema dialect (<code>&#36;schema</code>):** <span id="dt-dcb375baab6014763a68"><code>&#34;http&#58;&#47;&#47;devicetree&#46;org&#47;meta&#45;schemas&#47;core&#46;yaml&#35;&#34;</code></span>

<a id="dt-e46b5a5dd81dbd751c9f"></a>

**Maintainers (<code>maintainers</code>):** <a id="dt-fbc39820abb8bb999095"></a> <span id="dt-fb78ddfc22abfc6fe56d"><code>&#34;Jacopo Mondi &#60;jacopo&#64;jmondi&#46;org&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Sakari Ailus &#60;sakari&#46;ailus&#64;linux&#46;intel&#46;com&#62;&#34;</code></span>

<a id="dt-e1f655ed0ff4d595dadc"></a>

## Properties and child nodes (<code>properties</code>)

<a id="dt-0558615d9521b6158a08"></a>

### <code>flash&#45;leds</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-6045941259d2af052a4a">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;phandle&#45;array</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-8f5710c4314b4caa4970>)</span>

<div id="dt-f49be153c74365a36179">
<p style="white-space: pre-wrap">An array of phandles, each referring to a flash LED, a sub-node of the LED driver device node.</p>
</div>

<a id="dt-85c9b34b55b27f5ea876"></a>

### <code>leds</code> — not listed as required here

**Minimum number of items (<code>minItems</code>):** <span id="dt-d905c63cb3de38beb6a3"><code>1</code></span>

**Maximum number of items (<code>maxItems</code>):** <span id="dt-af6f0f9193b6639fc82e"><code>1</code></span>

<a id="dt-f8344fa858e5e18a2fef"></a>

### <code>led&#45;names</code> — not listed as required here

**Allowed values (<code>enum</code>):** <a id="dt-c1b702c32719a647321f"></a> <span id="dt-ef402948351cd0a813b6"><code>&#34;privacy&#34;</code></span>

<a id="dt-7e91d6ff91e70c8546f3"></a>

### <code>lens&#45;focus</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-72d45569bf8cff736c94">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;phandle</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-2533fa46618221e83225>)</span>

<div id="dt-fbf0974d4174e6eb0426">
<p style="white-space: pre-wrap">A phandle to the node of the focus lens controller.</p>
</div>

<a id="dt-88606ca5d1cd8f6c4522"></a>

### <code>rotation</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-b1e9aabc8044da2347a1">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

**Allowed values (<code>enum</code>):** <a id="dt-8d9d20bdfb7eaa7af619"></a> <span id="dt-5c0b14e955ad4fdb7a30"><code>0</code></span>, <span id="dt-78a5fc79a182d7c204e0"><code>90</code></span>, <span id="dt-284f5d8a985f6b235bbe"><code>180</code></span>, <span id="dt-47d0a2d8f7519db9677f"><code>270</code></span>

<div id="dt-67b27ea36e947d83c9b6">
<p style="white-space: pre-wrap">The camera rotation is expressed as the angular difference in degrees
between two reference systems, one relative to the camera module, and one
defined on the external world scene to be captured when projected on the
image sensor pixel array.</p>
<p style="white-space: pre-wrap">A camera sensor has a 2-dimensional reference system 'Rc' defined by its
pixel array read-out order. The origin is set to the first pixel being
read out, the X-axis points along the column read-out direction towards
the last columns, and the Y-axis along the row read-out direction towards
the last row.</p>
<p style="white-space: pre-wrap">A typical example for a sensor with a 2592x1944 pixel array matrix
observed from the front is:</p>
<pre><code>        2591       X-axis          0
          &lt;------------------------+ 0
          .......... ... ..........!
          .......... ... ..........! Y-axis
                     ...           !
          .......... ... ..........!
          .......... ... ..........! 1943
                                   V</code></pre>
<p style="white-space: pre-wrap">The external world scene reference system 'Rs' is a 2-dimensional
reference system on the focal plane of the camera module. The origin is
placed on the top-left corner of the visible scene, the X-axis points
towards the right, and the Y-axis points towards the bottom of the scene.
The top, bottom, left and right directions are intentionally not defined
and depend on the environment in which the camera is used.</p>
<p style="white-space: pre-wrap">A typical example of a (very common) picture of a shark swimming from left
to right, as seen from the camera, is:</p>
<pre><code>         0               X-axis
       0 +-------------------------------------&gt;
         !
         !
         !
         !           |\____)\___
         !           ) _____  __`&lt;
         !           |/     )/
         !
         !
         !
         V
       Y-axis</code></pre>
<p style="white-space: pre-wrap">with the reference system 'Rs' placed on the camera focal plane:</p>
<pre><code>                            ¸.·˙!
                        ¸.·˙    !
            _       ¸.·˙        !
         +-/ \-+¸.·˙            !
         | (o) |                ! Camera focal plane
         +-----+˙·.¸            !
                    ˙·.¸        !
                        ˙·.¸    !
                            ˙·.¸!</code></pre>
<p style="white-space: pre-wrap">When projected on the sensor's pixel array, the image and the associated
reference system 'Rs' are typically (but not always) inverted, due to the
camera module's lens optical inversion effect.</p>
<p style="white-space: pre-wrap">Assuming the above represented scene of the swimming shark, the lens
inversion projects the scene and its reference system onto the sensor
pixel array, seen from the front of the camera sensor, as follows:</p>
<pre><code>      Y-axis
         ^
         !
         !
         !
         !            |\_____)\__
         !            ) ____  ___.&lt;
         !            |/    )/
         !
         !
         !
       0 +-------------------------------------&gt;
         0               X-axis</code></pre>
<p style="white-space: pre-wrap">Note the shark being upside-down.</p>
<p style="white-space: pre-wrap">The resulting projected reference system is named 'Rp'.</p>
<p style="white-space: pre-wrap">The camera rotation property is then defined as the angular difference in
the counter-clockwise direction between the camera reference system 'Rc'
and the projected scene reference system 'Rp'. It is expressed in degrees
as a number in the range [0, 360[.</p>
<p style="white-space: pre-wrap">Examples</p>
<p style="white-space: pre-wrap">0 degrees camera rotation:</p>
<pre><code>              Y-Rp
               ^
        Y-Rc   !
         ^     !
         !     !
         !     !
         !     !
         !     !
         !     !
         !     !
         !     !
         !   0 +-------------------------------------&gt;
         !     0               X-Rp
       0 +-------------------------------------&gt;
         0               X-Rc</code></pre>
<pre><code>                          X-Rc                0
         &lt;------------------------------------+ 0
                     X-Rp                 0   !
     &lt;------------------------------------+ 0 !
                                          !   !
                                          !   !
                                          !   !
                                          !   !
                                          !   !
                                          !   !
                                          !   !
                                          !   V
                                          !  Y-Rc
                                          V
                                         Y-Rp</code></pre>
<p style="white-space: pre-wrap">90 degrees camera rotation:</p>
<pre><code>         0        Y-Rc
       0 +--------------------&gt;
         !   Y-Rp
         !    ^
         !    !
         !    !
         !    !
         !    !
         !    !
         !    !
         !    !
         !    !
         !    !
         !  0 +-------------------------------------&gt;
         !    0              X-Rp
         !
         !
         !
         !
         V
        X-Rc</code></pre>
<p style="white-space: pre-wrap">180 degrees camera rotation:</p>
<pre><code>                                      0
 &lt;------------------------------------+ 0
                  X-Rc                !
        Y-Rp                          !
         ^                            !
         !                            !
         !                            !
         !                            !
         !                            !
         !                            !
         !                            !
         !                            V
         !                           Y-Rc
       0 +-------------------------------------&gt;
         0              X-Rp</code></pre>
<p style="white-space: pre-wrap">270 degrees camera rotation:</p>
<pre><code>         0        Y-Rc
       0 +--------------------&gt;
         !                                        0
         !    &lt;-----------------------------------+ 0
         !                    X-Rp                !
         !                                        !
         !                                        !
         !                                        !
         !                                        !
         !                                        !
         !                                        !
         !                                        !
         !                                        !
         !                                        V
         !                                       Y-Rp
         !
         !
         !
         !
         V
        X-Rc</code></pre>
<p style="white-space: pre-wrap">Example one - Webcam</p>
<p style="white-space: pre-wrap">A camera module installed on the user facing part of a laptop screen
casing used for video calls. The captured images are meant to be displayed
in landscape mode (width &gt; height) on the laptop screen.</p>
<p style="white-space: pre-wrap">The camera is typically mounted upside-down to compensate the lens optical
inversion effect:</p>
<pre><code>              Y-Rp
        Y-Rc   ^
         ^     !
         !     !
         !     !       |\_____)\__
         !     !       ) ____  ___.&lt;
         !     !       |/    )/
         !     !
         !     !
         !     !
         !   0 +-------------------------------------&gt;
         !     0           X-Rp
       0 +-------------------------------------&gt;
         0            X-Rc</code></pre>
<p style="white-space: pre-wrap">The two reference systems are aligned, the resulting camera rotation is
0 degrees, no rotation correction needs to be applied to the resulting
image once captured to memory buffers to correctly display it to users:</p>
<pre><code>         +--------------------------------------+
         !                                      !
         !                                      !
         !                                      !
         !             |\____)\___              !
         !             ) _____  __`&lt;            !
         !             |/     )/                !
         !                                      !
         !                                      !
         !                                      !
         +--------------------------------------+</code></pre>
<p style="white-space: pre-wrap">If the camera sensor is not mounted upside-down to compensate for the lens
optical inversion, the two reference systems will not be aligned, with
'Rp' being rotated 180 degrees relatively to 'Rc':</p>
<pre><code>                  X-Rc                0
 &lt;------------------------------------+ 0
                                      !
        Y-Rp                          !
         ^                            !
         !                            !
         !       |\_____)\__          !
         !       ) ____  ___.&lt;        !
         !       |/    )/             !
         !                            !
         !                            !
         !                            V
         !                           Y-Rc
       0 +-------------------------------------&gt;
         0            X-Rp</code></pre>
<p style="white-space: pre-wrap">The image once captured to memory will then be rotated by 180 degrees:</p>
<pre><code>         +--------------------------------------+
         !                                      !
         !                                      !
         !                                      !
         !              __/(_____/|             !
         !            &gt;.___  ____ (             !
         !                 \(    \|             !
         !                                      !
         !                                      !
         !                                      !
         +--------------------------------------+</code></pre>
<p style="white-space: pre-wrap">A software rotation correction of 180 degrees should be applied to
correctly display the image:</p>
<pre><code>         +--------------------------------------+
         !                                      !
         !                                      !
         !                                      !
         !             |\____)\___              !
         !             ) _____  __`&lt;            !
         !             |/     )/                !
         !                                      !
         !                                      !
         !                                      !
         +--------------------------------------+</code></pre>
<p style="white-space: pre-wrap">Example two - Phone camera</p>
<p style="white-space: pre-wrap">A camera installed on the back side of a mobile device facing away from
the user. The captured images are meant to be displayed in portrait mode
(height &gt; width) to match the device screen orientation and the device
usage orientation used when taking the picture.</p>
<p style="white-space: pre-wrap">The camera sensor is typically mounted with its pixel array longer side
aligned to the device longer side, upside-down mounted to compensate for
the lens optical inversion effect:</p>
<pre><code>         0        Y-Rc
       0 +--------------------&gt;
         !   Y-Rp
         !    ^
         !    !
         !    !
         !    !
         !    !            |\_____)\__
         !    !            ) ____  ___.&lt;
         !    !            |/    )/
         !    !
         !    !
         !    !
         !  0 +-------------------------------------&gt;
         !    0                X-Rp
         !
         !
         !
         !
         V
        X-Rc</code></pre>
<p style="white-space: pre-wrap">The two reference systems are not aligned and the 'Rp' reference system is
rotated by 90 degrees in the counter-clockwise direction relatively to the
'Rc' reference system.</p>
<p style="white-space: pre-wrap">The image once captured to memory will be rotated:</p>
<pre><code>         +-------------------------------------+
         |                 _ _                 |
         |                \   /                |
         |                 | |                 |
         |                 | |                 |
         |                 |  &gt;                |
         |                &lt;  |                 |
         |                 | |                 |
         |                   .                 |
         |                  V                  |
         +-------------------------------------+</code></pre>
<p style="white-space: pre-wrap">A correction of 90 degrees in counter-clockwise direction has to be
applied to correctly display the image in portrait mode on the device
screen:</p>
<pre><code>                  +--------------------+
                  |                    |
                  |                    |
                  |                    |
                  |                    |
                  |                    |
                  |                    |
                  |   |\____)\___      |
                  |   ) _____  __`&lt;    |
                  |   |/     )/        |
                  |                    |
                  |                    |
                  |                    |
                  |                    |
                  |                    |
                  +--------------------+</code></pre>
</div>

<a id="dt-bf0d6fdfa1ee94b15c2b"></a>

### <code>orientation</code> — not listed as required here

<div id="dt-fad2aefeea167bfb378e">
<p style="white-space: pre-wrap">The orientation of a device (typically an image sensor or a flash LED) describing its mounting position relative to the usage orientation of the system where the device is installed on.</p>
</div>

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-17d9bc2ec7cc18cee355">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;uint32</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-d57795d6573ee5d67d37>)</span>

**Allowed values (<code>enum</code>):** <a id="dt-b65dff841898312180af"></a> <span id="dt-ece00e3c38f6a6399591"><code>0</code></span>, <span id="dt-f5a7c15ed0bd75118997"><code>1</code></span>, <span id="dt-f992c465061119e28dfa"><code>2</code></span>

<a id="dt-738c4b4f9e483441138b"></a>

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</code>)

<code>true</code>

Allowed by this rule.

## Source notes

<details>
<summary>Annotations retained from the schema source</summary>

<p id="dt-comment-0"><strong>Line 1:</strong> <span> SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)</span></p>

<p id="dt-comment-1"><strong>Line 397:</strong> <span> Front. The device is mounted on the front facing side of the system. For</span></p>

<p id="dt-comment-2"><strong>Line 398:</strong> <span> mobile devices such as smartphones, tablets and laptops the front side</span></p>

<p id="dt-comment-3"><strong>Line 399:</strong> <span> is the user facing side.</span></p>

<p id="dt-comment-4"><strong>Line 401:</strong> <span> Back. The device is mounted on the back side of the system, which is</span></p>

<p id="dt-comment-5"><strong>Line 402:</strong> <span> defined as the opposite side of the front facing one.</span></p>

<p id="dt-comment-6"><strong>Line 404:</strong> <span> External. The device is not attached directly to the system but is</span></p>

<p id="dt-comment-7"><strong>Line 405:</strong> <span> attached in a way that allows it to move freely.</span></p>

</details>
