code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/allwinner,sun4i-a10-codec.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A10 Codec

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

properties:
  "#sound-dai-cells":
    const: 0

  compatible:
    enum:
      - allwinner,sun4i-a10-codec
      - allwinner,sun6i-a31-codec
      - allwinner,sun7i-a20-codec
      - allwinner,sun8i-a23-codec
      - allwinner,sun8i-h3-codec
      - allwinner,sun8i-v3s-codec

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: Bus Clock
      - description: Module Clock

  clock-names:
    items:
      - const: apb
      - const: codec

  dmas:
    items:
      - description: RX DMA Channel
      - description: TX DMA Channel

  dma-names:
    items:
      - const: rx
      - const: tx

  resets:
    maxItems: 1

  allwinner,audio-routing:
    description: |-
      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.
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
    minItems: 2
    maxItems: 18
    items:
      enum:
        # Audio Pins on the SoC
        - HP
        - HPCOM
        - LINEIN
        - LINEOUT
        - MIC1
        - MIC2
        - MIC3

        # Microphone Biases from the SoC
        - HBIAS
        - MBIAS

        # Board Connectors
        - Headphone
        - Headset Mic
        - Line In
        - Line Out
        - Mic
        - Speaker

  allwinner,codec-analog-controls:
    $ref: /schemas/types.yaml#/definitions/phandle
    description: Phandle to the codec analog controls in the PRCM

  allwinner,pa-gpios:
    maxItems: 1
    description: GPIO to enable the external amplifier

required:
  - "#sound-dai-cells"
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - dmas
  - dma-names

allOf:
  - $ref: dai-common.yaml#
  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun6i-a31-codec
            - allwinner,sun8i-a23-codec
            - allwinner,sun8i-h3-codec
            - allwinner,sun8i-v3s-codec

    then:
      if:
        properties:
          compatible:
            const: allwinner,sun6i-a31-codec

      then:
        required:
          - resets
          - allwinner,audio-routing

      else:
        required:
          - resets
          - allwinner,audio-routing
          - allwinner,codec-analog-controls

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun6i-a31-codec

    then:
      properties:
        allwinner,audio-routing:
          items:
            enum:
              - HP
              - HPCOM
              - LINEIN
              - LINEOUT
              - MIC1
              - MIC2
              - MIC3
              - HBIAS
              - MBIAS
              - Headphone
              - Headset Mic
              - Line In
              - Line Out
              - Mic
              - Speaker

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun8i-a23-codec

    then:
      properties:
        allwinner,audio-routing:
          items:
            enum:
              - HP
              - HPCOM
              - LINEIN
              - MIC1
              - MIC2
              - HBIAS
              - MBIAS
              - Headphone
              - Headset Mic
              - Line In
              - Line Out
              - Mic
              - Speaker

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun8i-h3-codec

    then:
      properties:
        allwinner,audio-routing:
          items:
            enum:
              - HP
              - HPCOM
              - LINEIN
              - LINEOUT
              - MIC1
              - MIC2
              - HBIAS
              - MBIAS
              - Headphone
              - Headset Mic
              - Line In
              - Line Out
              - Mic
              - Speaker

  - if:
      properties:
        compatible:
          enum:
            - allwinner,sun8i-v3s-codec

    then:
      properties:
        allwinner,audio-routing:
          items:
            enum:
              - HP
              - HPCOM
              - MIC1
              - HBIAS
              - Headphone
              - Headset Mic
              - Line In
              - Line Out
              - Mic
              - Speaker

unevaluatedProperties: false

examples:
  - |
    codec@1c22c00 {
        #sound-dai-cells = <0>;
        compatible = "allwinner,sun7i-a20-codec";
        reg = <0x01c22c00 0x40>;
        interrupts = <0 30 4>;
        clocks = <&apb0_gates 0>, <&codec_clk>;
        clock-names = "apb", "codec";
        dmas = <&dma 0 19>, <&dma 0 19>;
        dma-names = "rx", "tx";
    };

  - |
    codec@1c22c00 {
        #sound-dai-cells = <0>;
        compatible = "allwinner,sun6i-a31-codec";
        reg = <0x01c22c00 0x98>;
        interrupts = <0 29 4>;
        clocks = <&ccu 61>, <&ccu 135>;
        clock-names = "apb", "codec";
        resets = <&ccu 42>;
        dmas = <&dma 15>, <&dma 15>;
        dma-names = "rx", "tx";
        allwinner,audio-routing =
            "Headphone", "HP",
            "Speaker", "LINEOUT",
            "LINEIN", "Line In",
            "MIC1", "MBIAS",
            "MIC1", "Mic",
            "MIC2", "HBIAS",
            "MIC2", "Headset Mic";
    };

...


code:
# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/allwinner,sun4i-a10-i2s.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A10 I2S Controller

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

properties:
  "#sound-dai-cells":
    const: 0

  compatible:
    oneOf:
      - const: allwinner,sun4i-a10-i2s
      - const: allwinner,sun6i-a31-i2s
      - const: allwinner,sun8i-a83t-i2s
      - const: allwinner,sun8i-h3-i2s
      - items:
          - const: allwinner,sun8i-r40-i2s
          - const: allwinner,sun8i-h3-i2s
      - items:
          - const: allwinner,sun8i-v3-i2s
          - const: allwinner,sun8i-h3-i2s
      - const: allwinner,sun50i-a64-codec-i2s
      - items:
          - const: allwinner,sun50i-a64-i2s
          - const: allwinner,sun8i-h3-i2s
      - const: allwinner,sun50i-h6-i2s
      - const: allwinner,sun50i-r329-i2s
      - items:
          - const: allwinner,sun20i-d1-i2s
          - const: allwinner,sun50i-r329-i2s

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: Bus Clock
      - description: Module Clock

  clock-names:
    items:
      - const: apb
      - const: mod

  # Even though it only applies to subschemas under the conditionals,
  # not listing them here will trigger a warning because of the
  # additionalsProperties set to false.
  dmas: true
  dma-names: true
  resets:
    maxItems: 1

allOf:
  - $ref: dai-common.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun6i-a31-i2s
              - allwinner,sun8i-a83t-i2s
              - allwinner,sun8i-h3-i2s
              - allwinner,sun50i-a64-codec-i2s
              - allwinner,sun50i-h6-i2s
              - allwinner,sun50i-r329-i2s

    then:
      required:
        - resets

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun8i-a83t-i2s
              - allwinner,sun8i-h3-i2s

    then:
      properties:
        dmas:
          minItems: 1
          items:
            - description: RX DMA Channel
            - description: TX DMA Channel
          description:
            Some controllers cannot receive but can only transmit
            data. In such a case, the RX DMA channel is to be omitted.

        dma-names:
          oneOf:
            - items:
                - const: rx
                - const: tx
            - const: tx
          description:
            Some controllers cannot receive but can only transmit
            data. In such a case, the RX name is to be omitted.

    else:
      properties:
        dmas:
          items:
            - description: RX DMA Channel
            - description: TX DMA Channel

        dma-names:
          items:
            - const: rx
            - const: tx

required:
  - "#sound-dai-cells"
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - dmas
  - dma-names

unevaluatedProperties: false

examples:
  - |
    i2s0: i2s@1c22400 {
        #sound-dai-cells = <0>;
        compatible = "allwinner,sun4i-a10-i2s";
        reg = <0x01c22400 0x400>;
        interrupts = <0 16 4>;
        clocks = <&apb0_gates 3>, <&i2s0_clk>;
        clock-names = "apb", "mod";
        dmas = <&dma 0 3>, <&dma 0 3>;
        dma-names = "rx", "tx";
    };

...

repo_name: angery/linux


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/allwinner,sun4i-a10-spdif.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A10 S/PDIF Controller

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Liam Girdwood <lgirdwood@gmail.com>
  - Mark Brown <broonie@kernel.org>
  - Maxime Ripard <mripard@kernel.org>

properties:
  "#sound-dai-cells":
    const: 0

  compatible:
    oneOf:
      - const: allwinner,sun4i-a10-spdif
      - const: allwinner,sun6i-a31-spdif
      - const: allwinner,sun8i-h3-spdif
      - const: allwinner,sun50i-h6-spdif
      - items:
          - const: allwinner,sun8i-a83t-spdif
          - const: allwinner,sun8i-h3-spdif
      - items:
          - const: allwinner,sun50i-a64-spdif
          - const: allwinner,sun8i-h3-spdif

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: Bus Clock
      - description: Module Clock

  clock-names:
    items:
      - const: apb
      - const: spdif

  # Even though it only applies to subschemas under the conditionals,
  # not listing them here will trigger a warning because of the
  # additionalsProperties set to false.
  dmas: true
  dma-names: true
  resets:
    maxItems: 1

allOf:
  - $ref: dai-common.yaml#
  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun6i-a31-spdif
              - allwinner,sun8i-h3-spdif

    then:
      required:
        - resets

  - if:
      properties:
        compatible:
          contains:
            enum:
              - allwinner,sun8i-h3-spdif
              - allwinner,sun50i-h6-spdif

    then:
      properties:
        dmas:
          description: TX DMA Channel

        dma-names:
          const: tx

    else:
      properties:
        dmas:
          items:
            - description: RX DMA Channel
            - description: TX DMA Channel

        dma-names:
          items:
            - const: rx
            - const: tx

required:
  - "#sound-dai-cells"
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - dmas
  - dma-names

unevaluatedProperties: false

examples:
  - |
    spdif: spdif@1c21000 {
        #sound-dai-cells = <0>;
        compatible = "allwinner,sun4i-a10-spdif";
        reg = <0x01c21000 0x40>;
        interrupts = <13>;
        clocks = <&apb0_gates 1>, <&spdif_clk>;
        clock-names = "apb", "spdif";
        dmas = <&dma 0 2>, <&dma 0 2>;
        dma-names = "rx", "tx";
    };

...


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/allwinner,sun50i-a64-codec-analog.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A64 Analog Codec

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

properties:
  compatible:
    const: allwinner,sun50i-a64-codec-analog

  reg:
    maxItems: 1

  cpvdd-supply:
    description:
      Regulator for the headphone amplifier

  allwinner,internal-bias-resistor:
    description:
      Enable the internal 2.2K bias resistor between HBIAS and MICDET pins
    type: boolean

required:
  - compatible
  - reg
  - cpvdd-supply

additionalProperties: false

examples:
  - |
    codec_analog: codec-analog@1f015c0 {
      compatible = "allwinner,sun50i-a64-codec-analog";
      reg = <0x01f015c0 0x4>;
      cpvdd-supply = <&reg_eldo1>;
    };

...


code:
# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/allwinner,sun50i-h6-dmic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner H6 DMIC

maintainers:
  - Ban Tao <fengzheng923@gmail.com>

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - allwinner,sun20i-d1-dmic
          - const: allwinner,sun50i-h6-dmic
      - const: allwinner,sun50i-h6-dmic

  "#sound-dai-cells":
    const: 0

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: Bus Clock
      - description: Module Clock

  clock-names:
    items:
      - const: bus
      - const: mod

  dmas:
    items:
      - description: RX DMA Channel

  dma-names:
    items:
      - const: rx

  resets:
    maxItems: 1

