xref: /openbmc/linux/Documentation/devicetree/bindings/sound/cirrus,cs42l42.yaml (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
10f971060SRichard Fitzgerald# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
20f971060SRichard Fitzgerald%YAML 1.2
30f971060SRichard Fitzgerald---
40f971060SRichard Fitzgerald$id: http://devicetree.org/schemas/sound/cirrus,cs42l42.yaml#
50f971060SRichard Fitzgerald$schema: http://devicetree.org/meta-schemas/core.yaml#
60f971060SRichard Fitzgerald
70f971060SRichard Fitzgeraldtitle: Cirrus Logic CS42L42 audio CODEC
80f971060SRichard Fitzgerald
90f971060SRichard Fitzgeraldmaintainers:
100f971060SRichard Fitzgerald  - patches@opensource.cirrus.com
110f971060SRichard Fitzgerald
120f971060SRichard Fitzgeralddescription:
130f971060SRichard Fitzgerald  The CS42L42 is a low-power audio codec designed for portable applications.
140f971060SRichard Fitzgerald  It provides a high-dynamic range, stereo DAC for audio playback and a mono
150f971060SRichard Fitzgerald  high-dynamic-range ADC for audio capture. There is an integrated headset
160f971060SRichard Fitzgerald  detection block.
170f971060SRichard Fitzgerald
180f971060SRichard Fitzgeraldproperties:
190f971060SRichard Fitzgerald  compatible:
200f971060SRichard Fitzgerald    enum:
210f971060SRichard Fitzgerald      - cirrus,cs42l42
2223162672SMartin Povišer      - cirrus,cs42l83
230f971060SRichard Fitzgerald
240f971060SRichard Fitzgerald  reg:
250f971060SRichard Fitzgerald    description:
260f971060SRichard Fitzgerald      The I2C address of the CS42L42.
270f971060SRichard Fitzgerald    maxItems: 1
280f971060SRichard Fitzgerald
290f971060SRichard Fitzgerald  VP-supply:
300f971060SRichard Fitzgerald    description:
310f971060SRichard Fitzgerald      VP power supply.
320f971060SRichard Fitzgerald
330f971060SRichard Fitzgerald  VCP-supply:
340f971060SRichard Fitzgerald    description:
350f971060SRichard Fitzgerald      Charge pump power supply.
360f971060SRichard Fitzgerald
370f971060SRichard Fitzgerald  VD_FILT-supply:
380f971060SRichard Fitzgerald    description:
390f971060SRichard Fitzgerald      FILT+ power supply.
400f971060SRichard Fitzgerald
410f971060SRichard Fitzgerald  VL-supply:
420f971060SRichard Fitzgerald    description:
430f971060SRichard Fitzgerald      Logic power supply.
440f971060SRichard Fitzgerald
450f971060SRichard Fitzgerald  VA-supply:
460f971060SRichard Fitzgerald    description:
470f971060SRichard Fitzgerald      Analog power supply.
480f971060SRichard Fitzgerald
490f971060SRichard Fitzgerald  reset-gpios:
500f971060SRichard Fitzgerald    description:
510f971060SRichard Fitzgerald      This pin will be asserted and then deasserted to reset the
520f971060SRichard Fitzgerald      CS42L42 before communication starts.
530f971060SRichard Fitzgerald    maxItems: 1
540f971060SRichard Fitzgerald
550f971060SRichard Fitzgerald  interrupts:
560f971060SRichard Fitzgerald    description:
570f971060SRichard Fitzgerald      Interrupt for CS42L42 IRQ line.
580f971060SRichard Fitzgerald    maxItems: 1
590f971060SRichard Fitzgerald
600f971060SRichard Fitzgerald  cirrus,ts-inv:
610f971060SRichard Fitzgerald    description: |
620f971060SRichard Fitzgerald      Sets the behaviour of the jack plug detect switch.
630f971060SRichard Fitzgerald
640f971060SRichard Fitzgerald      0 - (Default) Shorted to tip when unplugged, open when plugged.
650f971060SRichard Fitzgerald      This is "inverted tip sense (ITS)" in the datasheet.
660f971060SRichard Fitzgerald
670f971060SRichard Fitzgerald      1 - Open when unplugged, shorted to tip when plugged.
680f971060SRichard Fitzgerald      This is "normal tip sense (TS)" in the datasheet.
690f971060SRichard Fitzgerald
700f971060SRichard Fitzgerald      The CS42L42_TS_INV_* defines are available for this.
71*d9e909e2SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
720f971060SRichard Fitzgerald    minimum: 0
730f971060SRichard Fitzgerald    maximum: 1
740f971060SRichard Fitzgerald
750f971060SRichard Fitzgerald  cirrus,ts-dbnc-rise:
760f971060SRichard Fitzgerald    description: |
770f971060SRichard Fitzgerald      Debounce the rising edge of TIP_SENSE_PLUG. With no
780f971060SRichard Fitzgerald      debounce, the tip sense pin might be noisy on a plug event.
790f971060SRichard Fitzgerald
800f971060SRichard Fitzgerald      0 - 0ms
810f971060SRichard Fitzgerald      1 - 125ms
820f971060SRichard Fitzgerald      2 - 250ms
830f971060SRichard Fitzgerald      3 - 500ms
840f971060SRichard Fitzgerald      4 - 750ms
850f971060SRichard Fitzgerald      5 - 1s (Default)
860f971060SRichard Fitzgerald      6 - 1.25s
870f971060SRichard Fitzgerald      7 - 1.5s
880f971060SRichard Fitzgerald
890f971060SRichard Fitzgerald      The CS42L42_TS_DBNCE_* defines are available for this.
90*d9e909e2SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
910f971060SRichard Fitzgerald    minimum: 0
920f971060SRichard Fitzgerald    maximum: 7
930f971060SRichard Fitzgerald
940f971060SRichard Fitzgerald  cirrus,ts-dbnc-fall:
950f971060SRichard Fitzgerald    description: |
960f971060SRichard Fitzgerald      Debounce the falling edge of TIP_SENSE_UNPLUG. With no
970f971060SRichard Fitzgerald      debounce, the tip sense pin might be noisy on an unplug event.
980f971060SRichard Fitzgerald
990f971060SRichard Fitzgerald      0 - 0ms
1000f971060SRichard Fitzgerald      1 - 125ms
1010f971060SRichard Fitzgerald      2 - 250ms
1020f971060SRichard Fitzgerald      3 - 500ms
1030f971060SRichard Fitzgerald      4 - 750ms
1040f971060SRichard Fitzgerald      5 - 1s (Default)
1050f971060SRichard Fitzgerald      6 - 1.25s
1060f971060SRichard Fitzgerald      7 - 1.5s
1070f971060SRichard Fitzgerald
1080f971060SRichard Fitzgerald      The CS42L42_TS_DBNCE_* defines are available for this.
109*d9e909e2SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
1100f971060SRichard Fitzgerald    minimum: 0
1110f971060SRichard Fitzgerald    maximum: 7
1120f971060SRichard Fitzgerald
1130f971060SRichard Fitzgerald  cirrus,btn-det-init-dbnce:
1140f971060SRichard Fitzgerald    description: |
1150f971060SRichard Fitzgerald      This sets how long to wait after enabling button detection
1160f971060SRichard Fitzgerald      interrupts before servicing button interrupts, to allow the
1170f971060SRichard Fitzgerald      HS bias time to settle. Value is in milliseconds.
1180f971060SRichard Fitzgerald      There may be erroneous button interrupts if this debounce time
1190f971060SRichard Fitzgerald      is too short.
1200f971060SRichard Fitzgerald
1210f971060SRichard Fitzgerald      0ms - 200ms,
1220f971060SRichard Fitzgerald      Default = 100ms
123*d9e909e2SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
1240f971060SRichard Fitzgerald    minimum: 0
1250f971060SRichard Fitzgerald    maximum: 200
1260f971060SRichard Fitzgerald
1270f971060SRichard Fitzgerald  cirrus,btn-det-event-dbnce:
1280f971060SRichard Fitzgerald    description: |
1290f971060SRichard Fitzgerald      This sets how long to wait after receiving a button press
1300f971060SRichard Fitzgerald      interrupt before processing it. Allows time for the button
1310f971060SRichard Fitzgerald      press to make a clean connection with the bias resistors.
1320f971060SRichard Fitzgerald      Value is in milliseconds.
1330f971060SRichard Fitzgerald
1340f971060SRichard Fitzgerald      0ms - 20ms,
1350f971060SRichard Fitzgerald      Default = 10ms
136*d9e909e2SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
1370f971060SRichard Fitzgerald    minimum: 0
1380f971060SRichard Fitzgerald    maximum: 20
1390f971060SRichard Fitzgerald
1400f971060SRichard Fitzgerald  cirrus,bias-lvls:
1410f971060SRichard Fitzgerald    description: |
1420f971060SRichard Fitzgerald      For a level-detect headset button scheme, each button will bias
1430f971060SRichard Fitzgerald      the mic pin to a certain voltage. To determine which button was
1440f971060SRichard Fitzgerald      pressed, the voltage is compared to sequential, decreasing
1450f971060SRichard Fitzgerald      voltages, until the compared voltage < bias voltage.
1460f971060SRichard Fitzgerald      For different hardware setups, a designer might want to tweak this.
1470f971060SRichard Fitzgerald      This is an array of descending values for the comparator voltage,
1480f971060SRichard Fitzgerald      given as percent of the HSBIAS voltage.
1490f971060SRichard Fitzgerald
1500f971060SRichard Fitzgerald      Array of 4 values, each 0-63
1510f971060SRichard Fitzgerald      < x1 x2 x3 x4 >
1520f971060SRichard Fitzgerald      Default = < 15 8 4 1 >
1530f971060SRichard Fitzgerald    $ref: /schemas/types.yaml#/definitions/uint32-array
1540f971060SRichard Fitzgerald    minItems: 4
1550f971060SRichard Fitzgerald    maxItems: 4
1560f971060SRichard Fitzgerald    items:
1570f971060SRichard Fitzgerald      minimum: 0
1580f971060SRichard Fitzgerald      maximum: 63
1590f971060SRichard Fitzgerald
1600f971060SRichard Fitzgerald  cirrus,hs-bias-ramp-rate:
1610f971060SRichard Fitzgerald    description: |
1620f971060SRichard Fitzgerald      If present this sets the rate that the HS bias should rise and fall.
1630f971060SRichard Fitzgerald      The actual rise and fall times depend on external hardware (the
1640f971060SRichard Fitzgerald      datasheet gives several rise and fall time examples).
1650f971060SRichard Fitzgerald
1660f971060SRichard Fitzgerald      0 - Fast rise time; slow, load-dependent fall time
1670f971060SRichard Fitzgerald      1 - Fast
1680f971060SRichard Fitzgerald      2 - Slow (default)
1690f971060SRichard Fitzgerald      3 - Slowest
1700f971060SRichard Fitzgerald
1710f971060SRichard Fitzgerald      The CS42L42_HSBIAS_RAMP_* defines are available for this.
172*d9e909e2SRob Herring    $ref: /schemas/types.yaml#/definitions/uint32
1730f971060SRichard Fitzgerald    minimum: 0
1740f971060SRichard Fitzgerald    maximum: 3
1750f971060SRichard Fitzgerald
1760f971060SRichard Fitzgerald  cirrus,hs-bias-sense-disable:
1770f971060SRichard Fitzgerald    description: |
1780f971060SRichard Fitzgerald      If present the HSBIAS sense is disabled. Configures HSBIAS output
1790f971060SRichard Fitzgerald      current sense through the external 2.21-k resistor. HSBIAS_SENSE
1800f971060SRichard Fitzgerald      is a hardware feature to reduce the potential pop noise when the
1810f971060SRichard Fitzgerald      headset plug is removed slowly. But on some platforms ESD voltage
1820f971060SRichard Fitzgerald      will affect it causing plug detection to fail, especially with CTIA
1830f971060SRichard Fitzgerald      headset type. For different hardware setups, a designer might want
1840f971060SRichard Fitzgerald      to tweak default behavior.
1850f971060SRichard Fitzgerald    type: boolean
1860f971060SRichard Fitzgerald
1870f971060SRichard Fitzgeraldrequired:
1880f971060SRichard Fitzgerald  - compatible
1890f971060SRichard Fitzgerald  - reg
1900f971060SRichard Fitzgerald  - VP-supply
1910f971060SRichard Fitzgerald  - VCP-supply
1920f971060SRichard Fitzgerald  - VD_FILT-supply
1930f971060SRichard Fitzgerald  - VL-supply
1940f971060SRichard Fitzgerald  - VA-supply
1950f971060SRichard Fitzgerald
1960f971060SRichard FitzgeraldadditionalProperties: false
1970f971060SRichard Fitzgerald
1980f971060SRichard Fitzgeraldexamples:
1990f971060SRichard Fitzgerald  - |
2000f971060SRichard Fitzgerald    #include <dt-bindings/sound/cs42l42.h>
2010f971060SRichard Fitzgerald    i2c {
2020f971060SRichard Fitzgerald      #address-cells = <1>;
2030f971060SRichard Fitzgerald      #size-cells = <0>;
2040f971060SRichard Fitzgerald
2050f971060SRichard Fitzgerald      cs42l42: cs42l42@48 {
2060f971060SRichard Fitzgerald          compatible = "cirrus,cs42l42";
2070f971060SRichard Fitzgerald          reg = <0x48>;
2080f971060SRichard Fitzgerald          VA-supply = <&dummy_vreg>;
2090f971060SRichard Fitzgerald          VP-supply = <&dummy_vreg>;
2100f971060SRichard Fitzgerald          VCP-supply = <&dummy_vreg>;
2110f971060SRichard Fitzgerald          VD_FILT-supply = <&dummy_vreg>;
2120f971060SRichard Fitzgerald          VL-supply = <&dummy_vreg>;
2130f971060SRichard Fitzgerald
2140f971060SRichard Fitzgerald          reset-gpios = <&axi_gpio_0 1 0>;
2150f971060SRichard Fitzgerald          interrupt-parent = <&gpio0>;
2160f971060SRichard Fitzgerald          interrupts = <55 8>;
2170f971060SRichard Fitzgerald
2180f971060SRichard Fitzgerald          cirrus,ts-inv = <CS42L42_TS_INV_DIS>;
2190f971060SRichard Fitzgerald          cirrus,ts-dbnc-rise = <CS42L42_TS_DBNCE_1000>;
2200f971060SRichard Fitzgerald          cirrus,ts-dbnc-fall = <CS42L42_TS_DBNCE_0>;
2210f971060SRichard Fitzgerald          cirrus,btn-det-init-dbnce = <100>;
2220f971060SRichard Fitzgerald          cirrus,btn-det-event-dbnce = <10>;
2230f971060SRichard Fitzgerald          cirrus,bias-lvls = <0x0F 0x08 0x04 0x01>;
2240f971060SRichard Fitzgerald          cirrus,hs-bias-ramp-rate = <CS42L42_HSBIAS_RAMP_SLOW>;
2250f971060SRichard Fitzgerald      };
2260f971060SRichard Fitzgerald    };
227