# Renesas R-Car Gen3 Digital Radio Interface Controller (DRIF)

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

> Device-tree binding reference for Renesas R-Car Gen3 Digital Radio Interface Controller (DRIF).

<!-- 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;renesas&#44;drif&#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;Ramesh Shanmugasundaram &#60;rashanmu&#64;gmail&#46;com&#62;&#34;</code></span>, <span id="dt-0f999bb9185dbf6b58d8"><code>&#34;Fabrizio Castro &#60;fabrizio&#46;castro&#46;jz&#64;renesas&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">R-Car Gen3 DRIF is a SPI like receive only slave device. A general
representation of DRIF interfacing with a master device is shown below.</p>
<p style="white-space: pre-wrap">+---------------------+                +---------------------+
|                     |-----SCK-------&gt;|CLK                  |
|       Master        |-----SS--------&gt;|SYNC  DRIFn (slave)  |
|                     |-----SD0-------&gt;|D0                   |
|                     |-----SD1-------&gt;|D1                   |
+---------------------+                +---------------------+</p>
<p style="white-space: pre-wrap">As per datasheet, each DRIF channel (drifn) is made up of two internal
channels (drifn0 &amp; drifn1). These two internal channels share the common
CLK &amp; SYNC. Each internal channel has its own dedicated resources like
irq, dma channels, address space &amp; clock. This internal split is not
visible to the external master device.</p>
<p style="white-space: pre-wrap">The device tree model represents each internal channel as a separate node.
The internal channels sharing the CLK &amp; SYNC are tied together by their
phandles using a property called "renesas,bonding". For the rest of
the documentation, unless explicitly stated, the word channel implies an
internal channel.</p>
<p style="white-space: pre-wrap">When both internal channels are enabled they need to be managed together
as one (i.e.) they cannot operate alone as independent devices. Out of the
two, one of them needs to act as a primary device that accepts common
properties of both the internal channels. This channel is identified by a
property called "renesas,primary-bond".</p>
<pre><code>To summarize,
   * When both the internal channels that are bonded together are enabled,
     the zeroth channel is selected as primary-bond. This channels accepts
     properties common to all the members of the bond.
   * When only one of the bonded channels need to be enabled, the property
     "renesas,bonding" or "renesas,primary-bond" will have no effect. That
     enabled channel can act alone as any other independent device.</code></pre>
</div>

<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;renesas&#44;r8a7795&#45;drif&#34;</code></span>, <span id="dt-2d97ae0f34d14dd8e72b"><code>&#34;renesas&#44;r8a7796&#45;drif&#34;</code></span>, <span id="dt-9802844ed4869452d348"><code>&#34;renesas&#44;r8a77965&#45;drif&#34;</code></span>, <span id="dt-24a1253e29125294194d"><code>&#34;renesas&#44;r8a77990&#45;drif&#34;</code></span>

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

**Item 2**

> **Exact value (<code>const</code>):** <span id="dt-f1f862a3cfab3ac620c8"><code>&#34;renesas&#44;rcar&#45;gen3&#45;drif&#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-c2de09e7f7fd211b679d"></a>

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

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

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

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

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

<a id="dt-041d7cd76b652a5de06a"></a>

### <code>clock&#45;names</code> — required here

**Exact value (<code>const</code>):** <span id="dt-882f4571b4b135d59582"><code>&#34;fck&#34;</code></span>

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

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

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

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

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

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

**Maximum number of items (<code>maxItems</code>):** <span id="dt-9b3f438568f3e2b46d6f"><code>2</code></span>

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

### <code>dma&#45;names</code> — required here

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

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

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

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

**Item 1**

> **Exact value (<code>const</code>):** <span id="dt-eb45b3d6c9e2700a17b5"><code>&#34;rx&#34;</code></span>

<a id="dt-5368efb369d036c8a734"></a>

**Item 2**

> **Exact value (<code>const</code>):** <span id="dt-0d0500dc5105c48e5e72"><code>&#34;rx&#34;</code></span>

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

### <code>renesas&#44;bonding</code> — required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-7aaf2118e7cf6aa5ece5">[<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-7f59a4321dc5e4b3bfe1">
<p style="white-space: pre-wrap">The phandle to the other internal channel of DRIF</p>
</div>