required:
  - "#sound-dai-cells"
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names
  - dmas
  - dma-names
  - resets

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    #include <dt-bindings/clock/sun50i-h6-ccu.h>
    #include <dt-bindings/reset/sun50i-h6-ccu.h>

    dmic: dmic@5095000 {
      #sound-dai-cells = <0>;
      compatible = "allwinner,sun50i-h6-dmic";
      reg = <0x05095000 0x400>;
      interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>;
      clocks = <&ccu CLK_BUS_DMIC>, <&ccu CLK_DMIC>;
      clock-names = "bus", "mod";
      dmas = <&dma 7>;
      dma-names = "rx";
      resets = <&ccu RST_BUS_DMIC>;
    };

...


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/allwinner,sun8i-a23-codec-analog.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A23 Analog Codec

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

properties:
  compatible:
    oneOf:
      # FIXME: This is documented in the PRCM binding, but needs to be
      # migrated here at some point
      # - allwinner,sun8i-a23-codec-analog
      - const: allwinner,sun8i-h3-codec-analog
      - items:
          - const: allwinner,sun8i-v3-codec-analog
          - const: allwinner,sun8i-h3-codec-analog
      - const: allwinner,sun8i-v3s-codec-analog

  reg:
    maxItems: 1

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    codec_analog: codec-analog@1f015c0 {
      compatible = "allwinner,sun8i-h3-codec-analog";
      reg = <0x01f015c0 0x4>;
    };

...


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/allwinner,sun8i-a33-codec.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Allwinner A33 Codec

maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

allOf:
  - $ref: dai-common.yaml#

properties:
  "#sound-dai-cells":
    minimum: 0
    maximum: 1
    description:
      A value of 0 is deprecated. When used, it only allows access to
      the ADC/DAC and AIF1 (the CPU DAI), not the other two AIFs/DAIs.

  compatible:
    oneOf:
      - items:
          - const: allwinner,sun50i-a64-codec
          - const: allwinner,sun8i-a33-codec
      - const: allwinner,sun8i-a33-codec

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: Bus Clock
      - description: Module Clock

  clock-names:
    items:
      - const: bus
      - const: mod

required:
  - "#sound-dai-cells"
  - compatible
  - reg
  - interrupts
  - clocks
  - clock-names

unevaluatedProperties: false

examples:
  - |
    audio-codec@1c22e00 {
      #sound-dai-cells = <1>;
      compatible = "allwinner,sun8i-a33-codec";
      reg = <0x01c22e00 0x400>;
      interrupts = <0 29 4>;
      clocks = <&ccu 47>, <&ccu 92>;
      clock-names = "bus", "mod";
    };

...


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,aiu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic AIU audio output controller

maintainers:
  - Jerome Brunet <jbrunet@baylibre.com>

allOf:
  - $ref: dai-common.yaml#

properties:
  $nodename:
    pattern: "^audio-controller@.*"

  "#sound-dai-cells":
    const: 2

  compatible:
    items:
      - enum:
          - amlogic,aiu-gxbb
          - amlogic,aiu-gxl
          - amlogic,aiu-meson8
          - amlogic,aiu-meson8b
      - const: amlogic,aiu

  clocks:
    items:
      - description: AIU peripheral clock
      - description: I2S peripheral clock
      - description: I2S output clock
      - description: I2S master clock
      - description: I2S mixer clock
      - description: SPDIF peripheral clock
      - description: SPDIF output clock
      - description: SPDIF master clock
      - description: SPDIF master clock multiplexer

  clock-names:
    items:
      - const: pclk
      - const: i2s_pclk
      - const: i2s_aoclk
      - const: i2s_mclk
      - const: i2s_mixer
      - const: spdif_pclk
      - const: spdif_aoclk
      - const: spdif_mclk
      - const: spdif_mclk_sel

  interrupts:
    items:
      - description: I2S interrupt line
      - description: SPDIF interrupt line

  interrupt-names:
    items:
      - const: i2s
      - const: spdif

  reg:
    maxItems: 1

  resets:
    maxItems: 1

  sound-name-prefix: true

required:
  - "#sound-dai-cells"
  - compatible
  - clocks
  - clock-names
  - interrupts
  - interrupt-names
  - reg
  - resets

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/gxbb-clkc.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/reset/amlogic,meson-gxbb-reset.h>

    aiu: audio-controller@5400 {
        compatible = "amlogic,aiu-gxl", "amlogic,aiu";
        #sound-dai-cells = <2>;
        reg = <0x5400 0x2ac>;
        interrupts = <GIC_SPI 48 IRQ_TYPE_EDGE_RISING>,
                     <GIC_SPI 50 IRQ_TYPE_EDGE_RISING>;
        interrupt-names = "i2s", "spdif";
        clocks = <&clkc CLKID_AIU_GLUE>,
                 <&clkc CLKID_I2S_OUT>,
                 <&clkc CLKID_AOCLK_GATE>,
                 <&clkc CLKID_CTS_AMCLK>,
                 <&clkc CLKID_MIXER_IFACE>,
                 <&clkc CLKID_IEC958>,
                 <&clkc CLKID_IEC958_GATE>,
                 <&clkc CLKID_CTS_MCLK_I958>,
                 <&clkc CLKID_CTS_I958>;
        clock-names = "pclk",
                      "i2s_pclk",
                      "i2s_aoclk",
                      "i2s_mclk",
                      "i2s_mixer",
                      "spdif_pclk",
                      "spdif_aoclk",
                      "spdif_mclk",
                      "spdif_mclk_sel";
        resets = <&reset RESET_AIU>;
    };


code:
* Amlogic Audio FIFO controllers

Required properties:
- compatible: 'amlogic,axg-toddr' or
	      'amlogic,axg-toddr' or
	      'amlogic,g12a-frddr' or
	      'amlogic,g12a-toddr' or
	      'amlogic,sm1-frddr' or
	      'amlogic,sm1-toddr'
- reg: physical base address of the controller and length of memory
       mapped region.
- interrupts: interrupt specifier for the fifo.
- clocks: phandle to the fifo peripheral clock provided by the audio
	  clock controller.
- resets: list of reset phandle, one for each entry reset-names.
- reset-names: should contain the following:
  * "arb" : memory ARB line (required)
  * "rst" : dedicated device reset line (optional)
- #sound-dai-cells: must be 0.
- amlogic,fifo-depth: The size of the controller's fifo in bytes. This
  		      is useful for determining certain configuration such
		      as the flush threshold of the fifo

Example of FRDDR A on the A113 SoC:

frddr_a: audio-controller@1c0 {
	compatible = "amlogic,axg-frddr";
	reg = <0x0 0x1c0 0x0 0x1c>;
	#sound-dai-cells = <0>;
	interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
	clocks = <&clkc_audio AUD_CLKID_FRDDR_A>;
	resets = <&arb AXG_ARB_FRDDR_A>;
	fifo-depth = <512>;
};


code:
* Amlogic Audio PDM input

Required properties:
- compatible: 'amlogic,axg-pdm' or
	      'amlogic,g12a-pdm' or
	      'amlogic,sm1-pdm'
- reg: physical base address of the controller and length of memory
       mapped region.
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
  * "pclk"   : peripheral clock.
  * "dclk"   : pdm digital clock
  * "sysclk" : dsp system clock
- #sound-dai-cells: must be 0.

Optional property:
- resets: phandle to the dedicated reset line of the pdm input.

Example of PDM on the A113 SoC:

pdm: audio-controller@ff632000 {
	compatible = "amlogic,axg-pdm";
	reg = <0x0 0xff632000 0x0 0x34>;
	#sound-dai-cells = <0>;
	clocks = <&clkc_audio AUD_CLKID_PDM>,
		 <&clkc_audio AUD_CLKID_PDM_DCLK>,
		 <&clkc_audio AUD_CLKID_PDM_SYSCLK>;
	clock-names = "pclk", "dclk", "sysclk";
};


code:
Amlogic AXG sound card:

Required properties:

- compatible: "amlogic,axg-sound-card"
- model : User specified audio sound card name, one string

Optional properties:

- audio-aux-devs : List of phandles pointing to auxiliary devices
- audio-widgets : Please refer to widgets.txt.
- audio-routing : A list of the connections between audio components.

Subnodes:

- dai-link: Container for dai-link level properties and the CODEC
	    sub-nodes. There should be at least one (and probably more)
	    subnode of this type.

Required dai-link properties:

- sound-dai: phandle and port of the CPU DAI.

Required TDM Backend dai-link properties:
- dai-format : CPU/CODEC common audio format

Optional TDM Backend dai-link properties:
- dai-tdm-slot-rx-mask-{0,1,2,3}: Receive direction slot masks
- dai-tdm-slot-tx-mask-{0,1,2,3}: Transmit direction slot masks
				  When omitted, mask is assumed to have to no
				  slots. A valid must have at one slot, so at
				  least one these mask should be provided with
				  an enabled slot.
- dai-tdm-slot-num : Please refer to tdm-slot.txt.
		     If omitted, slot number is set to accommodate the largest
		     mask provided.
- dai-tdm-slot-width : Please refer to tdm-slot.txt. default to 32 if omitted.
- mclk-fs : Multiplication factor between stream rate and mclk

Backend dai-link subnodes:

- codec: dai-link representing backend links should have at least one subnode.
	 One subnode for each codec of the dai-link.
	 dai-link representing frontend links have no codec, therefore have no
	 subnodes

Required codec subnodes properties:

- sound-dai: phandle and port of the CODEC DAI.

Optional codec subnodes properties:

- dai-tdm-slot-tx-mask : Please refer to tdm-slot.txt.
- dai-tdm-slot-rx-mask : Please refer to tdm-slot.txt.

Example:

sound {
	compatible = "amlogic,axg-sound-card";
	model = "AXG-S420";
	audio-aux-devs = <&tdmin_a>, <&tdmout_c>;
	audio-widgets = "Line", "Lineout",
			"Line", "Linein",
			"Speaker", "Speaker1 Left",
			"Speaker", "Speaker1 Right";
			"Speaker", "Speaker2 Left",
			"Speaker", "Speaker2 Right";
	audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
			"SPDIFOUT IN 0", "FRDDR_A OUT 3",
			"TDM_C Playback", "TDMOUT_C OUT",
			"TDMIN_A IN 2", "TDM_C Capture",
			"TDMIN_A IN 5", "TDM_C Loopback",
			"TODDR_A IN 0", "TDMIN_A OUT",
			"Lineout", "Lineout AOUTL",
			"Lineout", "Lineout AOUTR",
			"Speaker1 Left", "SPK1 OUT_A",
			"Speaker2 Left", "SPK2 OUT_A",
			"Speaker1 Right", "SPK1 OUT_B",
			"Speaker2 Right", "SPK2 OUT_B",
			"Linein AINL", "Linein",
			"Linein AINR", "Linein";

	dai-link@0 {
		sound-dai = <&frddr_a>;
	};

	dai-link@1 {
		sound-dai = <&toddr_a>;
	};

	dai-link@2 {
		sound-dai = <&tdmif_c>;
		dai-format = "i2s";
		dai-tdm-slot-tx-mask-2 = <1 1>;
		dai-tdm-slot-tx-mask-3 = <1 1>;
		dai-tdm-slot-rx-mask-1 = <1 1>;
		mclk-fs = <256>;

		codec@0 {
			sound-dai = <&lineout>;
		};

		codec@1 {
			sound-dai = <&speaker_amp1>;
		};

		codec@2 {
			sound-dai = <&speaker_amp2>;
		};

		codec@3 {
			sound-dai = <&linein>;
		};

	};

	dai-link@3 {
		sound-dai = <&spdifout>;

		codec {
			sound-dai = <&spdif_dit>;
		};
	};
};


