# MIPI DBI SPI Panel

_Peios Kernel / Hardware and drivers / Device-tree binding reference / Display bindings / panel_

> Device-tree binding reference for MIPI DBI SPI Panel.

<!-- 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;display&#47;panel&#47;panel&#45;mipi&#45;dbi&#45;spi&#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;Noralf Trønnes &#60;noralf&#64;tronnes&#46;org&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">This binding is for display panels using a MIPI DBI compatible controller
in SPI mode.</p>
<p style="white-space: pre-wrap">The MIPI Alliance Standard for Display Bus Interface defines the electrical
and logical interfaces for display controllers historically used in mobile
phones. The standard defines 4 display architecture types and this binding is
for type 1 which has full frame memory. There are 3 interface types in the
standard and type C is the serial interface.</p>
<pre><code>The standard defines the following interface signals for type C:
- Power:
  - Vdd: Power supply for display module
    Called power-supply in this binding.
  - Vddi: Logic level supply for interface signals
    Called io-supply in this binding.
- Interface:
  - CSx: Chip select
  - SCL: Serial clock
  - Dout: Serial out
  - Din: Serial in
  - SDA: Bidrectional in/out
  - D/CX: Data/command selection, high=data, low=command
    Called dc-gpios in this binding.
  - RESX: Reset when low
    Called reset-gpios in this binding.</code></pre>
<p style="white-space: pre-wrap">The type C interface has 3 options:</p>
<pre><code>  - Option 1: 9-bit mode and D/CX as the 9th bit
    |              Command              |  the next command or following data  |
    |&lt;0&gt;&lt;D7&gt;&lt;D6&gt;&lt;D5&gt;&lt;D4&gt;&lt;D3&gt;&lt;D2&gt;&lt;D1&gt;&lt;D0&gt;|&lt;D/CX&gt;&lt;D7&gt;&lt;D6&gt;&lt;D5&gt;&lt;D4&gt;&lt;D3&gt;&lt;D2&gt;&lt;D1&gt;&lt;D0&gt;|</code></pre>
<pre><code>  - Option 2: 16-bit mode and D/CX as a 9th bit
    |              Command or data                              |
    |&lt;X&gt;&lt;X&gt;&lt;X&gt;&lt;X&gt;&lt;X&gt;&lt;X&gt;&lt;X&gt;&lt;D/CX&gt;&lt;D7&gt;&lt;D6&gt;&lt;D5&gt;&lt;D4&gt;&lt;D3&gt;&lt;D2&gt;&lt;D1&gt;&lt;D0&gt;|</code></pre>
<pre><code>  - Option 3: 8-bit mode and D/CX as a separate interface line
    |        Command or data         |
    |&lt;D7&gt;&lt;D6&gt;&lt;D5&gt;&lt;D4&gt;&lt;D3&gt;&lt;D2&gt;&lt;D1&gt;&lt;D0&gt;|</code></pre>
<p style="white-space: pre-wrap">The standard defines one pixel format for type C: RGB111. The industry
however has decided to provide the type A/B interface pixel formats also on
the Type C interface and most common among these are RGB565 and RGB666.
The MIPI DCS command set_address_mode (36h) has one bit that controls RGB/BGR
order. This gives each supported RGB format a BGR variant.</p>
<p style="white-space: pre-wrap">The panel resolution is specified using the panel-timing node properties
hactive (width) and vactive (height). The other mandatory panel-timing
properties should be set to zero except clock-frequency which can be
optionally set to inform about the actual pixel clock frequency.</p>
<p style="white-space: pre-wrap">If the panel is wired to the controller at an offset specify this using
hback-porch (x-offset) and vback-porch (y-offset).</p>
</div>

<a id="dt-935ee547587f3e75de61"></a>

## All of these rules must match (<code>allOf</code>)

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

### Rule 1

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-95c8874f25311f4b1ab1">[<code>panel&#45;common&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-display/panel/panel-common.md#dt-root>)</span>

<a id="dt-22ca5ec5b89308748ecc"></a>

### Rule 2

