# Mediatek MT8186 with MT6366, RT1019 and RT5682S ASoC sound card driver

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

> Device-tree binding reference for Mediatek MT8186 with MT6366, RT1019 and RT5682S ASoC sound card driver.

<!-- 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;sound&#47;mt8186&#45;mt6366&#45;rt1019&#45;rt5682s&#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;Jiaxin Yu &#60;jiaxin&#46;yu&#64;mediatek&#46;com&#62;&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">This binding describes the MT8186 sound card.</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>sound&#45;card&#45;common&#46;yaml&#35;</code>](</kernel/hardware/devicetree-bindings/dt-sound/sound-card-common.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

**Allowed values (<code>enum</code>):** <a id="dt-207128c21dbd6355c894"></a> <span id="dt-bd234eb96375d77ca611"><code>&#34;mediatek&#44;mt8186&#45;mt6366&#45;rt1019&#45;rt5682s&#45;sound&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;mediatek&#44;mt8186&#45;mt6366&#45;rt5682s&#45;max98360&#45;sound&#34;</code></span>, <span id="dt-88ff8a31b3bd20d1ddec"><code>&#34;mediatek&#44;mt8186&#45;mt6366&#45;rt5650&#45;sound&#34;</code></span>

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

### <code>audio&#45;routing</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-5aa48addbfe3befc2051">[<code>&#47;schemas&#47;types&#46;yaml&#35;&#47;definitions&#47;non&#45;unique&#45;string&#45;array</code>](</kernel/hardware/devicetree-bindings/dt-shared/types.md#dt-493f5d03b14b15ff7558>)</span>

<div id="dt-ac2f16e184b02d2d5305">
<p style="white-space: pre-wrap">A list of the connections between audio components. Each entry is a pair of strings, the first being the connection's sink, the second being the connection's source. Valid names could be the input or output widgets of audio components, power supplies, MicBias of codec and the software switch.</p>
</div>

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

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

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

> **Allowed values (<code>enum</code>):** <a id="dt-500d12f0fee987915a09"></a> <span id="dt-9e4d9f5ca49cf444e54b"><code>&#34;HDMI1&#34;</code></span>, <span id="dt-8b51d77363ef6dd115a7"><code>&#34;Headphone&#34;</code></span>, <span id="dt-0d61388e993ec7528d40"><code>&#34;IN1P&#34;</code></span>, <span id="dt-ad3f027d5402d2f51fa3"><code>&#34;IN1N&#34;</code></span>, <span id="dt-1ea2038c57d5083c7fc0"><code>&#34;Line Out&#34;</code></span>, <span id="dt-aa467fddd56adb652c07"><code>&#34;Speakers&#34;</code></span>, <span id="dt-8f56ddae3ab27b31526c"><code>&#34;Headset Mic&#34;</code></span>, <span id="dt-2d9b5d74b93f9dff2280"><code>&#34;HPOL&#34;</code></span>, <span id="dt-3c9eee441bb8756e4e74"><code>&#34;HPOR&#34;</code></span>, <span id="dt-35f6a504d7bb82efb22e"><code>&#34;Speaker&#34;</code></span>, <span id="dt-90b20df532376c042151"><code>&#34;SPOL&#34;</code></span>, <span id="dt-27ba4b2d08528afd8bec"><code>&#34;SPOR&#34;</code></span>, <span id="dt-3cb8e461a79e2e5e40a8"><code>&#34;TX&#34;</code></span>

<a id="dt-09a0f0ac36779d63ab90"></a>

### <code>mediatek&#44;platform</code> — required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-bc8671eb529833022ec6">[<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-3b75e139cb66f7cb5c14">
<p style="white-space: pre-wrap">The phandle of MT8186 ASoC platform.</p>
</div>

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

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

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

<div id="dt-4e5bb588aae411d98f91">
<p style="white-space: pre-wrap">dmic-gpios optional prop for switching between two DMICs. Ex, the GPIO can control a MUX HW component to select dmic clk and data form a Front or Rear dmic.</p>
</div>

<a id="dt-1712bbb09854505ea35a"></a>

### <code>headset&#45;codec</code> — not listed as required here

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

**Deprecated (<code>deprecated</code>):** <span id="dt-c1e581aa6adf922b4ae2"><code>true</code></span>

<a id="dt-b22f9eea71cec3cbfa48"></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-91c07602c27005787a7e"></a>

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

<a id="dt-6a4d293056d5fb67cf38"></a>

**<code>sound&#45;dai</code> — required here**

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

**Required in this object (<code>required</code>):** <a id="dt-fdaa54f9fc8229b78fb8"></a> <span id="dt-d3954dea6eac67d2a450"><code>&#34;sound&#45;dai&#34;</code></span>