<a id="dt-030bda573e8c53177f1a"></a>

### <code>power&#45;domains</code> — required here

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

<a id="dt-2807d8ea7a915fb51a0e"></a>

### <code>renesas&#44;primary&#45;bond</code> — not listed as required here

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

<div id="dt-43a90112b85780737041">
<p style="white-space: pre-wrap">Indicates that the channel acts as primary among the bonded channels.</p>
</div>

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

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

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-1ed24d3512fbe8ce2017">[<code>&#47;schemas&#47;graph&#46;yaml&#35;&#47;&#36;defs&#47;port&#45;base</code>](</kernel/hardware/devicetree-bindings/dt-shared/graph.md#dt-61dbefbf4cdd7cc4556a>)</span>

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

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

<code>false</code>

Not allowed by this rule.

<div id="dt-0cd71b006a1fcbec8daa">
<p style="white-space: pre-wrap">Child port node corresponding to the data input. The port node must contain at least one endpoint.</p>
</div>

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

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

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

**<code>endpoint</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-4d56cb4bb8332929f9b4">[<code>&#47;schemas&#47;graph&#46;yaml&#35;&#47;&#36;defs&#47;endpoint&#45;base</code>](</kernel/hardware/devicetree-bindings/dt-shared/graph.md#dt-7415ffe8e57fb59e2968>)</span>

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

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

<code>false</code>

Not allowed by this rule.

<a id="dt-379ad4ba4c48ef74875c"></a>

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

<a id="dt-2dee999647f40800ef44"></a>

**<code>sync&#45;active</code> — not listed as required here**

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-8be78d1af9773cd69e97">[<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-903016f756227ecf3e1d"></a> <span id="dt-cf9981b20858934faef7"><code>0</code></span>, <span id="dt-6ab582a6267535362c11"><code>1</code></span>

<div id="dt-e71dfce9e210d2c24d4f">
<p style="white-space: pre-wrap">Indicates sync signal polarity, 0/1 for low/high respectively. This property maps to SYNCAC bit in the hardware manual. The default is 1 (active high).</p>
</div>

**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;interrupts&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;clocks&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;clock&#45;names&#34;</code></span>, <span id="dt-c127a87237cb22622910"><code>&#34;resets&#34;</code></span>, <span id="dt-a5d07fc4223c155670a0"><code>&#34;dmas&#34;</code></span>, <span id="dt-4503833a9b225761c43a"><code>&#34;dma&#45;names&#34;</code></span>, <span id="dt-727c9b818c335e022c0e"><code>&#34;renesas&#44;bonding&#34;</code></span>, <span id="dt-1a79af41bdb7f37c802f"><code>&#34;power&#45;domains&#34;</code></span>

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

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

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

### Rule 1

> <a id="dt-3bbb54dfa1f05dfb4d25"></a>
>
> #### Condition (<code>if</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-8562362a36ebdbb1ff2a"></a> <span id="dt-31d648f7705dc578c2d6"><code>&#34;renesas&#44;primary&#45;bond&#34;</code></span>
>
> <a id="dt-1ba25143802b75b74702"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-b0b2f2243ff9a854f151"></a> <span id="dt-4e9ead0e861b67997dec"><code>&#34;pinctrl&#45;0&#34;</code></span>, <span id="dt-5652a54c9ddda3dcd6bf"><code>&#34;pinctrl&#45;names&#34;</code></span>, <span id="dt-f9c5361cd357fdaa7120"><code>&#34;port&#34;</code></span>

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

### Rule 2

