# Cirrus Logic CS42L42 audio CODEC

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

> Device-tree binding reference for Cirrus Logic CS42L42 audio CODEC.

<!-- 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;cirrus&#44;cs42l42&#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;patches&#64;opensource&#46;cirrus&#46;com&#34;</code></span>

<div id="dt-6d1c5ef59f0239d38c02">
<p style="white-space: pre-wrap">The CS42L42 is a low-power audio codec designed for portable applications. It provides a high-dynamic range, stereo DAC for audio playback and a mono high-dynamic-range ADC for audio capture. There is an integrated headset detection block.</p>
</div>

<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;cirrus&#44;cs42l42&#34;</code></span>, <span id="dt-0d17ba1dd2e75413f7d4"><code>&#34;cirrus&#44;cs42l83&#34;</code></span>

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

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

<div id="dt-571d87f60678ead6c5ff">
<p style="white-space: pre-wrap">The I2C address of the CS42L42.</p>
</div>

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

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

### <code>VP&#45;supply</code> — required here

<div id="dt-915721db487d463dd1d4">
<p style="white-space: pre-wrap">VP power supply.</p>
</div>

<a id="dt-8297db01c3e5cf334651"></a>

### <code>VCP&#45;supply</code> — required here

<div id="dt-83ab74dbc63124fced82">
<p style="white-space: pre-wrap">Charge pump power supply.</p>
</div>

<a id="dt-0e4964ec938732cfb470"></a>

### <code>VD&#95;FILT&#45;supply</code> — required here

<div id="dt-ee0f793fc84316b7b34b">
<p style="white-space: pre-wrap">FILT+ power supply.</p>
</div>

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

### <code>VL&#45;supply</code> — required here

<div id="dt-26d44d9a50c7ab1599b9">
<p style="white-space: pre-wrap">Logic power supply.</p>
</div>

<a id="dt-921c71e4dcb08aa4da1c"></a>

### <code>VA&#45;supply</code> — required here

<div id="dt-052b84cd0b1a23aff974">
<p style="white-space: pre-wrap">Analog power supply.</p>
</div>

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

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

<div id="dt-451564af2b6998692dea">
<p style="white-space: pre-wrap">This pin will be asserted and then deasserted to reset the CS42L42 before communication starts.</p>
</div>

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

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

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

<div id="dt-b3ddec0f69e9f0c0dc40">
<p style="white-space: pre-wrap">Interrupt for CS42L42 IRQ line.</p>
</div>

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

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

### <code>cirrus&#44;ts&#45;inv</code> — not listed as required here

<div id="dt-5ee04640a16ef19c12a2">
<p style="white-space: pre-wrap">Sets the behaviour of the jack plug detect switch.</p>
<p style="white-space: pre-wrap">0 - (Default) Shorted to tip when unplugged, open when plugged.
This is "inverted tip sense (ITS)" in the datasheet.</p>
<p style="white-space: pre-wrap">1 - Open when unplugged, shorted to tip when plugged.
This is "normal tip sense (TS)" in the datasheet.</p>
<p style="white-space: pre-wrap">The CS42L42_TS_INV_* defines are available for this.</p>
</div>

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

**Minimum value (<code>minimum</code>):** <span id="dt-290e8f6352e2e9d8ceac"><code>0</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-6695bd4e72c1c7270661"><code>1</code></span>

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

### <code>cirrus&#44;ts&#45;dbnc&#45;rise</code> — not listed as required here

<div id="dt-c406bf7a16922f929512">
<p style="white-space: pre-wrap">Debounce the rising edge of TIP_SENSE_PLUG. With no
debounce, the tip sense pin might be noisy on a plug event.</p>
<p style="white-space: pre-wrap">0 - 0ms
1 - 125ms
2 - 250ms
3 - 500ms
4 - 750ms
5 - 1s (Default)
6 - 1.25s
7 - 1.5s</p>
<p style="white-space: pre-wrap">The CS42L42_TS_DBNCE_* defines are available for this.</p>
</div>

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

**Minimum value (<code>minimum</code>):** <span id="dt-cc22dc2aba10d1b7d815"><code>0</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-0f4ab2a6a80e59dd3f90"><code>7</code></span>

<a id="dt-12e316951433994f57ac"></a>

### <code>cirrus&#44;ts&#45;dbnc&#45;fall</code> — not listed as required here

<div id="dt-fcda80b77a51cf2e7df3">
<p style="white-space: pre-wrap">Debounce the falling edge of TIP_SENSE_UNPLUG. With no
debounce, the tip sense pin might be noisy on an unplug event.</p>
<p style="white-space: pre-wrap">0 - 0ms
1 - 125ms
2 - 250ms
3 - 500ms
4 - 750ms
5 - 1s (Default)
6 - 1.25s
7 - 1.5s</p>
<p style="white-space: pre-wrap">The CS42L42_TS_DBNCE_* defines are available for this.</p>
</div>

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

**Minimum value (<code>minimum</code>):** <span id="dt-5f6cdb5dac5d9aa36942"><code>0</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-ad4299c43b9858da0209"><code>7</code></span>

<a id="dt-00f17cfa85187aea75fa"></a>

### <code>cirrus&#44;btn&#45;det&#45;init&#45;dbnce</code> — not listed as required here

<div id="dt-f170b49e0f170a54ece6">
<p style="white-space: pre-wrap">This sets how long to wait after enabling button detection
interrupts before servicing button interrupts, to allow the
HS bias time to settle. Value is in milliseconds.
There may be erroneous button interrupts if this debounce time
is too short.</p>
<p style="white-space: pre-wrap">0ms - 200ms,
Default = 100ms</p>
</div>

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