code:
* Amlogic Audio SPDIF Input

Required properties:
- compatible: 'amlogic,axg-spdifin' or
	      'amlogic,g12a-spdifin' or
	      'amlogic,sm1-spdifin'
- interrupts: interrupt specifier for the spdif input.
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
  * "pclk" : peripheral clock.
  * "refclk" : spdif input reference clock
- #sound-dai-cells: must be 0.

Optional property:
- resets: phandle to the dedicated reset line of the spdif input.

Example on the A113 SoC:

spdifin: audio-controller@400 {
	compatible = "amlogic,axg-spdifin";
	reg = <0x0 0x400 0x0 0x30>;
	#sound-dai-cells = <0>;
	interrupts = <GIC_SPI 87 IRQ_TYPE_EDGE_RISING>;
	clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
		 <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
	clock-names = "pclk", "refclk";
};


code:
* Amlogic Audio SPDIF Output

Required properties:
- compatible: 'amlogic,axg-spdifout' or
	      'amlogic,g12a-spdifout' or
	      'amlogic,sm1-spdifout'
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
  * "pclk" : peripheral clock.
  * "mclk" : master clock
- #sound-dai-cells: must be 0.

Optional property:
- resets: phandle to the dedicated reset line of the spdif output.

Example on the A113 SoC:

spdifout: audio-controller@480 {
	compatible = "amlogic,axg-spdifout";
	reg = <0x0 0x480 0x0 0x50>;
	#sound-dai-cells = <0>;
	clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
		 <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
	clock-names = "pclk", "mclk";
};


code:
* Amlogic Audio TDM formatters

Required properties:
- compatible: 'amlogic,axg-tdmin' or
	      'amlogic,axg-tdmout' or
	      'amlogic,g12a-tdmin' or
	      'amlogic,g12a-tdmout' or
	      'amlogic,sm1-tdmin' or
	      'amlogic,sm1-tdmout
- reg: physical base address of the controller and length of memory
       mapped region.
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
  * "pclk"     : peripheral clock.
  * "sclk"     : bit clock.
  * "sclk_sel" : bit clock input multiplexer.
  * "lrclk"    : sample clock
  * "lrclk_sel": sample clock input multiplexer

Optional property:
- resets: phandle to the dedicated reset line of the tdm formatter.

Example of TDMOUT_A on the S905X2 SoC:

tdmout_a: audio-controller@500 {
	compatible = "amlogic,axg-tdmout";
	reg = <0x0 0x500 0x0 0x40>;
	resets = <&clkc_audio AUD_RESET_TDMOUT_A>;
	clocks = <&clkc_audio AUD_CLKID_TDMOUT_A>,
		 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK>,
		 <&clkc_audio AUD_CLKID_TDMOUT_A_SCLK_SEL>,
		 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>,
		 <&clkc_audio AUD_CLKID_TDMOUT_A_LRCLK>;
	clock-names = "pclk", "sclk", "sclk_sel",
		      "lrclk", "lrclk_sel";
};


code:
* Amlogic Audio TDM Interfaces

Required properties:
- compatible: 'amlogic,axg-tdm-iface'
- clocks: list of clock phandle, one for each entry clock-names.
- clock-names: should contain the following:
  * "sclk" : bit clock.
  * "lrclk": sample clock
  * "mclk" : master clock
	     -> optional if the interface is in clock slave mode.
- #sound-dai-cells: must be 0.

Example of TDM_A on the A113 SoC:

tdmif_a: audio-controller@0 {
	compatible = "amlogic,axg-tdm-iface";
	#sound-dai-cells = <0>;
	clocks = <&clkc_audio AUD_CLKID_MST_A_MCLK>,
		 <&clkc_audio AUD_CLKID_MST_A_SCLK>,
		 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
	clock-names = "mclk", "sclk", "lrclk";
};


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,g12a-toacodec.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic G12a Internal DAC Control Glue

maintainers:
  - Jerome Brunet <jbrunet@baylibre.com>

allOf:
  - $ref: dai-common.yaml#

properties:
  $nodename:
    pattern: "^audio-controller@.*"

  "#sound-dai-cells":
    const: 1

  compatible:
    oneOf:
      - items:
          - const: amlogic,g12a-toacodec
      - items:
          - enum:
              - amlogic,sm1-toacodec
          - const: amlogic,g12a-toacodec

  reg:
    maxItems: 1

  resets:
    maxItems: 1

  sound-name-prefix: true

required:
  - "#sound-dai-cells"
  - compatible
  - reg
  - resets

additionalProperties: false

examples:
  - |
    #include <dt-bindings/reset/amlogic,meson-g12a-audio-reset.h>

    toacodec: audio-controller@740 {
        compatible = "amlogic,g12a-toacodec";
        reg = <0x740 0x4>;
        #sound-dai-cells = <1>;
        resets = <&clkc_audio AUD_RESET_TOACODEC>;
    };


code:
* Amlogic HDMI Tx control glue

Required properties:
- compatible: "amlogic,g12a-tohdmitx" or
	      "amlogic,sm1-tohdmitx"
- reg: physical base address of the controller and length of memory
       mapped region.
- #sound-dai-cells: should be 1.
- resets: phandle to the dedicated reset line of the hdmitx glue.

Example on the S905X2 SoC:

tohdmitx: audio-controller@744 {
	compatible = "amlogic,g12a-tohdmitx";
	reg = <0x0 0x744 0x0 0x4>;
	#sound-dai-cells = <1>;
	resets = <&clkc_audio AUD_RESET_TOHDMITX>;
};

Example of an 'amlogic,axg-sound-card':

sound {
	compatible = "amlogic,axg-sound-card";

[...]

	dai-link-x {
		sound-dai = <&tdmif_a>;
		dai-format = "i2s";
		dai-tdm-slot-tx-mask-0 = <1 1>;

		codec-0 {
			sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
		};

		codec-1 {
			sound-dai = <&external_dac>;
		};
	};

	dai-link-y {
		sound-dai = <&tdmif_c>;
		dai-format = "i2s";
		dai-tdm-slot-tx-mask-0 = <1 1>;

		codec {
			sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
		};
	};

	dai-link-z {
		sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;

		codec {
			sound-dai = <&hdmi_tx>;
		};
	};
};


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,gx-sound-card.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic GX sound card

maintainers:
  - Jerome Brunet <jbrunet@baylibre.com>

properties:
  compatible:
    items:
      - const: amlogic,gx-sound-card

  audio-aux-devs:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    description: list of auxiliary devices

  audio-routing:
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
    minItems: 2
    description: |-
      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.

  audio-widgets:
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
    minItems: 2
    description: |-
      A list off component DAPM widget. Each entry is a pair of strings,
      the first being the widget type, the second being the widget name

  model:
    $ref: /schemas/types.yaml#/definitions/string
    description: User specified audio sound card name

patternProperties:
  "^dai-link-[0-9]+$":
    type: object
    additionalProperties: false
    description: |-
      dai-link child nodes:
        Container for dai-link level properties and the CODEC sub-nodes.
        There should be at least one (and probably more) subnode of this type

    properties:
      dai-format:
        $ref: /schemas/types.yaml#/definitions/string
        enum: [ i2s, left-j, dsp_a ]

      mclk-fs:
        $ref: /schemas/types.yaml#/definitions/uint32
        description: |-
          Multiplication factor between the frame rate and master clock
          rate

      sound-dai:
        maxItems: 1
        description: phandle of the CPU DAI

    patternProperties:
      "^codec-[0-9]+$":
        type: object
        additionalProperties: false
        description: |-
          Codecs:
          dai-link representing backend links should have at least one subnode.
          One subnode for each codec of the dai-link. dai-link representing
          frontend links have no codec, therefore have no subnodes

        properties:
          sound-dai:
            maxItems: 1
            description: phandle of the codec DAI

        required:
          - sound-dai

    required:
      - sound-dai

required:
  - model
  - dai-link-0

additionalProperties: false

examples:
  - |
    sound {
        compatible = "amlogic,gx-sound-card";
        model = "GXL-ACME-S905X-FOO";
        audio-aux-devs = <&amp>;
        audio-routing = "I2S ENCODER I2S IN", "I2S FIFO Playback";

        dai-link-0 {
               sound-dai = <&i2s_fifo>;
        };

        dai-link-1 {
                sound-dai = <&i2s_encoder>;
                dai-format = "i2s";
                mclk-fs = <256>;

                codec-0 {
                        sound-dai = <&codec0>;
                };

                codec-1 {
                        sound-dai = <&codec1>;
                };
        };
    };


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/amlogic,t9015.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic T9015 Internal Audio DAC

maintainers:
  - Jerome Brunet <jbrunet@baylibre.com>

allOf:
  - $ref: dai-common.yaml#

properties:
  $nodename:
    pattern: "^audio-controller@.*"

  "#sound-dai-cells":
    const: 0

  compatible:
    items:
      - const: amlogic,t9015

  clocks:
    items:
      - description: Peripheral clock

  clock-names:
    items:
      - const: pclk

  reg:
    maxItems: 1

  resets:
    maxItems: 1

  AVDD-supply:
    description:
      Analogue power supply.

  sound-name-prefix: true