> <a id="dt-ffbf5afb799d5f07b3e1"></a>
>
> #### Condition (<code>if</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-5f135e3db8ef1aa53700"></a> <span id="dt-0164887f025a095456fa"><code>&#34;port&#34;</code></span>
>
> <a id="dt-0971d01a730acc20e97a"></a>
>
> #### When the condition matches (<code>then</code>)
>
> > **Required in this object (<code>required</code>):** <a id="dt-ee96a18d4bb2a9d39bd9"></a> <span id="dt-96ee7f71687cd234a9f8"><code>&#34;pinctrl&#45;0&#34;</code></span>, <span id="dt-5daae4bef35eb1615659"><code>&#34;pinctrl&#45;names&#34;</code></span>
>
> <a id="dt-56ef1e95d4edd6e6f24c"></a>
>
> #### When the condition does not match (<code>else</code>)
>
> > <a id="dt-f0255e6a88a00985d33b"></a>
> >
> > **Properties and child nodes (<code>properties</code>)**
> >
> > <a id="dt-a1dde0b582e9445bd167"></a>
> >
> > **<code>pinctrl&#45;0</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.
> >
> > <a id="dt-8bea8b6e1277afdc40b6"></a>
> >
> > **<code>pinctrl&#45;names</code> — not listed as required here**
> >
> > <code>false</code> — Not permitted by this property rule.

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

## Properties not matched by properties or patternProperties in this schema (<code>additionalProperties</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/clock/r8a7795-cpg-mssr.h&gt;
#include &lt;dt-bindings/interrupt-controller/arm-gic.h&gt;
#include &lt;dt-bindings/power/r8a7795-sysc.h&gt;

soc {
        #address-cells = &lt;2&gt;;
        #size-cells = &lt;2&gt;;

        drif00: rif@e6f40000 {
                compatible = "renesas,r8a7795-drif",
                             "renesas,rcar-gen3-drif";
                reg = &lt;0 0xe6f40000 0 0x64&gt;;
                interrupts = &lt;GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH&gt;;
                clocks = &lt;&amp;cpg CPG_MOD 515&gt;;
                clock-names = "fck";
                dmas = &lt;&amp;dmac1 0x20&gt;, &lt;&amp;dmac2 0x20&gt;;
                dma-names = "rx", "rx";
                power-domains = &lt;&amp;sysc R8A7795_PD_ALWAYS_ON&gt;;
                renesas,bonding = &lt;&amp;drif01&gt;;
                resets = &lt;&amp;cpg 515&gt;;
                renesas,primary-bond;
                pinctrl-0 = &lt;&amp;drif0_pins&gt;;
                pinctrl-names = "default";
                port {
                        drif0_ep: endpoint {
                             remote-endpoint = &lt;&amp;tuner_ep&gt;;
                        };
                };
        };

        drif01: rif@e6f50000 {
                compatible = "renesas,r8a7795-drif",
                             "renesas,rcar-gen3-drif";
                reg = &lt;0 0xe6f50000 0 0x64&gt;;
                interrupts = &lt;GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH&gt;;
                clocks = &lt;&amp;cpg CPG_MOD 514&gt;;
                clock-names = "fck";
                dmas = &lt;&amp;dmac1 0x22&gt;, &lt;&amp;dmac2 0x22&gt;;
                dma-names = "rx", "rx";
                power-domains = &lt;&amp;sysc R8A7795_PD_ALWAYS_ON&gt;;
                renesas,bonding = &lt;&amp;drif00&gt;;
                resets = &lt;&amp;cpg 514&gt;;
        };
};
</code></pre>

<pre id="dt-bae0d43ea48e35208b4a"><code class="language-dts">#include &lt;dt-bindings/clock/r8a7795-cpg-mssr.h&gt;
#include &lt;dt-bindings/interrupt-controller/arm-gic.h&gt;
#include &lt;dt-bindings/power/r8a7795-sysc.h&gt;