**Minimum value (<code>minimum</code>):** <span id="dt-1c4927eb87f93dbbd9ce"><code>0</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-1dd1b2403ca8f2b43d8b"><code>200</code></span>

<a id="dt-749dad9b4c1501ecd92f"></a>

### <code>cirrus&#44;btn&#45;det&#45;event&#45;dbnce</code> — not listed as required here

<div id="dt-a70bc6cff08b987a5f46">
<p style="white-space: pre-wrap">This sets how long to wait after receiving a button press
interrupt before processing it. Allows time for the button
press to make a clean connection with the bias resistors.
Value is in milliseconds.</p>
<p style="white-space: pre-wrap">0ms - 20ms,
Default = 10ms</p>
</div>

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

**Minimum value (<code>minimum</code>):** <span id="dt-92955f84ec1adcd4e8b0"><code>0</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-3ab04f76d29c2faa25e0"><code>20</code></span>

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

### <code>cirrus&#44;bias&#45;lvls</code> — not listed as required here

<div id="dt-8f31944698938067e49d">
<p style="white-space: pre-wrap">For a level-detect headset button scheme, each button will bias
the mic pin to a certain voltage. To determine which button was
pressed, the voltage is compared to sequential, decreasing
voltages, until the compared voltage &lt; bias voltage.
For different hardware setups, a designer might want to tweak this.
This is an array of descending values for the comparator voltage,
given as percent of the HSBIAS voltage.</p>
<p style="white-space: pre-wrap">Array of 4 values, each 0-63
&lt; x1 x2 x3 x4 &gt;
Default = &lt; 15 8 4 1 &gt;</p>
</div>

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

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

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

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

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

> **Minimum value (<code>minimum</code>):** <span id="dt-da0989bb66cdb21ac6b8"><code>0</code></span>
>
> **Maximum value (<code>maximum</code>):** <span id="dt-58e10f7383134e9a072c"><code>63</code></span>

<a id="dt-88e3dec7287ef922e4c8"></a>

### <code>cirrus&#44;hs&#45;bias&#45;ramp&#45;rate</code> — not listed as required here

<div id="dt-f97e6d150e61fecb4df7">
<p style="white-space: pre-wrap">If present this sets the rate that the HS bias should rise and fall.
The actual rise and fall times depend on external hardware (the
datasheet gives several rise and fall time examples).</p>
<p style="white-space: pre-wrap">0 - Fast rise time; slow, load-dependent fall time
1 - Fast
2 - Slow (default)
3 - Slowest</p>
<p style="white-space: pre-wrap">The CS42L42_HSBIAS_RAMP_* defines are available for this.</p>
</div>

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

**Minimum value (<code>minimum</code>):** <span id="dt-909ef40b9dfdf541ee71"><code>0</code></span>

**Maximum value (<code>maximum</code>):** <span id="dt-0a61999985c658101f77"><code>3</code></span>

<a id="dt-67f2d62d63477b07c36f"></a>

### <code>cirrus&#44;hs&#45;bias&#45;sense&#45;disable</code> — not listed as required here

<div id="dt-499d538fdcbd9a86c846">
<p style="white-space: pre-wrap">If present the HSBIAS sense is disabled. Configures HSBIAS output
current sense through the external 2.21-k resistor. HSBIAS_SENSE
is a hardware feature to reduce the potential pop noise when the
headset plug is removed slowly. But on some platforms ESD voltage
will affect it causing plug detection to fail, especially with CTIA
headset type. For different hardware setups, a designer might want
to tweak default behavior.</p>
</div>

**Value type (<code>type</code>):** <span id="dt-ec67f4ac94c30fea2e58"><code>&#34;boolean&#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;VP&#45;supply&#34;</code></span>, <span id="dt-329d9b3604d5b98bc19d"><code>&#34;VCP&#45;supply&#34;</code></span>, <span id="dt-391b1d2b563ec12ed437"><code>&#34;VD&#95;FILT&#45;supply&#34;</code></span>, <span id="dt-c127a87237cb22622910"><code>&#34;VL&#45;supply&#34;</code></span>, <span id="dt-a5d07fc4223c155670a0"><code>&#34;VA&#45;supply&#34;</code></span>

<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/sound/cs42l42.h&gt;
i2c {
  #address-cells = &lt;1&gt;;
  #size-cells = &lt;0&gt;;

  cs42l42: cs42l42@48 {
      compatible = "cirrus,cs42l42";
      reg = &lt;0x48&gt;;
      VA-supply = &lt;&amp;dummy_vreg&gt;;
      VP-supply = &lt;&amp;dummy_vreg&gt;;
      VCP-supply = &lt;&amp;dummy_vreg&gt;;
      VD_FILT-supply = &lt;&amp;dummy_vreg&gt;;
      VL-supply = &lt;&amp;dummy_vreg&gt;;

      reset-gpios = &lt;&amp;axi_gpio_0 1 0&gt;;
      interrupt-parent = &lt;&amp;gpio0&gt;;
      interrupts = &lt;55 8&gt;;

      cirrus,ts-inv = &lt;CS42L42_TS_INV_DIS&gt;;
      cirrus,ts-dbnc-rise = &lt;CS42L42_TS_DBNCE_1000&gt;;
      cirrus,ts-dbnc-fall = &lt;CS42L42_TS_DBNCE_0&gt;;
      cirrus,btn-det-init-dbnce = &lt;100&gt;;
      cirrus,btn-det-event-dbnce = &lt;10&gt;;
      cirrus,bias-lvls = &lt;0x0F 0x08 0x04 0x01&gt;;
      cirrus,hs-bias-ramp-rate = &lt;CS42L42_HSBIAS_RAMP_SLOW&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>