required:
  - "#sound-dai-cells"
  - compatible
  - reg
  - clocks
  - clock-names
  - resets
  - AVDD-supply

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/g12a-clkc.h>
    #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>

    acodec: audio-controller@32000 {
        compatible = "amlogic,t9015";
        reg = <0x32000 0x14>;
        #sound-dai-cells = <0>;
        clocks = <&clkc CLKID_AUDIO_CODEC>;
        clock-names = "pclk";
        resets = <&reset RESET_AUDIO_CODEC>;
        AVDD-supply = <&vddao_1v8>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/apple,mca.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple MCA I2S transceiver

description: |
  MCA is an I2S transceiver peripheral found on M1 and other Apple chips. It is
  composed of a number of identical clusters which can operate independently
  or in an interlinked fashion. Up to 6 clusters have been seen on an MCA.

maintainers:
  - Martin Povišer <povik+lin@cutebit.org>

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    items:
      - enum:
          - apple,t6000-mca
          - apple,t8103-mca
      - const: apple,mca

  reg:
    items:
      - description: Register region of the MCA clusters proper
      - description: Register region of the DMA glue and its FIFOs

  interrupts:
    minItems: 4
    maxItems: 6
    description:
      One interrupt per each cluster

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  dmas:
    minItems: 16
    maxItems: 24
    description:
      DMA channels corresponding to the SERDES units in the peripheral. They are
      listed in groups of four per cluster, and within the group they are given
      as associated to the TXA, RXA, TXB, RXB units.

  dma-names:
    minItems: 16
    items:
      - const: tx0a
      - const: rx0a
      - const: tx0b
      - const: rx0b
      - const: tx1a
      - const: rx1a
      - const: tx1b
      - const: rx1b
      - const: tx2a
      - const: rx2a
      - const: tx2b
      - const: rx2b
      - const: tx3a
      - const: rx3a
      - const: tx3b
      - const: rx3b
      - const: tx4a
      - const: rx4a
      - const: tx4b
      - const: rx4b
      - const: tx5a
      - const: rx5a
      - const: tx5b
      - const: rx5b
    description: |
      Names for the DMA channels: 'tx'/'rx', then cluster number, then 'a'/'b'
      based on the associated SERDES unit.

  clocks:
    minItems: 4
    maxItems: 6
    description:
      Clusters' input reference clock.

  resets:
    maxItems: 1

  power-domains:
    minItems: 5
    maxItems: 7
    description:
      First a general power domain for register access, then the power
      domains of individual clusters for their operation.

  '#sound-dai-cells':
    const: 1

required:
  - compatible
  - reg
  - dmas
  - dma-names
  - clocks
  - power-domains
  - '#sound-dai-cells'

unevaluatedProperties: false

examples:
  - |
    mca: i2s@9b600000 {
      compatible = "apple,t6000-mca", "apple,mca";
      reg = <0x9b600000 0x10000>,
            <0x9b200000 0x20000>;

      clocks = <&nco 0>, <&nco 1>, <&nco 2>, <&nco 3>;
      power-domains = <&ps_audio_p>, <&ps_mca0>, <&ps_mca1>,
                      <&ps_mca2>, <&ps_mca3>;
      dmas = <&admac 0>, <&admac 1>, <&admac 2>, <&admac 3>,
             <&admac 4>, <&admac 5>, <&admac 6>, <&admac 7>,
             <&admac 8>, <&admac 9>, <&admac 10>, <&admac 11>,
             <&admac 12>, <&admac 13>, <&admac 14>, <&admac 15>;
      dma-names = "tx0a", "rx0a", "tx0b", "rx0b",
                  "tx1a", "rx1a", "tx1b", "rx1b",
                  "tx2a", "rx2a", "tx2b", "rx2b",
                  "tx3a", "rx3a", "tx3b", "rx3b";

      #sound-dai-cells = <1>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/arm,pl041.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Arm Ltd. PrimeCell PL041 AACI sound interface

maintainers:
  - Andre Przywara <andre.przywara@arm.com>

description:
  The Arm PrimeCell Advanced Audio CODEC Interface (AACI) is an AMBA compliant
  peripheral that provides communication with an audio CODEC using the AC-link
  protocol.

# We need a select here so we don't match all nodes with 'arm,primecell'
select:
  properties:
    compatible:
      contains:
        const: arm,pl041
  required:
    - compatible

properties:
  compatible:
    items:
      - const: arm,pl041
      - const: arm,primecell

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    description: APB register access clock

  clock-names:
    const: apb_pclk

required:
  - compatible
  - reg
  - interrupts
  - clocks

additionalProperties: false

examples:
  - |
    audio-controller@40000 {
        compatible = "arm,pl041", "arm,primecell";
        reg = <0x040000 0x1000>;
        interrupts = <11>;
        clocks = <&v2m_clk24mhz>;
        clock-names = "apb_pclk";
    };

...


code:
Device Tree bindings for the Armada 370 DB audio
================================================

These Device Tree bindings are used to describe the audio complex
found on the Armada 370 DB platform.

Mandatory properties:

 * compatible: must be "marvell,a370db-audio"

 * marvell,audio-controller: a phandle that points to the audio
   controller of the Armada 370 SoC.

 * marvell,audio-codec: a set of three phandles that points to:

    1/ the analog audio codec connected to the Armada 370 SoC
    2/ the S/PDIF transceiver
    3/ the S/PDIF receiver

Example:

	sound {
	      compatible = "marvell,a370db-audio";
	      marvell,audio-controller = <&audio_controller>;
	      marvell,audio-codec = <&audio_codec &spdif_out &spdif_in>;
	};


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/atmel,sama5d2-classd.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Atmel ClassD Amplifier

maintainers:
  - Nicolas Ferre <nicolas.ferre@microchip.com>
  - Alexandre Belloni <alexandre.belloni@bootlin.com>
  - Claudiu Beznea <claudiu.beznea@microchip.com>

description:
  The Audio Class D Amplifier (CLASSD) is a digital input, Pulse Width
  Modulated (PWM) output stereo Class D amplifier.

properties:
  compatible:
    const: atmel,sama5d2-classd

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  dmas:
    maxItems: 1

  dma-names:
    const: tx

  clocks:
    maxItems: 2

  clock-names:
    items:
      - const: pclk
      - const: gclk

  atmel,model:
    $ref: /schemas/types.yaml#/definitions/string
    default: CLASSD
    description: The user-visible name of this sound complex.

  atmel,pwm-type:
    $ref: /schemas/types.yaml#/definitions/string
    enum:
      - single
      - diff
    default: single
    description: PWM modulation type.

  atmel,non-overlap-time:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 5
      - 10
      - 15
      - 20
    default: 10
    description:
      Set non-overlapping time, the unit is nanosecond(ns).
      Non-overlapping will be disabled if not specified.

required:
  - compatible
  - reg
  - interrupts
  - dmas
  - dma-names
  - clock-names
  - clocks

additionalProperties: false

examples:
  - |
    #include <dt-bindings/dma/at91.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    classd: sound@fc048000 {
        compatible = "atmel,sama5d2-classd";
        reg = <0xfc048000 0x100>;
        interrupts = <59 IRQ_TYPE_LEVEL_HIGH 7>;
        dmas = <&dma0
            (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
            | AT91_XDMAC_DT_PERID(47))>;
        dma-names = "tx";
        clocks = <&classd_clk>, <&classd_gclk>;
        clock-names = "pclk", "gclk";
        assigned-clocks = <&classd_gclk>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_classd_default>;
        atmel,model = "classd @ SAMA5D2-Xplained";
        atmel,pwm-type = "diff";
        atmel,non-overlap-time = <10>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/atmel,sama5d2-i2s.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Atmel I2S controller

maintainers:
  - Nicolas Ferre <nicolas.ferre@microchip.com>
  - Alexandre Belloni <alexandre.belloni@bootlin.com>
  - Claudiu Beznea <claudiu.beznea@microchip.com>

description:
  Atmel I2S (Inter-IC Sound Controller) bus is the standard
  interface for connecting audio devices, such as audio codecs.

properties:
  compatible:
    const: atmel,sama5d2-i2s

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: Peripheral clock
      - description: Generated clock (Optional)
      - description: I2S mux clock (Optional). Set
          with gclk when Master Mode is required.
    minItems: 1

  clock-names:
    items:
      - const: pclk
      - const: gclk
      - const: muxclk
    minItems: 1

  dmas:
    items:
      - description: TX DMA Channel
      - description: RX DMA Channel

  dma-names:
    items:
      - const: tx
      - const: rx

required:
  - compatible
  - reg
  - interrupts
  - dmas
  - dma-names
  - clocks
  - clock-names

additionalProperties: false

examples:
  - |
    #include <dt-bindings/dma/at91.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    i2s@f8050000 {
        compatible = "atmel,sama5d2-i2s";
        reg = <0xf8050000 0x300>;
        interrupts = <54 IRQ_TYPE_LEVEL_HIGH 7>;
        dmas = <&dma0
                (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
                AT91_XDMAC_DT_PERID(31))>,
               <&dma0
                (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
                AT91_XDMAC_DT_PERID(32))>;
        dma-names = "tx", "rx";
        clocks = <&i2s0_clk>, <&i2s0_gclk>, <&i2s0muxck>;
        clock-names = "pclk", "gclk", "muxclk";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_i2s0_default>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/atmel,sama5d2-pdmic.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Atmel PDMIC decoder

maintainers:
  - Claudiu Beznea <claudiu.beznea@microchip.com>

description:
  Atmel Pulse Density Modulation Interface Controller
  (PDMIC) peripheral is a mono PDM decoder module
  that decodes an incoming PDM sample stream.

properties:
  compatible:
    const: atmel,sama5d2-pdmic

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: peripheral clock
      - description: generated clock

  clock-names:
    items:
      - const: pclk
      - const: gclk

  dmas:
    maxItems: 1

  dma-names:
    const: rx

  atmel,mic-min-freq:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      The minimal frequency that the microphone supports.

  atmel,mic-max-freq:
    $ref: /schemas/types.yaml#/definitions/uint32
    description:
      The maximal frequency that the microphone supports.

  atmel,model:
    $ref: /schemas/types.yaml#/definitions/string
    default: PDMIC
    description: The user-visible name of this sound card.

  atmel,mic-offset:
    $ref: /schemas/types.yaml#/definitions/int32
    default: 0
    description: The offset that should be added.

required:
  - compatible
  - reg
  - interrupts
  - dmas
  - dma-names
  - clock-names
  - clocks
  - atmel,mic-min-freq
  - atmel,mic-max-freq

additionalProperties: false

examples:
  - |
    #include <dt-bindings/dma/at91.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    pdmic: sound@f8018000 {
        compatible = "atmel,sama5d2-pdmic";
        reg = <0xf8018000 0x124>;
        interrupts = <48 IRQ_TYPE_LEVEL_HIGH 7>;
        dmas = <&dma0
                (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
                | AT91_XDMAC_DT_PERID(50))>;
        dma-names = "rx";
        clocks = <&pdmic_clk>, <&pdmic_gclk>;
        clock-names = "pclk", "gclk";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_pdmic_default>;
        atmel,model = "PDMIC@sama5d2_xplained";
        atmel,mic-min-freq = <1000000>;
        atmel,mic-max-freq = <3246000>;
        atmel,mic-offset = <0x0>;
    };


code:
* Atmel at91sam9g20ek wm8731 audio complex

Required properties:
  - compatible: "atmel,at91sam9g20ek-wm8731-audio"
  - atmel,model: The user-visible name of this sound complex.
  - atmel,audio-routing: A list of the connections between audio components.
  - atmel,ssc-controller: The phandle of the SSC controller
  - atmel,audio-codec: The phandle of the WM8731 audio codec
Optional properties:
  - pinctrl-names, pinctrl-0: Please refer to pinctrl-bindings.txt

Example:
sound {
	compatible = "atmel,at91sam9g20ek-wm8731-audio";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pck0_as_mck>;

	atmel,model = "wm8731 @ AT91SAMG20EK";

	atmel,audio-routing =
		"Ext Spk", "LHPOUT",
		"Int MIC", "MICIN";

	atmel,ssc-controller = <&ssc0>;
	atmel,audio-codec = <&wm8731>;
};


code:
* Atmel at91sam9x5ek wm8731 audio complex

Required properties:
  - compatible: "atmel,sam9x5-wm8731-audio"
  - atmel,model: The user-visible name of this sound complex.
  - atmel,ssc-controller: The phandle of the SSC controller
  - atmel,audio-codec: The phandle of the WM8731 audio codec
  - atmel,audio-routing: 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.

Available audio endpoints for the audio-routing table:

Board connectors:
 * Headphone Jack
 * Line In Jack

wm8731 pins:
cf Documentation/devicetree/bindings/sound/wlf,wm8731.yaml

Example:
sound {
	compatible = "atmel,sam9x5-wm8731-audio";

	atmel,model = "wm8731 @ AT91SAM9X5EK";

	atmel,audio-routing =
		"Headphone Jack", "RHPOUT",
		"Headphone Jack", "LHPOUT",
		"LLINEIN", "Line In Jack",
		"RLINEIN", "Line In Jack";

	atmel,ssc-controller = <&ssc0>;
	atmel,audio-codec = <&wm8731>;
};


code:
Atmel ASoC driver with wm8904 audio codec complex

Required properties:
  - compatible: "atmel,asoc-wm8904"
  - atmel,model: The user-visible name of this sound complex.
  - atmel,audio-routing: 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 for sources and
    sinks are the WM8904's pins, and the jacks on the board:

    WM8904 pins:

    * IN1L
    * IN1R
    * IN2L
    * IN2R
    * IN3L
    * IN3R
    * HPOUTL
    * HPOUTR
    * LINEOUTL
    * LINEOUTR
    * MICBIAS

    Board connectors:

    * Headphone Jack
    * Line In Jack
    * Mic

  - atmel,ssc-controller: The phandle of the SSC controller
  - atmel,audio-codec: The phandle of the WM8904 audio codec

Optional properties:
  - pinctrl-names, pinctrl-0: Please refer to pinctrl-bindings.txt

Example:
sound {
	compatible = "atmel,asoc-wm8904";
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_pck0_as_mck>;

	atmel,model = "wm8904 @ AT91SAM9N12EK";

	atmel,audio-routing =
		"Headphone Jack", "HPOUTL",
		"Headphone Jack", "HPOUTR",
		"IN2L", "Line In Jack",
		"IN2R", "Line In Jack",
		"Mic", "MICBIAS",
		"IN1L", "Mic";

	atmel,ssc-controller = <&ssc0>;
	atmel,audio-codec = <&wm8904>;
};


code:
* Atmel AC97 controller

Required properties:
  - compatible: "atmel,at91sam9263-ac97c"
  - reg: Address and length of the register set for the device
  - interrupts: Should contain AC97 interrupt
  - ac97-gpios: Please refer to soc-ac97link.txt, only ac97-reset is used
Optional properties:
  - pinctrl-names, pinctrl-0: Please refer to pinctrl-bindings.txt

Example:
sound@fffa0000 {
       compatible = "atmel,at91sam9263-ac97c";
       pinctrl-names = "default";
       pinctrl-0 = <&pinctrl_ac97>;
       reg = <0xfffa0000 0x4000>;
       interrupts = <18 IRQ_TYPE_LEVEL_HIGH 5>;

       ac97-gpios = <&pioB 0 0 &pioB 2 0 &pioC 29 GPIO_ACTIVE_LOW>;
};


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/audio-graph-card.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Audio Graph Card

maintainers:
  - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

allOf:
  - $ref: /schemas/sound/audio-graph.yaml#

properties:
  compatible:
    enum:
      - audio-graph-card
      - audio-graph-scu-card

required:
  - compatible

unevaluatedProperties: false

examples:
  - |
    sound {
        compatible = "audio-graph-card";

        dais = <&cpu_port_a>;
    };

    cpu {
        /*
         * dai-controller own settings
         */

        port {
            cpu_endpoint: endpoint {
                remote-endpoint = <&codec_endpoint>;
                dai-format = "left_j";
            };
        };
    };

    codec {
        /*
         * codec own settings
         */

        port {
            codec_endpoint: endpoint {
                remote-endpoint = <&cpu_endpoint>;
            };
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/audio-graph-card2.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Audio Graph Card2

maintainers:
  - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

properties:
  compatible:
    enum:
      - audio-graph-card2
  links:
    $ref: /schemas/types.yaml#/definitions/phandle-array
  label:
    maxItems: 1
  routing:
    description: |
      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.
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
  multi:
    type: object
    description: Multi-CPU/Codec node
  dpcm:
    type: object
    description: DPCM node
  codec2codec:
    type: object
    description: Codec to Codec node

required:
  - compatible
  - links

additionalProperties: false

examples:
  - |
    sound {
        compatible = "audio-graph-card2";

        links = <&cpu_port>;
    };

    cpu {
        compatible = "cpu-driver";

        cpu_port: port { cpu_ep: endpoint { remote-endpoint = <&codec_ep>; }; };
    };

    codec {
        compatible = "codec-driver";

        port { codec_ep: endpoint { remote-endpoint = <&cpu_ep>; }; };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/audio-graph-port.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Audio Graph Card 'port' Node Bindings

maintainers:
  - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

select: false

allOf:
  - $ref: /schemas/graph.yaml#/$defs/port-base

properties:
  prefix:
    description: "device name prefix"
    $ref: /schemas/types.yaml#/definitions/string
  convert-rate:
    $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
  convert-channels:
    $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"
  convert-sample-format:
    $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format"

patternProperties:
  "^endpoint(@[0-9a-f]+)?":
    $ref: /schemas/graph.yaml#/$defs/endpoint-base
    unevaluatedProperties: false

    properties:
      mclk-fs:
        description: |
          Multiplication factor between stream rate and codec mclk.
          When defined, mclk-fs property defined in dai-link sub nodes are
          ignored.
        $ref: /schemas/types.yaml#/definitions/uint32
      frame-inversion:
        description: dai-link uses frame clock inversion
        $ref: /schemas/types.yaml#/definitions/flag
      bitclock-inversion:
        description: dai-link uses bit clock inversion
        $ref: /schemas/types.yaml#/definitions/flag
      frame-master:
        description: Indicates dai-link frame master.
        oneOf:
          - $ref: /schemas/types.yaml#/definitions/flag
          - $ref: /schemas/types.yaml#/definitions/phandle
      bitclock-master:
        description: Indicates dai-link bit clock master
        oneOf:
          - $ref: /schemas/types.yaml#/definitions/flag
          - $ref: /schemas/types.yaml#/definitions/phandle

      dai-format:
        description: audio format.
        items:
          enum:
            - i2s
            - right_j
            - left_j
            - dsp_a
            - dsp_b
            - ac97
            - pdm
            - msb
            - lsb
      convert-rate:
        $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
      convert-channels:
        $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"
      convert-sample-format:
        $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format"

      dai-tdm-slot-num:
        description: Number of slots in use.
        $ref: /schemas/types.yaml#/definitions/uint32
      dai-tdm-slot-width:
        description: Width in bits for each slot.
        $ref: /schemas/types.yaml#/definitions/uint32
      dai-tdm-slot-width-map:
        description: Mapping of sample widths to slot widths. For hardware
          that cannot support a fixed slot width or a slot width always
          equal to sample width. A matrix of one or more 3-tuples.
        $ref: /schemas/types.yaml#/definitions/uint32-matrix
        items:
          items:
            -
              description: Sample width in bits
              minimum: 8
              maximum: 64
            -
              description: Slot width in bits
              minimum: 8
              maximum: 256
            -
              description: Slot count
              minimum: 1
              maximum: 64

additionalProperties: true


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/audio-graph.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Audio Graph

maintainers:
  - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

properties:
  dais:
    $ref: /schemas/types.yaml#/definitions/phandle-array
  label:
    maxItems: 1
  prefix:
    description: "device name prefix"
    $ref: /schemas/types.yaml#/definitions/string
  routing:
    description: |
      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.
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
  widgets:
    description: User specified audio sound widgets.
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
  convert-rate:
    $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-rate"
  convert-channels:
    $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-channels"
  convert-sample-format:
    $ref: "/schemas/sound/dai-params.yaml#/$defs/dai-sample-format"

  pa-gpios:
    maxItems: 1
  hp-det-gpio:
    maxItems: 1
  mic-det-gpio:
    maxItems: 1

required:
  - dais

additionalProperties: true


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/awinic,aw8738.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Awinic AW8738 Audio Amplifier

maintainers:
  - Stephan Gerhold <stephan@gerhold.net>

description:
  The Awinic AW8738 is a simple audio amplifier with different operation modes
  (set using one-wire pulse control). The mode configures the speaker-guard
  function (primarily the power limit for the amplifier).

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    const: awinic,aw8738

  mode-gpios:
    description:
      GPIO used for one-wire pulse control. The pin is typically called SHDN
      (active-low), but this is misleading since it is actually more than
      just a simple shutdown/enable control.
    maxItems: 1

  awinic,mode:
    description: Operation mode (number of pulses for one-wire pulse control)
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 1
    maximum: 7

  sound-name-prefix: true

required:
  - compatible
  - mode-gpios
  - awinic,mode

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    audio-amplifier {
        compatible = "awinic,aw8738";
        mode-gpios = <&msmgpio 114 GPIO_ACTIVE_HIGH>;
        awinic,mode = <5>;
        sound-name-prefix = "Speaker Amp";
    };


code:
Devicetree bindings for the Axentia TSE-850 audio complex

Required properties:
  - compatible: "axentia,tse850-pcm5142"
  - axentia,cpu-dai: The phandle of the cpu dai.
  - axentia,audio-codec: The phandle of the PCM5142 codec.
  - axentia,add-gpios: gpio specifier that controls the mixer.
  - axentia,loop1-gpios: gpio specifier that controls loop relays on channel 1.
  - axentia,loop2-gpios: gpio specifier that controls loop relays on channel 2.
  - axentia,ana-supply: Regulator that supplies the output amplifier. Must
    support voltages in the 2V - 20V range, in 1V steps.

The schematics explaining the gpios are as follows:

               loop1 relays
   IN1 +---o  +------------+  o---+ OUT1
            \                /
             +              +
             |   /          |
             +--o  +--.     |
             |  add   |     |
             |        V     |
             |      .---.   |
   DAC +----------->|Sum|---+
             |      '---'   |
             |              |
             +              +

   IN2 +---o--+------------+--o---+ OUT2
               loop2 relays

The 'loop1' gpio pin controlls two relays, which are either in loop position,
meaning that input and output are directly connected, or they are in mixer
position, meaning that the signal is passed through the 'Sum' mixer. Similarly
for 'loop2'.

In the above, the 'loop1' relays are inactive, thus feeding IN1 to the mixer
(if 'add' is active) and feeding the mixer output to OUT1. The 'loop2' relays
are active, short-cutting the TSE-850 from channel 2. IN1, IN2, OUT1 and OUT2
are TSE-850 connectors and DAC is the PCB name of the (filtered) output from
the PCM5142 codec.

Example:

	&ssc0 {
		#sound-dai-cells = <0>;

	};

	&i2c {
		codec: pcm5142@4c {
			compatible = "ti,pcm5142";

			reg = <0x4c>;

			AVDD-supply = <&reg_3v3>;
			DVDD-supply = <&reg_3v3>;
			CPVDD-supply = <&reg_3v3>;

			clocks = <&sck>;

			pll-in = <3>;
			pll-out = <6>;
		};
	};

	ana: ana-reg {
		compatible = "pwm-regulator";

		regulator-name = "ANA";

		pwms = <&pwm0 2 1000 PWM_POLARITY_INVERTED>;
		pwm-dutycycle-unit = <1000>;
		pwm-dutycycle-range = <100 1000>;

		regulator-min-microvolt = <2000000>;
		regulator-max-microvolt = <20000000>;
		regulator-ramp-delay = <1000>;
	};

	sound {
		compatible = "axentia,tse850-pcm5142";

		axentia,cpu-dai = <&ssc0>;
		axentia,audio-codec = <&codec>;

		axentia,add-gpios = <&pioA 8 GPIO_ACTIVE_LOW>;
		axentia,loop1-gpios = <&pioA 10 GPIO_ACTIVE_LOW>;
		axentia,loop2-gpios = <&pioA 11 GPIO_ACTIVE_LOW>;

		axentia,ana-supply = <&ana>;
	};


code:
* Broadcom BCM2835 SoC I2S/PCM module

Required properties:
- compatible: "brcm,bcm2835-i2s"
- reg: Should contain PCM registers location and length.
- clocks: the (PCM) clock to use
- dmas: List of DMA controller phandle and DMA request line ordered pairs.
- dma-names: Identifier string for each DMA request line in the dmas property.
  These strings correspond 1:1 with the ordered pairs in dmas.

  One of the DMA channels will be responsible for transmission (should be
  named "tx") and one for reception (should be named "rx").

Example:

bcm2835_i2s: i2s@7e203000 {
	compatible = "brcm,bcm2835-i2s";
	reg = <0x7e203000 0x24>;
	clocks = <&clocks BCM2835_CLOCK_PCM>;

	dmas = <&dma 2>,
	       <&dma 3>;
	dma-names = "tx", "rx";
};


code:
Broadcom DSL/PON BCM63xx Audio I2S controller

Required properties:
- compatible:     Should be "brcm,bcm63xx-i2s".
- #address-cells: 32bit valued, 1 cell.
- #size-cells:    32bit valued, 0 cell.
- reg:            Should contain audio registers location and length
- interrupts:     Should contain the interrupt for the controller.
- clocks:         Must contain an entry for each entry in clock-names.
                  Please refer to clock-bindings.txt.
- clock-names:    One of each entry matching the clocks phandles list:
                  - "i2sclk" (generated clock) Required.
                  - "i2sosc" (fixed 200MHz clock) Required.

(1) : The generated clock is required only when any of TX and RX
      works on Master Mode.
(2) : The fixed 200MHz clock is from internal chip and always on

Example:

		i2s: bcm63xx-i2s {
			#address-cells = <1>;
			#size-cells = <0>;
			compatible = "brcm,bcm63xx-i2s";
			reg = <0xFF802080 0xFF>;
			interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
			clocks = <&i2sclk>, <&osc>;
			clock-names = "i2sclk","i2sosc";
		};


code:
BROADCOM Cygnus Audio I2S/TDM/SPDIF controller

Required properties:
	- compatible : "brcm,cygnus-audio"
	- #address-cells: 32bit valued, 1 cell.
	- #size-cells:  32bit valued, 0 cell.
	- reg : Should contain audio registers location and length
	- reg-names: names of the registers listed in "reg" property
		Valid names are "aud" and "i2s_in". "aud" contains a
		set of DMA, I2S_OUT and SPDIF registers. "i2s_in" contains
		a set of I2S_IN registers.
	- clocks: PLL and leaf clocks used by audio ports
	- assigned-clocks: PLL and leaf clocks
	- assigned-clock-parents: parent clocks of the assigned clocks
		(usually the PLL)
	- assigned-clock-rates: List of clock frequencies of the
		assigned clocks
	- clock-names: names of 3 leaf clocks used by audio ports
		Valid names are "ch0_audio", "ch1_audio", "ch2_audio"
	- interrupts: audio DMA interrupt number

SSP Subnode properties:
- reg: The index of ssp port interface to use
	Valid value are 0, 1, 2, or 3 (for spdif)

Example:
	cygnus_audio: audio@180ae000 {
		compatible = "brcm,cygnus-audio";
		#address-cells = <1>;
		#size-cells = <0>;
		reg = <0x180ae000 0xafd>, <0x180aec00 0x1f8>;
		reg-names = "aud", "i2s_in";
		clocks = <&audiopll BCM_CYGNUS_AUDIOPLL_CH0>,
				<&audiopll BCM_CYGNUS_AUDIOPLL_CH1>,
				<&audiopll BCM_CYGNUS_AUDIOPLL_CH2>;
		assigned-clocks = <&audiopll BCM_CYGNUS_AUDIOPLL>,
							<&audiopll BCM_CYGNUS_AUDIOPLL_CH0>,
							<&audiopll BCM_CYGNUS_AUDIOPLL_CH1>,
							<&audiopll BCM_CYGNUS_AUDIOPLL_CH2>;
		assigned-clock-parents = <&audiopll BCM_CYGNUS_AUDIOPLL>;
		assigned-clock-rates = <1769470191>,
								<0>,
								<0>,
								<0>;
		clock-names = "ch0_audio", "ch1_audio", "ch2_audio";
		interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;

		ssp0: ssp_port@0 {
			reg = <0>;
		};

		ssp1: ssp_port@1 {
			reg = <1>;
		};

		ssp2: ssp_port@2 {
			reg = <2>;
		};

		spdif: spdif_port@3 {
			reg = <3>;
		};
	};


code:
Bindings for I2S controller built into xtfpga Xtensa bitstreams.

Required properties:
- compatible: shall be "cdns,xtfpga-i2s".
- reg: memory region (address and length) with device registers.
- interrupts: interrupt for the device.
- clocks: phandle to the clk used as master clock. I2S bus clock
  is derived from it.

Examples:

	i2s0: xtfpga-i2s@d080000 {
		#sound-dai-cells = <0>;
		compatible = "cdns,xtfpga-i2s";
		reg = <0x0d080000 0x40>;
		interrupts = <2 1>;
		clocks = <&cdce706 4>;
	};


code:
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/cirrus,cs35l41.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cirrus Logic CS35L41 Speaker Amplifier

maintainers:
  - david.rhodes@cirrus.com

description: |
  CS35L41 is a boosted mono Class D amplifier with DSP
  speaker protection and equalization

properties:
  compatible:
    enum:
      - cirrus,cs35l40
      - cirrus,cs35l41

  reg:
    maxItems: 1

  '#sound-dai-cells':
    description:
      The first cell indicating the audio interface.
    const: 1

  reset-gpios:
    maxItems: 1

  VA-supply:
    description: voltage regulator phandle for the VA supply

  VP-supply:
    description: voltage regulator phandle for the VP supply

  cirrus,boost-peak-milliamp:
    description:
      Boost-converter peak current limit in mA.
      Configures the peak current by monitoring the current through the boost FET.
      Range starts at 1600 mA and goes to a maximum of 4500 mA with increments
      of 50 mA. See section 4.3.6 of the datasheet for details.
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 1600
    maximum: 4500
    default: 4500

  cirrus,boost-ind-nanohenry:
    description:
      Boost inductor value, expressed in nH. Valid
      values include 1000, 1200, 1500 and 2200.
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 1000
    maximum: 2200

  cirrus,boost-cap-microfarad:
    description:
      Total equivalent boost capacitance on the VBST
      and VAMP pins, derated at 11 volts DC. The value must be rounded to the
      nearest integer and expressed in uF.
    $ref: "/schemas/types.yaml#/definitions/uint32"

  cirrus,asp-sdout-hiz:
    description:
      Audio serial port SDOUT Hi-Z control. Sets the Hi-Z
      configuration for SDOUT pin of amplifier.
      0 = Logic 0 during unused slots, and while all transmit channels disabled
      1 = Hi-Z during unused slots but logic 0 while all transmit channels disabled
      2 = (Default) Logic 0 during unused slots, but Hi-Z while all transmit channels disabled
      3 = Hi-Z during unused slots and while all transmit channels disabled
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 3
    default: 2

  cirrus,boost-type:
    description:
      Configures the type of Boost being used.
      Internal boost requires boost-peak-milliamp, boost-ind-nanohenry and
      boost-cap-microfarad.
      External Boost must have GPIO1 as GPIO output. GPIO1 will be set high to
      enable boost voltage.
      0 = Internal Boost
      1 = External Boost
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 1

  cirrus,gpio1-polarity-invert:
    description:
      Boolean which specifies whether the GPIO1
      level is inverted. If this property is not present the level is not inverted.
    type: boolean

  cirrus,gpio1-output-enable:
    description:
      Boolean which specifies whether the GPIO1 pin
      is configured as an output. If this property is not present the
      pin will be configured as an input.
    type: boolean

  cirrus,gpio1-src-select:
    description:
      Configures the function of the GPIO1 pin.
      Note that the options are different from the GPIO2 pin
      0 = High Impedance (Default)
      1 = GPIO
      2 = Sync
      3 = MCLK input
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 3

  cirrus,gpio2-polarity-invert:
    description:
      Boolean which specifies whether the GPIO2
      level is inverted. If this property is not present the level is not inverted.
    type: boolean

  cirrus,gpio2-output-enable:
    description:
      Boolean which specifies whether the GPIO2 pin
      is configured as an output. If this property is not present the
      pin will be configured as an input.
    type: boolean

  cirrus,gpio2-src-select:
    description:
      Configures the function of the GPIO2 pin.
      Note that the options are different from the GPIO1 pin.
      0 = High Impedance (Default)
      1 = GPIO
      2 = Open Drain INTB
      3 = MCLK input
      4 = Push-pull INTB (active low)
      5 = Push-pull INT (active high)
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 5

required:
  - compatible
  - reg
  - "#sound-dai-cells"

allOf:
  - $ref: dai-common.yaml#
  - if:
      properties:
        cirrus,boost-type:
          const: 0
    then:
      required:
        - cirrus,boost-peak-milliamp
        - cirrus,boost-ind-nanohenry
        - cirrus,boost-cap-microfarad
    else:
      if:
        properties:
          cirrus,boost-type:
            const: 1
      then:
        required:
          - cirrus,gpio1-output-enable
          - cirrus,gpio1-src-select
        properties:
          cirrus,boost-peak-milliamp: false
          cirrus,boost-ind-nanohenry: false
          cirrus,boost-cap-microfarad: false
          cirrus,gpio1-src-select:
            enum: [1]

unevaluatedProperties: false

examples:
  - |
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        cs35l41: cs35l41@2 {
          #sound-dai-cells = <1>;
          compatible = "cirrus,cs35l41";
          reg = <2>;
          VA-supply = <&dummy_vreg>;
          VP-supply = <&dummy_vreg>;
          reset-gpios = <&gpio 110 0>;

          cirrus,boost-type = <0>;
          cirrus,boost-peak-milliamp = <4500>;
          cirrus,boost-ind-nanohenry = <1000>;
          cirrus,boost-cap-microfarad = <15>;
        };
    };


code:
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/cirrus,cs35l45.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cirrus Logic CS35L45 Speaker Amplifier

maintainers:
  - Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
  - Richard Fitzgerald <rf@opensource.cirrus.com>

description: |
  CS35L45 is a Boosted Mono Class D Amplifier with DSP
  Speaker Protection and Adaptive Battery Management.

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    enum:
      - cirrus,cs35l45

  reg:
    maxItems: 1

  '#sound-dai-cells':
    const: 1

  reset-gpios:
    maxItems: 1

  vdd-a-supply:
    description: voltage regulator phandle for the VDD_A supply

  vdd-batt-supply:
    description: voltage regulator phandle for the VDD_BATT supply

  spi-max-frequency:
    maximum: 5000000

  cirrus,asp-sdout-hiz-ctrl:
    description:
      Audio serial port SDOUT Hi-Z control. Sets the Hi-Z
      configuration for SDOUT pin of amplifier. Logical OR of
      CS35L45_ASP_TX_HIZ_xxx values.
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 3
    default: 2

required:
  - compatible
  - reg
  - "#sound-dai-cells"

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/sound/cs35l45.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;

        cs35l45: cs35l45@2 {
          #sound-dai-cells = <1>;
          compatible = "cirrus,cs35l45";
          reg = <2>;
          spi-max-frequency = <5000000>;
          vdd-a-supply = <&dummy_vreg>;
          vdd-batt-supply = <&dummy_vreg>;
          reset-gpios = <&gpio 110 0>;
          cirrus,asp-sdout-hiz-ctrl = <(CS35L45_ASP_TX_HIZ_UNUSED |
                                        CS35L45_ASP_TX_HIZ_DISABLED)>;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/cirrus,cs4234.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cirrus Logic cs4234 audio CODEC

maintainers:
  - patches@opensource.cirrus.com

description:
  The CS4234 is a highly versatile CODEC that combines 4 channels of
  high performance analog to digital conversion, 4 channels of high
  performance digital to analog conversion for audio, and 1 channel of
  digital to analog conversion to provide a nondelayed audio reference
  signal to an external Class H tracking power supply. If not used to
  drive a tracking power supply, the 5th DAC can instead be used as a
  standard audio grade DAC, with performance specifications identical
  to that of the 4 DACs in the audio path. Additionally, the CS4234
  includes tunable group delay for each of the 4 audio DAC paths to
  provide lead time for the external switch-mode power supply, and a
  nondelayed path into the DAC outputs for input signals requiring a
  low-latency path to the outputs.

properties:
  compatible:
    enum:
      - cirrus,cs4234

  reg:
    description:
      The 7-bit I2C address depends on the state of the ADx pins, in
      binary given by [0 0 1 0 AD2 AD1 AD0 0].
    items:
      minimum: 0x10
      maximum: 0x17

  VA-supply:
    description:
      Analogue power supply.

  VL-supply:
    description:
      Interface power supply.

  reset-gpios:
    maxItems: 1

required:
  - compatible
  - reg
  - VA-supply
  - VL-supply

additionalProperties: false

examples:
  - |
    i2c@e0004000 {
        #address-cells = <1>;
        #size-cells = <0>;
        reg = <0xe0004000 0x1000>;

        cs4234: codec@11 {
            compatible = "cirrus,cs4234";
            reg = <0x11>;

            VA-supply = <&vdd3v3>;
            VL-supply = <&vdd3v3>;

            reset-gpios = <&gpio 0>;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/cirrus,cs42l42.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cirrus Logic CS42L42 audio CODEC

maintainers:
  - patches@opensource.cirrus.com

description:
  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.

properties:
  compatible:
    enum:
      - cirrus,cs42l42
      - cirrus,cs42l83

  reg:
    description:
      The I2C address of the CS42L42.
    maxItems: 1

  VP-supply:
    description:
      VP power supply.

  VCP-supply:
    description:
      Charge pump power supply.

  VD_FILT-supply:
    description:
      FILT+ power supply.

  VL-supply:
    description:
      Logic power supply.

  VA-supply:
    description:
      Analog power supply.

  reset-gpios:
    description:
      This pin will be asserted and then deasserted to reset the
      CS42L42 before communication starts.
    maxItems: 1

  interrupts:
    description:
      Interrupt for CS42L42 IRQ line.
    maxItems: 1

  cirrus,ts-inv:
    description: |
      Sets the behaviour of the jack plug detect switch.

      0 - (Default) Shorted to tip when unplugged, open when plugged.
      This is "inverted tip sense (ITS)" in the datasheet.

      1 - Open when unplugged, shorted to tip when plugged.
      This is "normal tip sense (TS)" in the datasheet.

      The CS42L42_TS_INV_* defines are available for this.
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 1

  cirrus,ts-dbnc-rise:
    description: |
      Debounce the rising edge of TIP_SENSE_PLUG. With no
      debounce, the tip sense pin might be noisy on a plug event.

      0 - 0ms
      1 - 125ms
      2 - 250ms
      3 - 500ms
      4 - 750ms
      5 - 1s (Default)
      6 - 1.25s
      7 - 1.5s

      The CS42L42_TS_DBNCE_* defines are available for this.
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 7

  cirrus,ts-dbnc-fall:
    description: |
      Debounce the falling edge of TIP_SENSE_UNPLUG. With no
      debounce, the tip sense pin might be noisy on an unplug event.

      0 - 0ms
      1 - 125ms
      2 - 250ms
      3 - 500ms
      4 - 750ms
      5 - 1s (Default)
      6 - 1.25s
      7 - 1.5s

      The CS42L42_TS_DBNCE_* defines are available for this.
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 7

  cirrus,btn-det-init-dbnce:
    description: |
      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.

      0ms - 200ms,
      Default = 100ms
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 200

  cirrus,btn-det-event-dbnce:
    description: |
      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.

      0ms - 20ms,
      Default = 10ms
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 20

  cirrus,bias-lvls:
    description: |
      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 < 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.

      Array of 4 values, each 0-63
      < x1 x2 x3 x4 >
      Default = < 15 8 4 1 >
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 4
    maxItems: 4
    items:
      minimum: 0
      maximum: 63

  cirrus,hs-bias-ramp-rate:
    description: |
      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).

      0 - Fast rise time; slow, load-dependent fall time
      1 - Fast
      2 - Slow (default)
      3 - Slowest

      The CS42L42_HSBIAS_RAMP_* defines are available for this.
    $ref: "/schemas/types.yaml#/definitions/uint32"
    minimum: 0
    maximum: 3

  cirrus,hs-bias-sense-disable:
    description: |
      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.
    type: boolean

required:
  - compatible
  - reg
  - VP-supply
  - VCP-supply
  - VD_FILT-supply
  - VL-supply
  - VA-supply

additionalProperties: false

examples:
  - |
    #include <dt-bindings/sound/cs42l42.h>
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

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

          reset-gpios = <&axi_gpio_0 1 0>;
          interrupt-parent = <&gpio0>;
          interrupts = <55 8>;

          cirrus,ts-inv = <CS42L42_TS_INV_DIS>;
          cirrus,ts-dbnc-rise = <CS42L42_TS_DBNCE_1000>;
          cirrus,ts-dbnc-fall = <CS42L42_TS_DBNCE_0>;
          cirrus,btn-det-init-dbnce = <100>;
          cirrus,btn-det-event-dbnce = <10>;
          cirrus,bias-lvls = <0x0F 0x08 0x04 0x01>;
          cirrus,hs-bias-ramp-rate = <CS42L42_HSBIAS_RAMP_SLOW>;
      };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/cirrus,cs42l51.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: CS42L51 audio codec DT bindings

maintainers:
  - Olivier Moysan <olivier.moysan@foss.st.com>

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    const: cirrus,cs42l51

  reg:
    maxItems: 1

  "#sound-dai-cells":
    const: 0

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: MCLK

  reset-gpios:
    maxItems: 1

  VL-supply:
    description: phandle to voltage regulator of digital interface section

  VD-supply:
    description: phandle to voltage regulator of digital internal section

  VA-supply:
    description: phandle to voltage regulator of analog internal section

  VAHP-supply:
    description: phandle to voltage regulator of headphone

required:
  - compatible
  - reg
  - "#sound-dai-cells"

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    i2c {
      #address-cells = <1>;
      #size-cells = <0>;

      cs42l51@4a {
        compatible = "cirrus,cs42l51";
        reg = <0x4a>;
        #sound-dai-cells = <0>;
        clocks = <&mclk_prov>;
        clock-names = "MCLK";
        VL-supply = <&reg_audio>;
        VD-supply = <&reg_audio>;
        VA-supply = <&reg_audio>;
        VAHP-supply = <&reg_audio>;
        reset-gpios = <&gpiog 9 GPIO_ACTIVE_LOW>;
      };
    };
...


code:
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/cirrus,lochnagar.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cirrus Logic Lochnagar Audio Development Board

maintainers:
  - patches@opensource.cirrus.com

description: |
  Lochnagar is an evaluation and development board for Cirrus Logic
  Smart CODEC and Amp devices. It allows the connection of most Cirrus
  Logic devices on mini-cards, as well as allowing connection of various
  application processor systems to provide a full evaluation platform.
  Audio system topology, clocking and power can all be controlled through
  the Lochnagar, allowing the device under test to be used in a variety of
  possible use cases.

  This binding document describes the binding for the audio portion of the
  driver.

  This binding must be part of the Lochnagar MFD binding:
    [1] ../mfd/cirrus,lochnagar.yaml

allOf:
  - $ref: dai-common.yaml#

properties:
  compatible:
    enum:
      - cirrus,lochnagar2-soundcard

  '#sound-dai-cells':
    description:
      The first cell indicating the audio interface.
    const: 1

  clocks:
    description:
      Master clock source for the sound card, should normally be set to
      LOCHNAGAR_SOUNDCARD_MCLK provided by the Lochnagar clock driver.
    maxItems: 1

  clock-names:
    const: mclk

required:
  - compatible
  - '#sound-dai-cells'
  - clocks
  - clock-names

unevaluatedProperties: false


code:
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/sound/cirrus,madera.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cirrus Logic Madera class audio CODECs

maintainers:
  - patches@opensource.cirrus.com

description: |
  This describes audio configuration bindings for these codecs.

  See also the core bindings for the parent MFD driver:

    Documentation/devicetree/bindings/mfd/cirrus,madera.yaml

  and defines for values used in these bindings:

    include/dt-bindings/sound/madera.h

  The properties are all contained in the parent MFD node.

allOf:
  - $ref: dai-common.yaml#

properties:
  '#sound-dai-cells':
    description:
      The first cell indicating the audio interface.
    const: 1

  cirrus,inmode:
    description:
      A list of input mode settings for each input. A maximum
      of 24 cells, with four cells per input in the order INnAL,
      INnAR INnBL INnBR.  For non-muxed inputs the first two cells
      for that input set the mode for the left and right channel
      and the second two cells must be 0.  For muxed inputs the
      first two cells for that input set the mode of the left and
      right A inputs and the second two cells set the mode of the
      left and right B inputs.  Valid mode values are one of the
      MADERA_INMODE_xxx. If the array is shorter than the number
      of inputs the unspecified inputs default to MADERA_INMODE_DIFF.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 24
    items:
      minimum: 0
      maximum: 1
      default: 0

  cirrus,out-mono:
    description:
      Mono bit for each output, maximum of six cells if the array
      is shorter outputs will be set to stereo.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 6
    items:
      minimum: 0
      maximum: 1
      default: 0

  cirrus,dmic-ref:
    description: |
      Indicates how the MICBIAS pins have been externally connected
      to DMICs on each input, one cell per input.

        <IN1 IN2 IN3 ...>

      A value of 0 indicates MICVDD and is the default,
      other values depend on the codec: For CS47L35 one of the
      CS47L35_DMIC_REF_xxx values For all other codecs one of
      the MADERA_DMIC_REF_xxx values Also see the datasheet for a
      description of the INn_DMIC_SUP field.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 6
    items:
      minimum: 0
      maximum: 3
      default: 0

  cirrus,max-channels-clocked:
    description:
      Maximum number of channels that I2S clocks will be generated
      for. Useful when clock master for systems where the I2S bus
      has multiple data lines.  One cell for each AIF, use a value
      of zero for AIFs that should be handled normally.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 4
    items:
      default: 0

  cirrus,pdm-fmt:
    description:
      PDM speaker data format, must contain 2 cells (OUT5 and
      OUT6). See the PDM_SPKn_FMT field in the datasheet for a
      description of this value. The second cell is ignored for
      codecs that do not have OUT6.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 2
    maxItems: 2

  cirrus,pdm-mute:
    description: |
      PDM mute format, must contain 2 cells (OUT5 and OUT6). See the
      PDM_SPKn_CTRL_1 register in the datasheet for a description
      of this value.  The second cell is ignored for codecs that
      do not have OUT6.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 2
    maxItems: 2

additionalProperties: true


code:
CS35L32 audio CODEC

Required properties:

  - compatible : "cirrus,cs35l32"

  - reg : the I2C address of the device for I2C. Address is determined by the level
  of the AD0 pin. Level 0 is 0x40 while Level 1 is 0x41.

  - VA-supply, VP-supply : power supplies for the device,
  as covered in Documentation/devicetree/bindings/regulator/regulator.txt.

Optional properties:

  - reset-gpios : a GPIO spec for the reset pin. If specified, it will be
  deasserted before communication to the codec starts.

  - cirrus,boost-manager : Boost voltage control.
  0 = Automatically managed.  Boost-converter output voltage is the higher
  of the two: Class G or adaptive LED voltage.
  1 = Automatically managed irrespective of audio, adapting for low-power
  dissipation when LEDs are ON, and operating in Fixed-Boost Bypass Mode
  if LEDs are OFF (VBST = VP).
  2 = (Default) Boost voltage fixed in Bypass Mode (VBST = VP).
  3 = Boost voltage fixed at 5 V.

  - cirrus,sdout-datacfg : Data configuration for dual CS35L32 applications only.
  Determines the data packed in a two-CS35L32 configuration.
  0 = Left/right channels VMON[11:0], IMON[11:0], VPMON[7:0].
  1 = Left/right channels VMON[11:0], IMON[11:0], STATUS.
  2 = (Default) left/right channels VMON[15:0], IMON [15:0].
  3 = Left/right channels VPMON[7:0], STATUS.

  - cirrus,sdout-share : SDOUT sharing. Determines whether one or two CS35L32
  devices are on board sharing SDOUT.
  0 = (Default) One IC.
  1 = Two IC's.

  - cirrus,battery-recovery : Low battery nominal recovery threshold, rising VP.
  0 = 3.1V
  1 = 3.2V
  2 = 3.3V (Default)
  3 = 3.4V

  - cirrus,battery-threshold : Low battery nominal threshold, falling VP.
  0 = 3.1V
  1 = 3.2V
  2 = 3.3V
  3 = 3.4V (Default)
  4 = 3.5V
  5 = 3.6V

Example:

codec: codec@40 {
	compatible = "cirrus,cs35l32";
	reg = <0x40>;
	reset-gpios = <&gpio 10 0>;
	cirrus,boost-manager = <0x03>;
	cirrus,sdout-datacfg = <0x02>;
	VA-supply = <&reg_audio>;
};


code:
CS35L33 Speaker Amplifier

Required properties:

  - compatible : "cirrus,cs35l33"

  - reg : the I2C address of the device for I2C

  - VA-supply, VP-supply : power supplies for the device,
    as covered in
    Documentation/devicetree/bindings/regulator/regulator.txt.

Optional properties:

  - reset-gpios : gpio used to reset the amplifier

 -  interrupts : IRQ line info CS35L33.
    (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
    for further information relating to interrupt properties)

  - cirrus,boost-ctl : Booster voltage use to supply the amp. If the value is
    0, then VBST = VP. If greater than 0, the boost voltage will be 3300mV with
    a value of 1 and will increase at a step size of 100mV until a maximum of
    8000mV.

  - cirrus,ramp-rate : On power up, it affects the time from when the power
    up sequence begins to the time the audio reaches a full-scale output.
    On power down, it affects the time from when the power-down sequence
    begins to when the amplifier disables the PWM outputs. If this property
    is not set then soft ramping will be disabled and ramp time would be
    20ms. If this property is set to 0,1,2,3 then ramp times would be 40ms,
    60ms,100ms,175ms respectively for 48KHz sample rate.

  - cirrus,boost-ipk : The maximum current allowed for the boost converter.
    The range starts at 1850000uA and goes to a maximum of 3600000uA
    with a step size of 15625uA. The default is 2500000uA.

  - cirrus,imon-adc-scale : Configures the scaling of data bits from the IMON
    ADC data word. This property can be set as a value of 0 for bits 15 down
    to 0, 6 for 21 down to 6, 7, for 22 down to 7, 8 for 23 down to 8.

Optional H/G Algorithm sub-node:

The cs35l33 node can have a single "cirrus,hg-algo" sub-node that will enable
the internal H/G Algorithm.

  - cirrus,hg-algo : Sub-node for internal Class H/G algorithm that
    controls the amplifier supplies.

Optional properties for the "cirrus,hg-algo" sub-node:

  - cirrus,mem-depth : Memory depth for the Class H/G algorithm measured in
    LRCLK cycles. If this property is set to 0, 1, 2, or 3 then the memory
    depths will be 1, 4, 8, 16 LRCLK cycles.  The default is 16 LRCLK cycles.

    cirrus,release-rate : The number of consecutive LRCLK periods before
    allowing release condition tracking updates. The number of LRCLK periods
    start at 3 to a maximum of 255.

  - cirrus,ldo-thld : Configures the signal threshold at which the PWM output
    stage enters LDO operation. Starts as a default value of 50mV for a value
    of 1 and increases with a step size of 50mV to a maximum of 750mV (value of
    0xF).

  - cirrus,ldo-path-disable : This is a boolean property. If present, the H/G
    algorithm uses the max detection path.  If not present, the LDO
    detection path is used.

  - cirrus,ldo-entry-delay : The LDO entry delay in milliseconds before the H/G
    algorithm switches to the LDO voltage.  This property can be set to values
    from 0 to 7 for delays of 5ms, 10ms, 50ms, 100ms, 200ms, 500ms, 1000ms.
    The default is 100ms.

  - cirrus,vp-hg-auto : This is a boolean property.  When set, class H/G VPhg
    automatic updating is enabled.

  - cirrus,vp-hg :  Class H/G algorithm VPhg.  Controls the H/G algorithm's
    reference to the VP voltage for when to start generating a boosted VBST.
    The reference voltage starts at 3000mV with a value of 0x3 and is increased
    by 100mV per step to a maximum of 5500mV.

  - cirrus,vp-hg-rate : The rate (number of LRCLK periods) at which the VPhg is
    allowed to increase to a higher voltage when using VPhg automatic
    tracking. This property can be set to values from 0 to 3 with rates of 128
    periods, 2048 periods, 32768 periods, and 524288 periods.
    The default is 32768 periods.

  - cirrus,vp-hg-va : VA calculation reference for automatic VPhg tracking
    using VPMON. This property can be set to values from 0 to 6 starting at
    1800mV with a step size of 50mV up to a maximum value of 1750mV.
    Default is 1800mV.

Example:

cs35l33: cs35l33@40 {
	compatible = "cirrus,cs35l33";
	reg = <0x40>;

	VA-supply = <&ldo5_reg>;
	VP-supply = <&ldo5_reg>;

	interrupt-parent = <&gpio8>;
	interrupts = <3 IRQ_TYPE_LEVEL_LOW>;

	reset-gpios = <&cs47l91 34 0>;

	cirrus,ramp-rate = <0x0>;
	cirrus,boost-ctl = <0x30>;  /* VBST = 8000mV */
	cirrus,boost-ipk = <0xE0>; /* 3600mA */
	cirrus,imon-adc-scale = <0> /* Bits 15 down to 0 */

	cirrus,hg-algo {
		cirrus,mem-depth = <0x3>;
		cirrus,release-rate = <0x3>;
		cirrus,ldo-thld = <0x1>;
		cirrus,ldo-path-disable = <0x0>;
		cirrus,ldo-entry-delay=<0x4>;
		cirrus,vp-hg-auto;
		cirrus,vp-hg=<0xF>;
		cirrus,vp-hg-rate=<0x2>;
		cirrus,vp-hg-va=<0x0>;
	};
};


code:
CS35L34 Speaker Amplifier

Required properties:

  - compatible : "cirrus,cs35l34"

  - reg : the I2C address of the device for I2C.

  - VA-supply, VP-supply : power supplies for the device,
    as covered in
    Documentation/devicetree/bindings/regulator/regulator.txt.

  - cirrus,boost-vtge-millivolt : Boost Voltage Value.  Configures the boost
    converter's output voltage in mV. The range is from VP to 8V with
    increments of 100mV.

  - cirrus,boost-nanohenry: Inductor value for boost converter. The value is
    in nH and they can be values of 1000nH, 1100nH, 1200nH, 1500nH, and 2200nH.

Optional properties:

  - reset-gpios: GPIO used to reset the amplifier.

  - interrupts : IRQ line info CS35L34.
    (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
    for further information relating to interrupt properties)

  - cirrus,boost-peak-milliamp : Boost converter peak current limit in mA. The
    range starts at 1200mA and goes to a maximum of 3840mA with increments of
    80mA. The default value is 2480mA.

  - cirrus,i2s-sdinloc : ADSP SDIN I2S channel location. Indicates whether the
    received mono data is in the left or right portion of the I2S frame
    according to the AD0 pin or directly via this configuration.
    0x0 (Default) = Selected by AD0 input (if AD0 = LOW, use left channel),
    0x2 = Left,
    0x1 = Selected by the inversion of the AD0 input (if AD0 = LOW, use right
    channel),
    0x3 = Right.

  - cirrus,gain-zc-disable: Boolean property. If set, the gain change will take
    effect without waiting for a zero cross.

  - cirrus,tdm-rising-edge: Boolean property. If set, data is on the rising edge of
    SCLK. Otherwise, data is on the falling edge of SCLK.

Example:

cs35l34: cs35l34@40 {
	compatible = "cirrus,cs35l34";
	reg = <0x40>;

	interrupt-parent = <&gpio8>;
	interrupts = <3 IRQ_TYPE_LEVEL_LOW>;

	reset-gpios = <&gpio 10 0>;

	cirrus,boost-vtge-milltvolt = <8000>; /* 8V */
	cirrus,boost-ind-nanohenry = <1000>; /* 1uH */
	cirrus,boost-peak-milliamp = <3000>; /* 3A */
};