soc {
        #address-cells = &lt;2&gt;;
        #size-cells = &lt;2&gt;;

        drif10: rif@e6f60000 {
                compatible = "renesas,r8a7795-drif",
                             "renesas,rcar-gen3-drif";
                reg = &lt;0 0xe6f60000 0 0x64&gt;;
                interrupts = &lt;GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH&gt;;
                clocks = &lt;&amp;cpg CPG_MOD 513&gt;;
                clock-names = "fck";
                dmas = &lt;&amp;dmac1 0x24&gt;, &lt;&amp;dmac2 0x24&gt;;
                dma-names = "rx", "rx";
                power-domains = &lt;&amp;sysc R8A7795_PD_ALWAYS_ON&gt;;
                resets = &lt;&amp;cpg 513&gt;;
                renesas,bonding = &lt;&amp;drif11&gt;;
        };

        drif11: rif@e6f70000 {
                compatible = "renesas,r8a7795-drif",
                             "renesas,rcar-gen3-drif";
                reg = &lt;0 0xe6f70000 0 0x64&gt;;
                interrupts = &lt;GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH&gt;;
                clocks = &lt;&amp;cpg CPG_MOD 512&gt;;
                clock-names = "fck";
                dmas = &lt;&amp;dmac1 0x26&gt;, &lt;&amp;dmac2 0x26&gt;;
                dma-names = "rx", "rx";
                power-domains = &lt;&amp;sysc R8A7795_PD_ALWAYS_ON&gt;;
                resets = &lt;&amp;cpg 512&gt;;
                renesas,bonding = &lt;&amp;drif10&gt;;
                pinctrl-0 = &lt;&amp;drif1_pins&gt;;
                pinctrl-names = "default";
                port {
                        drif1_ep: endpoint {
                             remote-endpoint = &lt;&amp;tuner_ep1&gt;;
                             sync-active = &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>

<p id="dt-comment-1"><strong>Line 54:</strong> <span> R-Car H3</span></p>

<p id="dt-comment-2"><strong>Line 55:</strong> <span> R-Car M3-W</span></p>

<p id="dt-comment-3"><strong>Line 56:</strong> <span> R-Car M3-N</span></p>

<p id="dt-comment-4"><strong>Line 57:</strong> <span> R-Car E3</span></p>

<p id="dt-comment-5"><strong>Line 58:</strong> <span> Generic R-Car Gen3 compatible device</span></p>

<p id="dt-comment-6"><strong>Line 156:</strong> <span> Example with both internal channels enabled.</span></p>

<p id="dt-comment-7"><strong>Line 157:</strong> <span></span></p>

<p id="dt-comment-8"><strong>Line 158:</strong> <span> When interfacing with a third party tuner device with two data pins as shown</span></p>

<p id="dt-comment-9"><strong>Line 159:</strong> <span> below.</span></p>

<p id="dt-comment-10"><strong>Line 160:</strong> <span></span></p>

<p id="dt-comment-11"><strong>Line 161:</strong> <span> +---------------------+                +---------------------+</span></p>

<p id="dt-comment-12"><strong>Line 162:</strong> <span> |                     |-----SCK-------&gt;|CLK                  |</span></p>

<p id="dt-comment-13"><strong>Line 163:</strong> <span> |       Master        |-----SS--------&gt;|SYNC  DRIFn (slave)  |</span></p>

<p id="dt-comment-14"><strong>Line 164:</strong> <span> |                     |-----SD0-------&gt;|D0                   |</span></p>

<p id="dt-comment-15"><strong>Line 165:</strong> <span> |                     |-----SD1-------&gt;|D1                   |</span></p>

<p id="dt-comment-16"><strong>Line 166:</strong> <span> +---------------------+                +---------------------+</span></p>

<p id="dt-comment-17"><strong>Line 213:</strong> <span> Example with internal channel 1 alone enabled.</span></p>

<p id="dt-comment-18"><strong>Line 214:</strong> <span></span></p>

<p id="dt-comment-19"><strong>Line 215:</strong> <span> When interfacing with a third party tuner device with one data pin as shown</span></p>

<p id="dt-comment-20"><strong>Line 216:</strong> <span> below.</span></p>

<p id="dt-comment-21"><strong>Line 217:</strong> <span></span></p>

<p id="dt-comment-22"><strong>Line 218:</strong> <span> +---------------------+                +---------------------+</span></p>

<p id="dt-comment-23"><strong>Line 219:</strong> <span> |                     |-----SCK-------&gt;|CLK                  |</span></p>

<p id="dt-comment-24"><strong>Line 220:</strong> <span> |       Master        |-----SS--------&gt;|SYNC  DRIFn (slave)  |</span></p>

<p id="dt-comment-25"><strong>Line 221:</strong> <span> |                     |                |D0 (unused)          |</span></p>

<p id="dt-comment-26"><strong>Line 222:</strong> <span> |                     |-----SD--------&gt;|D1                   |</span></p>

<p id="dt-comment-27"><strong>Line 223:</strong> <span> +---------------------+                +---------------------+</span></p>

</details>