<a id="dt-64f5fdd35da805af1f17"></a>

### <code>playback&#45;codecs</code> — not listed as required here

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

**Deprecated (<code>deprecated</code>):** <span id="dt-d83fa679da612c7d11c5"><code>true</code></span>

<a id="dt-b9bfb813cbd9da9ccfda"></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-536e51830dd1094766d4"></a>

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

<a id="dt-6cd0a3ba06ddea87dde7"></a>

**<code>sound&#45;dai</code> — required here**

<a id="dt-44d7ff0ac9b5b7dee767"></a>

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

<a id="dt-0782d1d47dba5169db98"></a>

**Item 1**

> <div id="dt-e6878dfda40092a8578c">
> <p style="white-space: pre-wrap">phandle of dp codec</p>
> </div>

<a id="dt-90c46aa458b946b41f33"></a>

**Item 2**

> <div id="dt-76c8a1f2b57feca0c6d6">
> <p style="white-space: pre-wrap">phandle of l channel speaker codec</p>
> </div>

<a id="dt-554872036ba682394dd1"></a>

**Item 3**

> <div id="dt-4f375bf122d3710ae8ae">
> <p style="white-space: pre-wrap">phandle of r channel speaker codec</p>
> </div>

**Minimum number of items (<code>minItems</code>):** <span id="dt-708e70e087b143aa1e1b"><code>2</code></span>

**Required in this object (<code>required</code>):** <a id="dt-ab261e0e01ab8d795da7"></a> <span id="dt-8c0fa2fc5e17501e094d"><code>&#34;sound&#45;dai&#34;</code></span>

<a id="dt-19327a0f6ca52fc4f2c6"></a>

### <code>mediatek&#44;adsp</code> — not listed as required here