> **Shared schema rule (<code>&#36;ref</code>):** <span id="dt-8549616abc3b04702c51">[<code>&#47;schemas&#47;spi&#47;spi&#45;peripheral&#45;props&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-spi/spi-peripheral-props.md#dt-root>)</span>

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

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

<a id="dt-5c1d81699dcbe840de83"></a>

### <code>compatible</code> — required here

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

#### Array item rules (<code>items</code>)

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

**Item 1**

> **Allowed values (<code>enum</code>):** <a id="dt-851ace07a50c83495949"></a> <span id="dt-63b688f2ccd82724cb8f"><code>&#34;saef&#44;sftc154b&#34;</code></span>, <span id="dt-2d97ae0f34d14dd8e72b"><code>&#34;sainsmart18&#34;</code></span>, <span id="dt-9802844ed4869452d348"><code>&#34;shineworld&#44;lh133k&#34;</code></span>

<a id="dt-0891c69625632ea817fd"></a>

**Item 2**

> **Exact value (<code>const</code>):** <span id="dt-f1f862a3cfab3ac620c8"><code>&#34;panel&#45;mipi&#45;dbi&#45;spi&#34;</code></span>

<a id="dt-9c1635fdb65d87e33d77"></a>

### <code>reg</code> — required here

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

<a id="dt-25febbe82a8304fe06a8"></a>

### <code>write&#45;only</code> — not listed as required here

**Value type (<code>type</code>):** <span id="dt-c0e520f9ec3c70372408"><code>&#34;boolean&#34;</code></span>

<div id="dt-e149a116c92bb10485e2">
<p style="white-space: pre-wrap">Controller is not readable (ie. Din (MISO on the SPI interface) is not wired up).</p>
</div>

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

### <code>dc&#45;gpios</code> — not listed as required here

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

<div id="dt-4c70cb72450de2f44013">
<p style="white-space: pre-wrap">Controller data/command selection (D/CX) in 4-line SPI mode.
If not set, the controller is in 3-line SPI mode.</p>
</div>

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

### <code>io&#45;supply</code> — not listed as required here

<div id="dt-ff93164b061d2d750e90">
<p style="white-space: pre-wrap">Logic level supply for interface signals (Vddi).
No need to set if this is the same as power-supply.</p>
</div>

<a id="dt-4e658a52f01a05c2324e"></a>

### <code>spi&#45;3wire</code> — not listed as required here

<code>true</code> — No constraints added by this property rule.

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

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

<div id="dt-9ed71d5ee61cab31e19a">
<pre><code>Pixel format in bit order as going on the wire:
  * `x2r1g1b1r1g1b1` - RGB111, 2 pixels per byte
  * `x2b1g1r1b1g1r1` - BGR111, 2 pixels per byte
  * `x1r1g1b1x1r1g1b1` - RGB111, 2 pixels per byte
  * `x1b1g1r1x1b1g1r1` - BGR111, 2 pixels per byte
  * `r5g6b5` - RGB565, 2 bytes
  * `b5g6r5` - BGR565, 2 bytes
  * `r6x2g6x2b6x2` - RGB666, 3 bytes
  * `b6x2g6x2r6x2` - BGR666, 3 bytes</code></pre>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-8e7b7ce76b067e5af060"></a> <span id="dt-fa3bebb96c251fbd753b"><code>&#34;x2r1g1b1r1g1b1&#34;</code></span>, <span id="dt-c14c3fe8044510b126a8"><code>&#34;x2b1g1r1b1g1r1&#34;</code></span>, <span id="dt-78348d36d9c27dad11e4"><code>&#34;x1r1g1b1x1r1g1b1&#34;</code></span>, <span id="dt-f28de527c5cb6f35340c"><code>&#34;x1b1g1r1x1b1g1r1&#34;</code></span>, <span id="dt-fdcce013ff13758665a0"><code>&#34;r5g6b5&#34;</code></span>, <span id="dt-d8c614833543ba1651b6"><code>&#34;b5g6r5&#34;</code></span>, <span id="dt-423ddf8f673b5d8af92f"><code>&#34;r6x2g6x2b6x2&#34;</code></span>, <span id="dt-2c0e57000c9234535174"><code>&#34;b6x2g6x2r6x2&#34;</code></span>

**Default value (<code>default</code>):** <span id="dt-11dca5c5246a0b507510"><code>&#34;r5g6b5&#34;</code></span>

**Required in this object (<code>required</code>):** <a id="dt-8313173ff1c9b300d560"></a> <span id="dt-048b70ee865d6847aa3d"><code>&#34;compatible&#34;</code></span>, <span id="dt-ee7433925c1528c16b99"><code>&#34;reg&#34;</code></span>, <span id="dt-f3765998c4e103e45f2f"><code>&#34;width&#45;mm&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;height&#45;mm&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;panel&#45;timing&#34;</code></span>

<a id="dt-63ab525a9812ac23c446"></a>

## Properties not evaluated by applicable rules (<code>unevaluatedProperties</code>)

<code>false</code>

Not allowed by this rule.

<a id="dt-1a130cabaa8a47b058bf"></a>

## Examples (<code>examples</code>)

<pre id="dt-0bd6510295af0c95ff2d"><code class="language-dts">#include &lt;dt-bindings/gpio/gpio.h&gt;

spi {
    #address-cells = &lt;1&gt;;
    #size-cells = &lt;0&gt;;

    display@0{
        compatible = "sainsmart18", "panel-mipi-dbi-spi";
        reg = &lt;0&gt;;
        spi-max-frequency = &lt;40000000&gt;;

        dc-gpios = &lt;&amp;gpio 24 GPIO_ACTIVE_HIGH&gt;;
        reset-gpios = &lt;&amp;gpio 25 GPIO_ACTIVE_HIGH&gt;;
        write-only;

        format = "r5g6b5";

        backlight = &lt;&amp;backlight&gt;;

        width-mm = &lt;35&gt;;
        height-mm = &lt;28&gt;;

        panel-timing {
            hactive = &lt;160&gt;;
            vactive = &lt;128&gt;;
            hback-porch = &lt;0&gt;;
            vback-porch = &lt;0&gt;;
            clock-frequency = &lt;0&gt;;
            hfront-porch = &lt;0&gt;;
            hsync-len = &lt;0&gt;;
            vfront-porch = &lt;0&gt;;
            vsync-len = &lt;0&gt;;
        };
    };
};
</code></pre>

## 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>

</details>