**Shared schema rule (<code>&#36;ref</code>):** <span id="dt-039d680699a95bf7ea56">[<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-c23e038b40f205e8a9bd">
<p style="white-space: pre-wrap">The phandle of MT8186 ADSP platform.</p>
</div>

<a id="dt-6d8c2e1cc348b00053b1"></a>

### <code>mediatek&#44;dai&#45;link</code> — not listed as required here

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

<div id="dt-f02a151e789c41cd4106">
<p style="white-space: pre-wrap">A list of the desired dai-links in the sound card. Each entry is a name defined in the machine driver.</p>
</div>

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

## Properties matching a name pattern (<code>patternProperties</code>)

<a id="dt-1835a0317dae1488a052"></a>

### <code>&#46;&#42;&#45;dai&#45;link&#36;</code> — name matches this regular expression

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

<a id="dt-648a771abb8056027ce0"></a>

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

<code>false</code>

Not allowed by this rule.

<div id="dt-1ddc58bbafb86167caab">
<p style="white-space: pre-wrap">Container for dai-link level properties and CODEC sub-nodes.</p>
</div>

<a id="dt-9937d7ae7daaa5558a92"></a>

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

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

**<code>link&#45;name</code> — required here**

<div id="dt-9e8bacbda230fc6c3874">
<p style="white-space: pre-wrap">Indicates dai-link name and PCM stream name</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-89db63b45638e69f793e"></a> <span id="dt-f7a2f33cd994c9478f7b"><code>&#34;I2S0&#34;</code></span>, <span id="dt-96faa4709a4d5db246ec"><code>&#34;I2S1&#34;</code></span>, <span id="dt-5890b3df19c888f85dbe"><code>&#34;I2S2&#34;</code></span>, <span id="dt-51cc37960a458529a8fa"><code>&#34;I2S3&#34;</code></span>

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

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

<div id="dt-390ad724e6e87a8e6f31">
<p style="white-space: pre-wrap">Holds subnode which indicates codec dai.</p>
</div>

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

<a id="dt-a476ce8ca86c939806d1"></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-273b21d778eba1efd580"></a>

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

<a id="dt-0936ce529515b6115195"></a>

**<code>sound&#45;dai</code> — required here**

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

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

**Required in this object (<code>required</code>):** <a id="dt-536235ca9a4d730c7439"></a> <span id="dt-006b3194ed20a4b14f0b"><code>&#34;sound&#45;dai&#34;</code></span>

<a id="dt-8798deb9dc5a41c9e07b"></a>

**<code>dai&#45;format</code> — not listed as required here**

<div id="dt-97a8f259e648a9ac77a9">
<p style="white-space: pre-wrap">audio format</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-700bf66ca61a5272343d"></a> <span id="dt-995b4abe6c382caee91d"><code>&#34;i2s&#34;</code></span>, <span id="dt-69789a608990cef25361"><code>&#34;right&#95;j&#34;</code></span>, <span id="dt-3ac6a40cfbcd8e0ec4f3"><code>&#34;left&#95;j&#34;</code></span>, <span id="dt-21aaa216da6c02d3f29f"><code>&#34;dsp&#95;a&#34;</code></span>, <span id="dt-14a09a33b87fdfcfb8fe"><code>&#34;dsp&#95;b&#34;</code></span>

<a id="dt-99f2faea7f542a13c7ec"></a>

**<code>mediatek&#44;clk&#45;provider</code> — not listed as required here**

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

<div id="dt-c06c1486bc5f4b628928">
<p style="white-space: pre-wrap">Indicates dai-link clock master.</p>
</div>

**Allowed values (<code>enum</code>):** <a id="dt-1d6ba8ad84e3101d3a45"></a> <span id="dt-94fcaed2902c1c969fbf"><code>&#34;cpu&#34;</code></span>, <span id="dt-3c9f01283911149a1e70"><code>&#34;codec&#34;</code></span>

**Required in this object (<code>required</code>):** <a id="dt-0c473b2dd68c1cb91dd6"></a> <span id="dt-5ada0b495601465325ac"><code>&#34;link&#45;name&#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.

**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;mediatek&#44;platform&#34;</code></span>

<a id="dt-158e3f6339df9dc0e448"></a>

## Condition (<code>if</code>)

> <a id="dt-3bfe73d6d5d592adab9c"></a>
>
> ### This rule must not match (<code>not</code>)
>
> > <a id="dt-4d5a338468760f7e72c4"></a>
> >
> > #### Properties matching a name pattern (<code>patternProperties</code>)
> >
> > <a id="dt-4c9c9d360ad9ae706349"></a>
> >
> > **<code>&#46;&#42;&#45;dai&#45;link&#36;</code> — name matches this regular expression**
> >
> > <code>false</code> — Not permitted by this property rule.

<a id="dt-94d3067a06aec87aad7f"></a>

## When the condition matches (<code>then</code>)

> <a id="dt-d3da345ec82b9041251c"></a>
>
> ### Properties and child nodes (<code>properties</code>)
>
> <a id="dt-fcccb934efbac73716d7"></a>
>
> #### <code>headset&#45;codec</code> — not listed as required here
>
> <code>false</code> — Not permitted by this property rule.
>
> <a id="dt-d9283124c6d21d187562"></a>
>
> #### <code>speaker&#45;codecs</code> — not listed as required here
>
> <code>false</code> — Not permitted by this property 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;

sound: mt8186-sound {
    compatible = "mediatek,mt8186-mt6366-rt1019-rt5682s-sound";
    model = "mt8186_rt1019_rt5682s";
    pinctrl-names = "aud_clk_mosi_off",
                    "aud_clk_mosi_on",
                    "aud_gpio_dmic_sec";
    pinctrl-0 = &lt;&amp;aud_clk_mosi_off&gt;;
    pinctrl-1 = &lt;&amp;aud_clk_mosi_on&gt;;
    pinctrl-2 = &lt;&amp;aud_gpio_dmic_sec&gt;;
    mediatek,platform = &lt;&amp;afe&gt;;

    dmic-gpios = &lt;&amp;pio 23 GPIO_ACTIVE_HIGH&gt;;

    audio-routing =
            "Headphone", "HPOL",
            "Headphone", "HPOR",
            "IN1P", "Headset Mic",
            "Speakers", "Speaker",
            "HDMI1", "TX";

    hs-playback-dai-link {
            link-name = "I2S0";
            dai-format = "i2s";
            mediatek,clk-provider = "cpu";
            codec {
                    sound-dai = &lt;&amp;rt5682s 0&gt;;
            };
    };

    hs-capture-dai-link {
            link-name = "I2S1";
            dai-format = "i2s";
            mediatek,clk-provider = "cpu";
            codec {
                    sound-dai = &lt;&amp;rt5682s 0&gt;;
            };
    };

    spk-hdmi-playback-dai-link {
            link-name = "I2S3";
            dai-format = "i2s";
            mediatek,clk-provider = "cpu";
            codec {
                    sound-dai = &lt;&amp;it6505dptx&gt;, &lt;&amp;rt1019p&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 36:</strong> <span> Sinks</span></p>

<p id="dt-comment-2"><strong>Line 44:</strong> <span> Sources</span></p>

<p id="dt-comment-3"><strong>Line 139:</strong> <span> Disallow legacy properties if xxx-dai-link nodes are specified</span></p>

</details>
