code:
ROCKCHIP with MAX98090 CODEC

Required properties:
- compatible: "rockchip,rockchip-audio-max98090"
- rockchip,model: The user-visible name of this sound complex
- rockchip,i2s-controller: The phandle of the Rockchip I2S controller that's
  connected to the CODEC

Optional properties:
- rockchip,audio-codec: The phandle of the MAX98090 audio codec.
- rockchip,headset-codec: The phandle of Ext chip for jack detection. This is
                          required if there is rockchip,audio-codec.
- rockchip,hdmi-codec: The phandle of HDMI device for HDMI codec.

Example:

/* For max98090-only board. */
sound {
	compatible = "rockchip,rockchip-audio-max98090";
	rockchip,model = "ROCKCHIP-I2S";
	rockchip,i2s-controller = <&i2s>;
	rockchip,audio-codec = <&max98090>;
	rockchip,headset-codec = <&headsetcodec>;
};

/* For HDMI-only board. */
sound {
	compatible = "rockchip,rockchip-audio-max98090";
	rockchip,model = "ROCKCHIP-I2S";
	rockchip,i2s-controller = <&i2s>;
	rockchip,hdmi-codec = <&hdmi>;
};

/* For max98090 plus HDMI board. */
sound {
	compatible = "rockchip,rockchip-audio-max98090";
	rockchip,model = "ROCKCHIP-I2S";
	rockchip,i2s-controller = <&i2s>;
	rockchip,audio-codec = <&max98090>;
	rockchip,headset-codec = <&headsetcodec>;
	rockchip,hdmi-codec = <&hdmi>;
};


code:
ROCKCHIP with RT5645/RT5650 CODECS

Required properties:
- compatible: "rockchip,rockchip-audio-rt5645"
- rockchip,model: The user-visible name of this sound complex
- rockchip,i2s-controller: The phandle of the Rockchip I2S controller that's
  connected to the CODEC
- rockchip,audio-codec: The phandle of the RT5645/RT5650 audio codec

Example:

sound {
	compatible = "rockchip,rockchip-audio-rt5645";
	rockchip,model = "ROCKCHIP-I2S";
	rockchip,i2s-controller = <&i2s>;
	rockchip,audio-codec = <&rt5645>;
};

repo_name: angery/linux


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

title: Rockchip SPDIF transceiver

description:
  The S/PDIF audio block is a stereo transceiver that allows the
  processor to receive and transmit digital audio via a coaxial or
  fibre cable.

maintainers:
  - Heiko Stuebner <heiko@sntech.de>

properties:
  compatible:
    oneOf:
      - const: rockchip,rk3066-spdif
      - const: rockchip,rk3228-spdif
      - const: rockchip,rk3328-spdif
      - const: rockchip,rk3366-spdif
      - const: rockchip,rk3368-spdif
      - const: rockchip,rk3399-spdif
      - const: rockchip,rk3568-spdif
      - items:
          - enum:
              - rockchip,rk3188-spdif
              - rockchip,rk3288-spdif
              - rockchip,rk3308-spdif
          - const: rockchip,rk3066-spdif

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    items:
      - description: clock for SPDIF bus
      - description: clock for SPDIF controller

  clock-names:
    items:
      - const: mclk
      - const: hclk

  dmas:
    maxItems: 1

  dma-names:
    const: tx

  power-domains:
    maxItems: 1

  rockchip,grf:
    $ref: /schemas/types.yaml#/definitions/phandle
    description:
      The phandle of the syscon node for the GRF register.
      Required property on RK3288.

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

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

allOf:
  - $ref: dai-common.yaml#
  - if:
      properties:
        compatible:
          contains:
            const: rockchip,rk3288-spdif
    then:
      required:
        - rockchip,grf

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/rk3188-cru.h>
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    spdif: spdif@1011e000 {
      compatible = "rockchip,rk3188-spdif", "rockchip,rk3066-spdif";
      reg = <0x1011e000 0x2000>;
      interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
      clocks = <&cru SCLK_SPDIF>, <&cru HCLK_SPDIF>;
      clock-names = "mclk", "hclk";
      dmas = <&dmac1_s 8>;
      dma-names = "tx";
      #sound-dai-cells = <0>;
    };


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

title: ROHM BD28623MUV Class D speaker amplifier for digital input

description:
  This codec does not have any control buses such as I2C, it detect
  format and rate of I2S signal automatically. It has two signals
  that can be connected to GPIOs reset and mute.

maintainers:
  - Katsuhiro Suzuki <katsuhiro@katsuster.net>

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

properties:
  compatible:
    const: rohm,bd28623

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

  VCCA-supply:
    description:
      regulator phandle for the VCCA (for analog) power supply

  VCCP1-supply:
    description:
      regulator phandle for the VCCP1 (for ch1) power supply

  VCCP2-supply:
    description:
      regulator phandle for the VCCP2 (for ch2) power supply

  reset-gpios:
    maxItems: 1
    description:
      GPIO specifier for the active low reset line

  mute-gpios:
    maxItems: 1
    description:
      GPIO specifier for the active low mute line

required:
  - compatible
  - VCCA-supply
  - VCCP1-supply
  - VCCP2-supply
  - "#sound-dai-cells"

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    codec {
      compatible = "rohm,bd28623";
      #sound-dai-cells = <0>;

      VCCA-supply = <&vcc_reg>;
      VCCP1-supply = <&vcc_reg>;
      VCCP2-supply = <&vcc_reg>;
      reset-gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
      mute-gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
    };


code:
RT1011 Mono Class D Audio Amplifier

This device supports I2C only.

Required properties:

- compatible : "realtek,rt1011".

- reg : The I2C address of the device. This I2C address decide by
        two input pins (ASEL1 and ASEL2).
        -------------------------------------
        |   ASEL2   |  ASEL1   |  Address   |
        -------------------------------------
        |     0     |    0     |   0x38     |
        -------------------------------------
        |     0     |    1     |   0x39     |
        -------------------------------------
        |     1     |    0     |   0x3a     |
        -------------------------------------
        |     1     |    1     |   0x3b     |
        -------------------------------------

Optional properties:

- realtek,temperature_calib
  u32. The temperature was measured while doing the calibration. Units: Celsius degree

- realtek,r0_calib
  u32. This is r0 calibration data which was measured in factory mode.

Pins on the device (for linking into audio routes) for RT1011:

  * SPO

Example:

rt1011: codec@38 {
	compatible = "realtek,rt1011";
	reg = <0x38>;
	realtek,temperature_calib = <25>;
	realtek,r0_calib = <0x224050>;
};


code:
RT1015 Mono Class D Audio Amplifier

This device supports I2C only.

Required properties:

- compatible : "realtek,rt1015".

- reg : The I2C address of the device.

Optional properties:

- realtek,power-up-delay-ms
  Set a delay time for flush work to be completed,
  this value is adjustable depending on platform.

Example:

rt1015: codec@28 {
	compatible = "realtek,rt1015";
	reg = <0x28>;
	realtek,power-up-delay-ms = <50>;
};


code:
RT1016 Stereo Class D Audio Amplifier

This device supports I2C only.

Required properties:

- compatible : "realtek,rt1016".

- reg : The I2C address of the device.

Example:

rt1016: codec@1a {
	compatible = "realtek,rt1016";
	reg = <0x1a>;
};


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

title: RT1019 Mono Class-D Audio Amplifier

maintainers:
  - jack.yu@realtek.com

properties:
  compatible:
    const: realtek,rt1019

  reg:
    maxItems: 1
    description: I2C address of the device.

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;
        rt1019: codec@28 {
            compatible = "realtek,rt1019";
            reg = <0x28>;
        };
    };


code:
RT1308 audio Amplifier

This device supports I2C only.

Required properties:

- compatible : "realtek,rt1308".

- reg : The I2C address of the device.

Example:

rt1308: rt1308@10 {
	compatible = "realtek,rt1308";
	reg = <0x10>;
};


code:
RT274 audio CODEC

This device supports I2C only.

Required properties:

- compatible : "realtek,rt274".

- reg : The I2C address of the device.

Optional properties:

- interrupts : The CODEC's interrupt output.

Pins on the device (for linking into audio routes) for RT274:

  * DMIC1 Pin
  * DMIC2 Pin
  * MIC
  * LINE1
  * LINE2
  * HPO Pin
  * SPDIF
  * LINE3

Example:

rt274: codec@1c {
	compatible = "realtek,rt274";
	reg = <0x1c>;
	interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
};


code:
RT5514 audio CODEC

This device supports both I2C and SPI.

Required properties:

- compatible : "realtek,rt5514".

- reg : the I2C address of the device for I2C, the chip select
        number for SPI.

Optional properties:

- clocks: The phandle of the master clock to the CODEC
- clock-names: Should be "mclk"

- interrupts: The interrupt number to the cpu. The interrupt specifier format
	      depends on the interrupt controller.

- realtek,dmic-init-delay-ms
  Set the DMIC initial delay (ms) to wait it ready for I2C.

Pins on the device (for linking into audio routes) for I2C:

  * DMIC1L
  * DMIC1R
  * DMIC2L
  * DMIC2R
  * AMICL
  * AMICR

Example:

rt5514: codec@57 {
	compatible = "realtek,rt5514";
	reg = <0x57>;
};


code:
RT5616 audio CODEC

This device supports I2C only.

Required properties:

- compatible : "realtek,rt5616".

- reg : The I2C address of the device.

Optional properties:

- clocks: The phandle of the master clock to the CODEC.

- clock-names: Should be "mclk".

Pins on the device (for linking into audio routes) for RT5616:

  * IN1P
  * IN2P
  * IN2N
  * LOUTL
  * LOUTR
  * HPOL
  * HPOR

Example:

rt5616: codec@1b {
	compatible = "realtek,rt5616";
	reg = <0x1b>;
};


code:
ALC5631/RT5631 audio CODEC

This device supports I2C only.

Required properties:

  - compatible : "realtek,alc5631" or "realtek,rt5631"

  - reg : the I2C address of the device.

Pins on the device (for linking into audio routes):

  * SPK_OUT_R_P
  * SPK_OUT_R_N
  * SPK_OUT_L_P
  * SPK_OUT_L_N
  * HP_OUT_L
  * HP_OUT_R
  * AUX_OUT2_LP
  * AUX_OUT2_RN
  * AUX_OUT1_LP
  * AUX_OUT1_RN
  * AUX_IN_L_JD
  * AUX_IN_R_JD
  * MONO_IN_P
  * MONO_IN_N
  * MIC1_P
  * MIC1_N
  * MIC2_P
  * MIC2_N
  * MONO_OUT_P
  * MONO_OUT_N
  * MICBIAS1
  * MICBIAS2

Example:

alc5631: audio-codec@1a {
	compatible = "realtek,alc5631";
	reg = <0x1a>;
};

or

rt5631: audio-codec@1a {
	compatible = "realtek,rt5631";
	reg = <0x1a>;
};


code:
RT5640/RT5639 audio CODEC

This device supports I2C only.

Required properties:

- compatible : One of "realtek,rt5640" or "realtek,rt5639".

- reg : The I2C address of the device.

- interrupts : The CODEC's interrupt output.

Optional properties:

- clocks: The phandle of the master clock to the CODEC
- clock-names: Should be "mclk"

- realtek,in1-differential
- realtek,in2-differential
- realtek,in3-differential
  Boolean. Indicate MIC1/2/3 input are differential, rather than single-ended.

- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.

- realtek,dmic1-data-pin
  0: dmic1 is not used
  1: using IN1P pin as dmic1 data pin
  2: using GPIO3 pin as dmic1 data pin

- realtek,dmic2-data-pin
  0: dmic2 is not used
  1: using IN1N pin as dmic2 data pin
  2: using GPIO4 pin as dmic2 data pin

- realtek,jack-detect-source
  u32. Valid values:
  0: jack-detect is not used
  1: Use GPIO1 for jack-detect
  2: Use JD1_IN4P for jack-detect
  3: Use JD2_IN4N for jack-detect
  4: Use GPIO2 for jack-detect
  5: Use GPIO3 for jack-detect
  6: Use GPIO4 for jack-detect

- realtek,jack-detect-not-inverted
  bool. Normal jack-detect switches give an inverted signal, set this bool
  in the rare case you've a jack-detect switch which is not inverted.

- realtek,over-current-threshold-microamp
  u32, micbias over-current detection threshold in µA, valid values are
  600, 1500 and 2000µA.

- realtek,over-current-scale-factor
  u32, micbias over-current detection scale-factor, valid values are:
  0: Scale current by 0.5
  1: Scale current by 0.75
  2: Scale current by 1.0
  3: Scale current by 1.5

Pins on the device (for linking into audio routes) for RT5639/RT5640:

  * DMIC1
  * DMIC2
  * MICBIAS1
  * IN1P
  * IN1N
  * IN2P
  * IN2N
  * IN3P
  * IN3N
  * HPOL
  * HPOR
  * LOUTL
  * LOUTR
  * SPOLP
  * SPOLN
  * SPORP
  * SPORN

Additional pins on the device for RT5640:

  * MONOP
  * MONON

Example:

rt5640 {
	compatible = "realtek,rt5640";
	reg = <0x1c>;
	interrupt-parent = <&gpio>;
	interrupts = <TEGRA_GPIO(W, 3) IRQ_TYPE_LEVEL_HIGH>;
	realtek,ldo1-en-gpios =
		<&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
};


code:
RT5650/RT5645 audio CODEC

This device supports I2C only.

Required properties:

- compatible : One of "realtek,rt5645" or "realtek,rt5650".

- reg : The I2C address of the device.

- interrupts : The CODEC's interrupt output.

- avdd-supply: Power supply for AVDD, providing 1.8V.

- cpvdd-supply: Power supply for CPVDD, providing 3.5V.

Optional properties:

- hp-detect-gpios:
  a GPIO spec for the external headphone detect pin. If jd-mode = 0,
  we will get the JD status by getting the value of hp-detect-gpios.

- realtek,in2-differential
  Boolean. Indicate MIC2 input are differential, rather than single-ended.

- realtek,dmic1-data-pin
  0: dmic1 is not used
  1: using IN2P pin as dmic1 data pin
  2: using GPIO6 pin as dmic1 data pin
  3: using GPIO10 pin as dmic1 data pin
  4: using GPIO12 pin as dmic1 data pin

- realtek,dmic2-data-pin
  0: dmic2 is not used
  1: using IN2N pin as dmic2 data pin
  2: using GPIO5 pin as dmic2 data pin
  3: using GPIO11 pin as dmic2 data pin

-- realtek,jd-mode : The JD mode of rt5645/rt5650
   0 : rt5645/rt5650 JD function is not used
   1 : Mode-0 (VDD=3.3V), two port jack detection
   2 : Mode-1 (VDD=3.3V), one port jack detection
   3 : Mode-2 (VDD=1.8V), one port jack detection

Pins on the device (for linking into audio routes) for RT5645/RT5650:

  * DMIC L1
  * DMIC R1
  * DMIC L2
  * DMIC R2
  * IN1P
  * IN1N
  * IN2P
  * IN2N
  * Haptic Generator
  * HPOL
  * HPOR
  * LOUTL
  * LOUTR
  * PDM1L
  * PDM1R
  * SPOL
  * SPOR

Example:

codec: rt5650@1a {
	compatible = "realtek,rt5650";
	reg = <0x1a>;
	hp-detect-gpios = <&gpio 19 0>;
	interrupt-parent = <&gpio>;
	interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
	realtek,dmic-en = "true";
	realtek,en-jd-func = "true";
	realtek,jd-mode = <3>;
};


code:
RT5651 audio CODEC

This device supports I2C only.

Required properties:

- compatible : "realtek,rt5651".

- reg : The I2C address of the device.

Optional properties:

- realtek,in2-differential
  Boolean. Indicate MIC2 input are differential, rather than single-ended.

- realtek,dmic-en
  Boolean. true if dmic is used.

- realtek,jack-detect-source
  u32. Valid values:
  1: Use JD1_1 pin for jack-detect
  2: Use JD1_2 pin for jack-detect
  3: Use JD2 pin for jack-detect

- realtek,jack-detect-not-inverted
  bool. Normal jack-detect switches give an inverted (active-low) signal,
  set this bool in the rare case you've a jack-detect switch which is not
  inverted.

- realtek,over-current-threshold-microamp
  u32, micbias over-current detection threshold in µA, valid values are
  600, 1500 and 2000µA.

- realtek,over-current-scale-factor
  u32, micbias over-current detection scale-factor, valid values are:
  0: Scale current by 0.5
  1: Scale current by 0.75
  2: Scale current by 1.0
  3: Scale current by 1.5

Pins on the device (for linking into audio routes) for RT5651:

  * DMIC L1
  * DMIC R1
  * IN1P
  * IN2P
  * IN2N
  * IN3P
  * HPOL
  * HPOR
  * LOUTL
  * LOUTR
  * PDML
  * PDMR

Example:

rt5651: codec@1a {
	compatible = "realtek,rt5651";
	reg = <0x1a>;
	realtek,dmic-en = "true";
	realtek,in2-diff = "false";
};


code:
RT5659/RT5658 audio CODEC

This device supports I2C only.

Required properties:

- compatible : One of "realtek,rt5659" or "realtek,rt5658".

- reg : The I2C address of the device.

- interrupts : The CODEC's interrupt output.

Optional properties:

- clocks: The phandle of the master clock to the CODEC
- clock-names: Should be "mclk"

- realtek,in1-differential
- realtek,in3-differential
- realtek,in4-differential
  Boolean. Indicate MIC1/3/4 input are differential, rather than single-ended.

- realtek,dmic1-data-pin
  0: dmic1 is not used
  1: using IN2N pin as dmic1 data pin
  2: using GPIO5 pin as dmic1 data pin
  3: using GPIO9 pin as dmic1 data pin
  4: using GPIO11 pin as dmic1 data pin

- realtek,dmic2-data-pin
  0: dmic2 is not used
  1: using IN2P pin as dmic2 data pin
  2: using GPIO6 pin as dmic2 data pin
  3: using GPIO10 pin as dmic2 data pin
  4: using GPIO12 pin as dmic2 data pin

- realtek,jd-src
  0: No JD is used
  1: using JD3 as JD source
  2: JD source for Intel HDA header

- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.
- realtek,reset-gpios : The GPIO that controls the CODEC's RESET pin.

- sound-name-prefix: Please refer to dai-common.yaml

- ports: A Codec may have a single or multiple I2S interfaces. These
  interfaces on Codec side can be described under 'ports' or 'port'.
  When the SoC or host device is connected to multiple interfaces of
  the Codec, the connectivity can be described using 'ports' property.
  If a single interface is used, then 'port' can be used. The usage
  depends on the platform or board design.
  Please refer to Documentation/devicetree/bindings/graph.txt

Pins on the device (for linking into audio routes) for RT5659/RT5658:

  * DMIC L1
  * DMIC R1
  * DMIC L2
  * DMIC R2
  * IN1P
  * IN1N
  * IN2P
  * IN2N
  * IN3P
  * IN3N
  * IN4P
  * IN4N
  * HPOL
  * HPOR
  * SPOL
  * SPOR
  * LOUTL
  * LOUTR
  * MONOOUT
  * PDML
  * PDMR
  * SPDIF

Example:

rt5659 {
	compatible = "realtek,rt5659";
	reg = <0x1b>;
	interrupt-parent = <&gpio>;
	interrupts = <TEGRA_GPIO(W, 3) IRQ_TYPE_LEVEL_HIGH>;
	realtek,ldo1-en-gpios =
		<&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
};


code:
RT5660 audio CODEC

This device supports I2C only.

Required properties:

- compatible : "realtek,rt5660".

- reg : The I2C address of the device.

Optional properties:

- clocks: The phandle of the master clock to the CODEC
- clock-names: Should be "mclk"

- realtek,in1-differential
- realtek,in3-differential
  Boolean. Indicate MIC1/3 input are differential, rather than single-ended.

- realtek,poweroff-in-suspend
  Boolean. If the codec will be powered off in suspend, the resume should be
  added delay time for waiting codec power ready.

- realtek,dmic1-data-pin
  0: dmic1 is not used
  1: using GPIO2 pin as dmic1 data pin
  2: using IN1P pin as dmic1 data pin

Pins on the device (for linking into audio routes) for RT5660:

  * DMIC L1
  * DMIC R1
  * IN1P
  * IN1N
  * IN2P
  * IN3P
  * IN3N
  * SPO
  * LOUTL
  * LOUTR

Example:

rt5660 {
	compatible = "realtek,rt5660";
	reg = <0x1c>;
};


code:
RT5663 audio CODEC

This device supports I2C only.

Required properties:

- compatible : "realtek,rt5663".

- reg : The I2C address of the device.

- interrupts : The CODEC's interrupt output.

- avdd-supply: Power supply for AVDD, providing 1.8V.

- cpvdd-supply: Power supply for CPVDD, providing 3.5V.

Optional properties:

- "realtek,dc_offset_l_manual"
- "realtek,dc_offset_r_manual"
- "realtek,dc_offset_l_manual_mic"
- "realtek,dc_offset_r_manual_mic"
  Based on the different PCB layout, add the manual offset value to
  compensate the DC offset for each L and R channel, and they are different
  between headphone and headset.
- "realtek,impedance_sensing_num"
  The matrix row number of the impedance sensing table.
  If the value is 0, it means the impedance sensing is not supported.
- "realtek,impedance_sensing_table"
  The matrix rows of the impedance sensing table are consisted by impedance
  minimum, impedance maximun, volume, DC offset w/o and w/ mic of each L and
  R channel accordingly. Example is shown as following.
  <   0    300  7  0xffd160  0xffd1c0  0xff8a10  0xff8ab0
    301  65535  4  0xffe470  0xffe470  0xffb8e0  0xffb8e0>
  The first and second column are defined for the impedance range. If the
  detected impedance value is in the range, then the volume value of the
  third column will be set to codec. In our codec design, each volume value
  should compensate different DC offset to avoid the pop sound, and it is
  also different between headphone and headset. In the example, the
  "realtek,impedance_sensing_num" is 2. It means that there are 2 ranges of
  impedance in the impedance sensing function.

Pins on the device (for linking into audio routes) for RT5663:

  * IN1P
  * IN1N
  * IN2P
  * IN2N
  * HPOL
  * HPOR

Example:

rt5663: codec@12 {
	compatible = "realtek,rt5663";
	reg = <0x12>;
	interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
	avdd-supply = <&pp1800_a_alc5662>;
	cpvdd-supply = <&pp3500_a_alc5662>;
};


code:
RT5665/RT5666 audio CODEC

This device supports I2C only.

Required properties:

- compatible : One of "realtek,rt5665", "realtek,rt5666".

- reg : The I2C address of the device.

- interrupts : The CODEC's interrupt output.

Optional properties:

- realtek,in1-differential
- realtek,in2-differential
- realtek,in3-differential
- realtek,in4-differential
  Boolean. Indicate MIC1/2/3/4 input are differential, rather than single-ended.

- realtek,dmic1-data-pin
  0: dmic1 is not used
  1: using GPIO4 pin as dmic1 data pin
  2: using IN2N pin as dmic2 data pin

- realtek,dmic2-data-pin
  0: dmic2 is not used
  1: using GPIO5 pin as dmic2 data pin
  2: using IN2P pin as dmic2 data pin

- realtek,jd-src
  0: No JD is used
  1: using JD1 as JD source

- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.

Pins on the device (for linking into audio routes) for RT5659/RT5658:

  * DMIC L1
  * DMIC R1
  * DMIC L2
  * DMIC R2
  * IN1P
  * IN1N
  * IN2P
  * IN2N
  * IN3P
  * IN3N
  * IN4P
  * IN4N
  * HPOL
  * HPOR
  * LOUTL
  * LOUTR
  * MONOOUT
  * PDML
  * PDMR

Example:

rt5659 {
	compatible = "realtek,rt5665";
	reg = <0x1b>;
	interrupt-parent = <&gpio>;
	interrupts = <TEGRA_GPIO(W, 3) IRQ_TYPE_LEVEL_HIGH>;
	realtek,ldo1-en-gpios =
		<&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
};


code:
RT5668B audio CODEC

This device supports I2C only.

Required properties:

- compatible : "realtek,rt5668b"

- reg : The I2C address of the device.

Optional properties:

- interrupts : The CODEC's interrupt output.

- realtek,dmic1-data-pin
  0: dmic1 is not used
  1: using GPIO2 pin as dmic1 data pin
  2: using GPIO5 pin as dmic1 data pin

- realtek,dmic1-clk-pin
  0: using GPIO1 pin as dmic1 clock pin
  1: using GPIO3 pin as dmic1 clock pin

- realtek,jd-src
  0: No JD is used
  1: using JD1 as JD source

- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.

Pins on the device (for linking into audio routes) for RT5668B:

  * DMIC L1
  * DMIC R1
  * IN1P
  * HPOL
  * HPOR

Example:

rt5668 {
	compatible = "realtek,rt5668b";
	reg = <0x1a>;
	interrupt-parent = <&gpio>;
	interrupts = <TEGRA_GPIO(U, 6) IRQ_TYPE_LEVEL_HIGH>;
	realtek,ldo1-en-gpios =
		<&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_HIGH>;
	realtek,dmic1-data-pin = <1>;
	realtek,dmic1-clk-pin = <1>;
	realtek,jd-src = <1>;
};


code:
RT5677 audio CODEC

This device supports I2C only.

Required properties:

- compatible : "realtek,rt5677".

- reg : The I2C address of the device.

- interrupts : The CODEC's interrupt output.

- gpio-controller : Indicates this device is a GPIO controller.

- #gpio-cells : Should be two. The first cell is the pin number and the
  second cell is used to specify optional parameters (currently unused).

Optional properties:

- realtek,pow-ldo2-gpio : The GPIO that controls the CODEC's POW_LDO2 pin.
- realtek,reset-gpio : The GPIO that controls the CODEC's RESET pin. Active low.

- realtek,in1-differential
- realtek,in2-differential
- realtek,lout1-differential
- realtek,lout2-differential
- realtek,lout3-differential
  Boolean. Indicate MIC1/2 input and LOUT1/2/3 outputs are differential,
  rather than single-ended.

- realtek,gpio-config
  Array of six 8bit elements that configures GPIO.
    0 - floating (reset value)
    1 - pull down
    2 - pull up

- realtek,jd1-gpio
  Configures GPIO Mic Jack detection 1.
  Select 0 ~ 3 as OFF, GPIO1, GPIO2 and GPIO3 respectively.

- realtek,jd2-gpio
- realtek,jd3-gpio
  Configures GPIO Mic Jack detection 2 and 3.
  Select 0 ~ 3 as OFF, GPIO4, GPIO5 and GPIO6 respectively.

Pins on the device (for linking into audio routes):

  * IN1P
  * IN1N
  * IN2P
  * IN2N
  * MICBIAS1
  * DMIC1
  * DMIC2
  * DMIC3
  * DMIC4
  * LOUT1
  * LOUT2
  * LOUT3

Example:

rt5677 {
	compatible = "realtek,rt5677";
	reg = <0x2c>;
	interrupt-parent = <&gpio>;
	interrupts = <TEGRA_GPIO(W, 3) IRQ_TYPE_LEVEL_HIGH>;

	gpio-controller;
	#gpio-cells = <2>;

	realtek,pow-ldo2-gpio =
		<&gpio TEGRA_GPIO(V, 3) GPIO_ACTIVE_HIGH>;
	realtek,reset-gpio = <&gpio TEGRA_GPIO(BB, 3) GPIO_ACTIVE_LOW>;
	realtek,in1-differential = "true";
	realtek,gpio-config = /bits/ 8  <0 0 0 0 0 2>;   /* pull up GPIO6 */
	realtek,jd2-gpio = <3>;  /* Enables Jack detection for GPIO6 */
};


code:
RT5682 audio CODEC

This device supports I2C only.

Required properties:

- compatible : "realtek,rt5682" or "realtek,rt5682i"

- reg : The I2C address of the device.

- AVDD-supply: phandle to the regulator supplying analog power through the
  AVDD pin

- MICVDD-supply: phandle to the regulator supplying power for the microphone
  bias through the MICVDD pin. Either MICVDD or VBAT should be present.

- VBAT-supply: phandle to the regulator supplying battery power through the
  VBAT pin. Either MICVDD or VBAT should be present.

- DBVDD-supply: phandle to the regulator supplying I/O power through the DBVDD
  pin.

- LDO1-IN-supply: phandle to the regulator supplying power to the digital core
  and charge pump through the LDO1_IN pin.

Optional properties:

- interrupts : The CODEC's interrupt output.

- realtek,dmic1-data-pin
  0: dmic1 is not used
  1: using GPIO2 pin as dmic1 data pin
  2: using GPIO5 pin as dmic1 data pin

- realtek,dmic1-clk-pin
  0: using GPIO1 pin as dmic1 clock pin
  1: using GPIO3 pin as dmic1 clock pin

- realtek,jd-src
  0: No JD is used
  1: using JD1 as JD source

- realtek,ldo1-en-gpios : The GPIO that controls the CODEC's LDO1_EN pin.

- realtek,btndet-delay
  The debounce delay for push button.
  The delay time is realtek,btndet-delay value multiple of 8.192 ms.
  If absent, the default is 16.

- #clock-cells : Should be set to '<1>',  wclk and bclk sources provided.
- clock-output-names : Name given for DAI clocks output.

- clocks : phandle and clock specifier for codec MCLK.
- clock-names : Clock name string for 'clocks' attribute, should be "mclk".

- realtek,dmic-clk-rate-hz : Set the clock rate (hz) for the requirement of
  the particular DMIC.

- realtek,dmic-delay-ms : Set the delay time (ms) for the requirement of
  the particular DMIC.

- realtek,dmic-clk-driving-high : Set the high driving of the DMIC clock out.

- #sound-dai-cells: Should be set to '<1>'.

Pins on the device (for linking into audio routes) for RT5682:

  * DMIC L1
  * DMIC R1
  * IN1P
  * HPOL
  * HPOR

Example:

rt5682 {
	compatible = "realtek,rt5682i";
	reg = <0x1a>;
	interrupt-parent = <&gpio>;
	interrupts = <TEGRA_GPIO(U, 6) IRQ_TYPE_LEVEL_HIGH>;
	realtek,ldo1-en-gpios =
		<&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_HIGH>;
	realtek,dmic1-data-pin = <1>;
	realtek,dmic1-clk-pin = <1>;
	realtek,jd-src = <1>;
	realtek,btndet-delay = <16>;

	#clock-cells = <1>;
	clock-output-names = "rt5682-dai-wclk", "rt5682-dai-bclk";

	clocks = <&osc>;
	clock-names = "mclk";

	AVDD-supply = <&avdd_reg>;
	MICVDD-supply = <&micvdd_reg>;
	DBVDD-supply = <&dbvdd_reg>;
	LDO1-IN-supply = <&ldo1_in_reg>;
};


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

title: Samsung Aries audio complex with WM8994 codec

maintainers:
  - Jonathan Bakker <xc-racer2@live.ca>

properties:
  compatible:
    enum:
      # With FM radio and modem master
      - samsung,aries-wm8994
      # Without FM radio and modem slave
      - samsung,fascinate4g-wm8994

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

  cpu:
    type: object
    additionalProperties: false
    properties:
      sound-dai:
        minItems: 2
        maxItems: 2
        description: |
          phandles to the I2S controller and bluetooth codec,
          in that order
    required:
      - sound-dai

  codec:
    additionalProperties: false
    type: object
    properties:
      sound-dai:
        maxItems: 1
        description: phandle to the WM8994 CODEC
    required:
      - sound-dai

  samsung,audio-routing:
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
    description: |
      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 WM8994's pins (as
      documented in its binding), and the jacks on the board -
      For samsung,aries-wm8994: HP, SPK, RCV, LINE, Main Mic, Headset Mic,
      or FM In
      For samsung,fascinate4g-wm8994: HP, SPK, RCV, LINE, Main Mic,
      or HeadsetMic

  extcon:
    description: Extcon phandle for dock detection

  main-micbias-supply:
    description: Supply for the micbias on the main mic

  headset-micbias-supply:
    description: Supply for the micbias on the headset mic

  earpath-sel-gpios:
    maxItems: 1
    description: GPIO for switching between tv-out and mic paths

  headset-detect-gpios:
    maxItems: 1
    description: GPIO for detection of headset insertion

  headset-key-gpios:
    maxItems: 1
    description: GPIO for detection of headset key press

  io-channels:
    maxItems: 1
    description: IO channel to read micbias voltage for headset detection

  io-channel-names:
    const: headset-detect

required:
  - compatible
  - model
  - cpu
  - codec
  - samsung,audio-routing
  - extcon
  - main-micbias-supply
  - headset-micbias-supply
  - earpath-sel-gpios
  - headset-detect-gpios
  - headset-key-gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

    sound {
        compatible = "samsung,fascinate4g-wm8994";

        model = "Fascinate4G";

        extcon = <&fsa9480>;

        main-micbias-supply = <&main_micbias_reg>;
        headset-micbias-supply = <&headset_micbias_reg>;

        earpath-sel-gpios = <&gpj2 6 GPIO_ACTIVE_HIGH>;

        io-channels = <&adc 3>;
        io-channel-names = "headset-detect";
        headset-detect-gpios = <&gph0 6 GPIO_ACTIVE_HIGH>;
        headset-key-gpios = <&gph3 6 GPIO_ACTIVE_HIGH>;

        samsung,audio-routing =
            "HP", "HPOUT1L",
            "HP", "HPOUT1R",

            "SPK", "SPKOUTLN",
            "SPK", "SPKOUTLP",

            "RCV", "HPOUT2N",
            "RCV", "HPOUT2P",

            "LINE", "LINEOUT2N",
            "LINE", "LINEOUT2P",

            "IN1LP", "Main Mic",
            "IN1LN", "Main Mic",

            "IN1RP", "Headset Mic",
            "IN1RN", "Headset Mic";

        pinctrl-names = "default";
        pinctrl-0 = <&headset_det &earpath_sel>;

        cpu {
            sound-dai = <&i2s0>, <&bt_codec>;
        };

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


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

title: Insignal Arndale boards audio complex

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>
  - Sylwester Nawrocki <s.nawrocki@samsung.com>

properties:
  compatible:
    enum:
      - samsung,arndale-alc5631
      - samsung,arndale-rt5631
      - samsung,arndale-wm1811

  samsung,audio-codec:
    description: Phandle to the audio codec.
    $ref: /schemas/types.yaml#/definitions/phandle

  samsung,audio-cpu:
    description: Phandle to the Samsung I2S controller.
    $ref: /schemas/types.yaml#/definitions/phandle

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

required:
  - compatible
  - samsung,audio-codec
  - samsung,audio-cpu

additionalProperties: false

examples:
  - |
    sound {
        compatible = "samsung,arndale-rt5631";
        samsung,audio-cpu = <&i2s0>;
        samsung,audio-codec = <&rt5631>;
    };


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

title: Samsung Midas audio complex with WM1811 codec

maintainers:
  - Sylwester Nawrocki <s.nawrocki@samsung.com>

properties:
  compatible:
    const: samsung,midas-audio

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

  cpu:
    type: object
    additionalProperties: false
    properties:
      sound-dai:
        maxItems: 1
        description: phandle to the I2S controller
    required:
      - sound-dai

  codec:
    type: object
    additionalProperties: false
    properties:
      sound-dai:
        maxItems: 1
        description: phandle to the WM1811 CODEC
    required:
      - sound-dai

  samsung,audio-routing:
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
    description: |
      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 WM1811's pins (as documented in its binding), and the jacks
      on the board: HP, SPK, Main Mic, Sub Mic, Headset Mic.

  mic-bias-supply:
    description: Supply for the micbias on the Main microphone

  submic-bias-supply:
    description: Supply for the micbias on the Sub microphone

  fm-sel-gpios:
    maxItems: 1
    description: GPIO pin for FM selection

  lineout-sel-gpios:
    maxItems: 1
    description: GPIO pin for line out selection

required:
  - compatible
  - model
  - cpu
  - codec
  - samsung,audio-routing
  - mic-bias-supply
  - submic-bias-supply

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

    sound {
        compatible = "samsung,midas-audio";
        model = "Midas";

        fm-sel-gpios = <&gpaa0 3 GPIO_ACTIVE_HIGH>;

        mic-bias-supply = <&mic_bias_reg>;
        submic-bias-supply = <&submic_bias_reg>;

        samsung,audio-routing =
                "HP", "HPOUT1L",
                "HP", "HPOUT1R",

                "SPK", "SPKOUTLN",
                "SPK", "SPKOUTLP",
                "SPK", "SPKOUTRN",
                "SPK", "SPKOUTRP",

                "RCV", "HPOUT2N",
                "RCV", "HPOUT2P",

                "IN1LP", "Main Mic",
                "IN1LN", "Main Mic",
                "IN1RP", "Sub Mic",
                "IN1LP", "Sub Mic";

        cpu {
            sound-dai = <&i2s0>;
        };

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

    };


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

title: Samsung Exynos Odroid XU3/XU4 audio complex with MAX98090 codec

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>
  - Sylwester Nawrocki <s.nawrocki@samsung.com>

properties:
  compatible:
    oneOf:
      - const: hardkernel,odroid-xu3-audio

      - const: hardkernel,odroid-xu4-audio
        deprecated: true

      - const: samsung,odroid-xu3-audio
        deprecated: true

      - const: samsung,odroid-xu4-audio
        deprecated: true

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

  assigned-clock-parents: true
  assigned-clock-rates: true
  assigned-clocks: true
  clocks: true

  cpu:
    type: object
    properties:
      sound-dai:
        description: phandles to the I2S controllers

  codec:
    type: object
    properties:
      sound-dai:
        items:
          - description: phandle of the MAX98090 CODEC
          - description: phandle of the HDMI IP block node

  samsung,audio-routing:
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
    description: |
      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 MAX98090's pins (as
      documented in its binding), and the jacks on the board.
      For Odroid X2: "Headphone Jack", "Mic Jack", "DMIC"
      For Odroid U3, XU3: "Headphone Jack", "Speakers"
      For Odroid XU4: no entries

  samsung,audio-widgets:
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
    description: |
      This property specifies off-codec audio elements
      like headphones or speakers, for details see widgets.txt

required:
  - compatible
  - model
  - cpu
  - codec

additionalProperties: false

examples:
  - |
    sound {
        compatible = "hardkernel,odroid-xu3-audio";
        model = "Odroid-XU3";
        samsung,audio-routing =
                "Headphone Jack", "HPL",
                "Headphone Jack", "HPR",
                "IN1", "Mic Jack",
                "Mic Jack", "MICBIAS";

        cpu {
            sound-dai = <&i2s0 0>;
        };

        codec {
            sound-dai = <&hdmi>, <&max98090>;
        };
    };


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

title: Samsung SMDK5250 audio complex with WM8994 codec

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>
  - Sylwester Nawrocki <s.nawrocki@samsung.com>

properties:
  compatible:
    const: samsung,smdk-wm8994

  samsung,audio-codec:
    description: Phandle to the audio codec.
    $ref: /schemas/types.yaml#/definitions/phandle

  samsung,i2s-controller:
    description: Phandle to the Samsung I2S controller.
    $ref: /schemas/types.yaml#/definitions/phandle

required:
  - compatible
  - samsung,audio-codec
  - samsung,i2s-controller

additionalProperties: false

examples:
  - |
    sound {
        compatible = "samsung,smdk-wm8994";
        samsung,i2s-controller = <&i2s0>;
        samsung,audio-codec = <&wm8994>;
    };


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

title: Google Snow audio complex with MAX9809x codec

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>
  - Sylwester Nawrocki <s.nawrocki@samsung.com>

properties:
  compatible:
    enum:
      - google,snow-audio-max98090
      - google,snow-audio-max98091
      - google,snow-audio-max98095

  codec:
    type: object
    additionalProperties: false
    properties:
      sound-dai:
        description: List of phandles to the CODEC and HDMI IP nodes.
        items:
          - description: Phandle to the MAX98090, MAX98091 or MAX98095 CODEC.
          - description: Phandle to the HDMI IP block node.
    required:
      - sound-dai

  cpu:
    type: object
    additionalProperties: false
    properties:
      sound-dai:
        description: Phandle to the Samsung I2S controller.
        maxItems: 1
    required:
      - sound-dai

  samsung,audio-codec:
    description: Phandle to the audio codec.
    $ref: /schemas/types.yaml#/definitions/phandle
    deprecated: true

  samsung,i2s-controller:
    description: Phandle to the Samsung I2S controller.
    $ref: /schemas/types.yaml#/definitions/phandle
    deprecated: true

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

required:
  - compatible
  - codec
  - cpu

additionalProperties: false

examples:
  - |
    sound {
        compatible = "google,snow-audio-max98095";
        samsung,model = "Snow-I2S-MAX98095";

        cpu {
            sound-dai = <&i2s0 0>;
        };

        codec {
            sound-dai = <&max98095 0>, <&hdmi>;
        };
    };


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

title: Samsung Exynos5433 TM2(E) audio complex with WM5110 codec

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>
  - Sylwester Nawrocki <s.nawrocki@samsung.com>

properties:
  compatible:
    const: samsung,tm2-audio

  audio-amplifier:
    description: Phandle to the MAX98504 amplifier.
    $ref: /schemas/types.yaml#/definitions/phandle

  audio-codec:
    description: Phandles to the codecs.
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      - description: Phandle to the WM5110 audio codec.
      - description: Phandle to the HDMI transmitter node.

  samsung,audio-routing:
    description: |
      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
      WM5110's and MAX98504's pins and the jacks on the board: HP, SPK, Main
      Mic, Sub Mic, Third Mic, Headset Mic.
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array

  i2s-controller:
    description: Phandles to the I2S controllers.
    $ref: /schemas/types.yaml#/definitions/phandle-array
    items:
      - description: Phandle to I2S0.
      - description: Phandle to I2S1.

  mic-bias-gpios:
    description: GPIO pin that enables the Main Mic bias regulator.

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

required:
  - compatible
  - audio-amplifier
  - audio-codec
  - samsung,audio-routing
  - i2s-controller
  - mic-bias-gpios
  - model

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>

    sound {
        compatible = "samsung,tm2-audio";
        audio-codec = <&wm5110>, <&hdmi>;
        i2s-controller = <&i2s0 0>, <&i2s1 0>;
        audio-amplifier = <&max98504>;
        mic-bias-gpios = <&gpr3 2 GPIO_ACTIVE_HIGH>;
        model = "wm5110";
        samsung,audio-routing = "HP", "HPOUT1L",
                                "HP", "HPOUT1R",
                                "SPK", "SPKOUT",
                                "SPKOUT", "HPOUT2L",
                                "SPKOUT", "HPOUT2R",
                                "RCV", "HPOUT3L",
                                "RCV", "HPOUT3R";
    };


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

title: Samsung SoC I2S controller

maintainers:
  - Krzysztof Kozlowski <krzk@kernel.org>
  - Sylwester Nawrocki <s.nawrocki@samsung.com>

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

properties:
  compatible:
    description: |
      samsung,s3c6410-i2s: for 8/16/24bit stereo I2S.

      samsung,s5pv210-i2s: for 8/16/24bit multichannel (5.1) I2S with
      secondary FIFO, s/w reset control and internal mux for root clock
      source.

      samsung,exynos5420-i2s: for 8/16/24bit multichannel (5.1) I2S for
      playback, stereo channel capture, secondary FIFO using internal
      or external DMA, s/w reset control, internal mux for root clock
      source and 7.1 channel TDM support for playback; TDM (Time division
      multiplexing) is to allow transfer of multiple channel audio data on
      single data line.

      samsung,exynos7-i2s: with all the available features of Exynos5 I2S.
      Exynos7 I2S has 7.1 channel TDM support for capture, secondary FIFO
      with only external DMA and more number of root clock sampling
      frequencies.

      samsung,exynos7-i2s1: I2S1 on previous samsung platforms supports
      stereo channels. Exynos7 I2S1 upgraded to 5.1 multichannel with
      slightly modified bit offsets.
    enum:
      - samsung,s3c6410-i2s
      - samsung,s5pv210-i2s
      - samsung,exynos5420-i2s
      - samsung,exynos7-i2s
      - samsung,exynos7-i2s1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

  reg:
    maxItems: 1

  dmas:
    minItems: 2
    maxItems: 3

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

  assigned-clock-parents: true
  assigned-clocks: true

  clocks:
    minItems: 1
    maxItems: 3

  clock-names:
    oneOf:
      - items:
          - const: iis
      - items: # for I2S0
          - const: iis
          - const: i2s_opclk0
          - const: i2s_opclk1
      - items: # for I2S1 and I2S2
          - const: iis
          - const: i2s_opclk0
    description: |
      "iis" is the I2S bus clock and i2s_opclk0, i2s_opclk1 are sources
      of the root clock. I2S0 has internal mux to select the source
      of root clock and I2S1 and I2S2 doesn't have any such mux.

  "#clock-cells":
    const: 1

  clock-output-names:
    deprecated: true
    oneOf:
      - items: # for I2S0
          - const: i2s_cdclk0
      - items: # for I2S1
          - const: i2s_cdclk1
      - items: # for I2S2
          - const: i2s_cdclk2
    description: Names of the CDCLK I2S output clocks.

  interrupts:
    maxItems: 1

  samsung,idma-addr:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Internal DMA register base address of the audio
      subsystem (used in secondary sound source).

  power-domains:
    maxItems: 1

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

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

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/clock/exynos-audss-clk.h>

    i2s0: i2s@3830000 {
        compatible = "samsung,s5pv210-i2s";
        reg = <0x03830000 0x100>;
        dmas = <&pdma0 10>,
                <&pdma0 9>,
                <&pdma0 8>;
        dma-names = "tx", "rx", "tx-sec";
        clocks = <&clock_audss EXYNOS_I2S_BUS>,
                <&clock_audss EXYNOS_I2S_BUS>,
                <&clock_audss EXYNOS_SCLK_I2S>;
        clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
        #clock-cells = <1>;
        samsung,idma-addr = <0x03000000>;
        pinctrl-names = "default";
        pinctrl-0 = <&i2s0_bus>;
        #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/serial-midi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Generic Serial MIDI Interface

maintainers:
  - Daniel Kaehn <kaehndan@gmail.com>

description:
  Generic MIDI interface using a serial device. This denotes that a serial device is
  dedicated to MIDI communication, either to an external MIDI device through a DIN5
  or other connector, or to a known hardwired MIDI controller. This device must be a
  child node of a serial node.

  Can only be set to use standard baud rates corresponding to supported rates of the
  parent serial device. If the standard MIDI baud of 31.25 kBaud is needed
  (as would be the case if interfacing with arbitrary external MIDI devices),
  configure the clocks of the parent serial device so that a requested baud of 38.4 kBaud
  resuts in the standard MIDI baud rate, and set the 'current-speed' property to 38400 (default)

properties:
  compatible:
    const: serial-midi

  current-speed:
    description: Baudrate to set the serial port to when this MIDI device is opened.
    default: 38400

required:
  - compatible

additionalProperties: false

examples:
  - |
    serial {
        midi {
            compatible = "serial-midi";
        };
    };
  - |
    serial {
        midi {
            compatible = "serial-midi";
            current-speed = <115200>;
        };
    };


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

title: Freescale SGTL5000 Stereo Codec

maintainers:
  - Fabio Estevam <festevam@gmail.com>

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

properties:
  compatible:
    const: fsl,sgtl5000

  reg:
    maxItems: 1

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

  assigned-clock-parents: true
  assigned-clock-rates: true
  assigned-clocks: true

  clocks:
    items:
      - description: the clock provider of SYS_MCLK

  VDDA-supply:
    description: the regulator provider of VDDA

  VDDIO-supply:
    description: the regulator provider of VDDIO

  VDDD-supply:
    description: the regulator provider of VDDD

  micbias-resistor-k-ohms:
    description: The bias resistor to be used in kOhms. The resistor can take
      values of 2k, 4k or 8k. If set to 0 it will be off. If this node is not
      mentioned or if the value is unknown, then micbias resistor is set to
      4k.
    enum: [ 0, 2, 4, 8 ]

  micbias-voltage-m-volts:
    description: The bias voltage to be used in mVolts. The voltage can take
      values from 1.25V to 3V by 250mV steps. If this node is not mentioned
      or the value is unknown, then the value is set to 1.25V.
    $ref: "/schemas/types.yaml#/definitions/uint32"
    enum: [ 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000 ]

  lrclk-strength:
    description: |
      The LRCLK pad strength. Possible values are: 0, 1, 2 and 3 as per the
      table below:

        VDDIO		1.8V		2.5V		3.3V
        0 =		Disable
        1 =		1.66 mA		2.87 mA		4.02  mA
        2 =		3.33 mA		5.74 mA		8.03  mA
        3 =		4.99 mA		8.61 mA		12.05 mA
    $ref: "/schemas/types.yaml#/definitions/uint32"
    enum: [ 0, 1, 2, 3 ]

  sclk-strength:
    description: |
      The SCLK pad strength. Possible values are: 0, 1, 2 and 3 as per the
      table below:

        VDDIO		1.8V		2.5V		3.3V
        0 =		Disable
        1 =		1.66 mA		2.87 mA		4.02  mA
        2 =		3.33 mA		5.74 mA		8.03  mA
        3 =		4.99 mA		8.61 mA		12.05 mA
    $ref: "/schemas/types.yaml#/definitions/uint32"
    enum: [ 0, 1, 2, 3 ]

  port:
    $ref: audio-graph-port.yaml#
    unevaluatedProperties: false

required:
  - compatible
  - reg
  - "#sound-dai-cells"
  - clocks
  - VDDA-supply
  - VDDIO-supply

unevaluatedProperties: false

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

        codec@a {
            compatible = "fsl,sgtl5000";
            reg = <0x0a>;
            #sound-dai-cells = <0>;
            clocks = <&clks 150>;
            micbias-resistor-k-ohms = <2>;
            micbias-voltage-m-volts = <2250>;
            VDDA-supply = <&reg_3p3v>;
            VDDIO-supply = <&reg_3p3v>;
        };
    };
...


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

title: Simple Audio Amplifier

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

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

properties:
  compatible:
    enum:
      - dioo,dio2125
      - simple-audio-amplifier

  enable-gpios:
    maxItems: 1

  VCC-supply:
    description: >
      power supply for the device

  sound-name-prefix: true

required:
  - compatible

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/meson8-gpio.h>

    analog-amplifier {
        compatible = "simple-audio-amplifier";
        VCC-supply = <&regulator>;
        enable-gpios = <&gpio GPIOH_3 0>;
    };

...


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

title: Simple Audio Multiplexer

maintainers:
  - Alexandre Belloni <aleandre.belloni@bootlin.com>

description: |
  Simple audio multiplexers are driven using gpios, allowing to select which of
  their input line is connected to the output line.

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

properties:
  compatible:
    const: simple-audio-mux

  mux-gpios:
    description: |
      GPIOs used to select the input line.

  sound-name-prefix: true

required:
  - compatible
  - mux-gpios

additionalProperties: false

examples:
  - |
    mux {
        compatible = "simple-audio-mux";
        mux-gpios = <&gpio 3 0>;
    };


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

title: Simple Audio Card Driver

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

definitions:

  frame-master:
    description: Indicates dai-link frame master.
    $ref: /schemas/types.yaml#/definitions/phandle

  bitclock-master:
    description: Indicates dai-link bit clock master
    $ref: /schemas/types.yaml#/definitions/phandle

  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

  dai-tdm-slot-num:
    description: see tdm-slot.txt.
    $ref: /schemas/types.yaml#/definitions/uint32

  dai-tdm-slot-width:
    description: see tdm-slot.txt.
    $ref: /schemas/types.yaml#/definitions/uint32

  system-clock-frequency:
    description: |
      If a clock is specified and a multiplication factor is given with
      mclk-fs, the clock will be set to the calculated mclk frequency
      when the stream starts.
    $ref: /schemas/types.yaml#/definitions/uint32

  system-clock-direction-out:
    description: |
      specifies clock direction as 'out' on initialization.
      It is useful for some aCPUs with fixed clocks.
    $ref: /schemas/types.yaml#/definitions/flag

  system-clock-fixed:
    description: |
      Specifies that the clock frequency should not be modified.
      Implied when system-clock-frequency is specified, but can be used when
      a clock is mapped to the device whose frequency cannot or should not be
      changed. When mclk-fs is also specified, this restricts the device to a
      single fixed sampling rate.
    $ref: /schemas/types.yaml#/definitions/flag

  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

  aux-devs:
    description: |
      List of phandles pointing to auxiliary devices, such
      as amplifiers, to be added to the sound card.
    $ref: /schemas/types.yaml#/definitions/phandle-array

  convert-rate:
    description: CPU to Codec rate convert.
    $ref: /schemas/types.yaml#/definitions/uint32

  convert-channels:
    description: CPU to Codec rate channels.
    $ref: /schemas/types.yaml#/definitions/uint32

  prefix:
    description: "device name prefix"
    $ref: /schemas/types.yaml#/definitions/string

  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

  widgets:
    description: User specified audio sound widgets.
    $ref: /schemas/types.yaml#/definitions/non-unique-string-array

  pin-switches:
    description: the widget names for which pin switches must be created.
    $ref: /schemas/types.yaml#/definitions/string-array

  format:
    description: audio format.
    items:
      enum:
        - i2s
        - right_j
        - left_j
        - dsp_a
        - dsp_b
        - ac97
        - pdm
        - msb
        - lsb

  dai:
    type: object
    properties:
      sound-dai:
        maxItems: 1

      # common properties
      mclk-fs:
        $ref: "#/definitions/mclk-fs"
      prefix:
        $ref: "#/definitions/prefix"
      frame-inversion:
        $ref: "#/definitions/frame-inversion"
      bitclock-inversion:
        $ref: "#/definitions/bitclock-inversion"
      frame-master:
        $ref: /schemas/types.yaml#/definitions/flag
      bitclock-master:
        $ref: /schemas/types.yaml#/definitions/flag

      dai-tdm-slot-num:
        $ref: "#/definitions/dai-tdm-slot-num"
      dai-tdm-slot-width:
        $ref: "#/definitions/dai-tdm-slot-width"
      clocks:
        maxItems: 1
      system-clock-frequency:
        $ref: "#/definitions/system-clock-frequency"
      system-clock-direction-out:
        $ref: "#/definitions/system-clock-direction-out"
      system-clock-fixed:
        $ref: "#/definitions/system-clock-fixed"
    required:
      - sound-dai

properties:
  compatible:
    contains:
      enum:
        - simple-audio-card
        - simple-scu-audio-card

  "#address-cells":
    const: 1
  "#size-cells":
    const: 0

  label:
    $ref: "#/definitions/label"

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

  simple-audio-card,widgets:
    $ref: "#/definitions/widgets"
  simple-audio-card,routing:
    $ref: "#/definitions/routing"

  # common properties
  simple-audio-card,frame-master:
    $ref: "#/definitions/frame-master"
  simple-audio-card,bitclock-master:
    $ref: "#/definitions/bitclock-master"
  simple-audio-card,frame-inversion:
    $ref: "#/definitions/frame-inversion"
  simple-audio-card,bitclock-inversion:
    $ref: "#/definitions/bitclock-inversion"
  simple-audio-card,format:
    $ref: "#/definitions/format"
  simple-audio-card,mclk-fs:
    $ref: "#/definitions/mclk-fs"
  simple-audio-card,aux-devs:
    $ref: "#/definitions/aux-devs"
  simple-audio-card,convert-rate:
    $ref: "#/definitions/convert-rate"
  simple-audio-card,convert-channels:
    $ref: "#/definitions/convert-channels"
  simple-audio-card,prefix:
    $ref: "#/definitions/prefix"
  simple-audio-card,pin-switches:
    $ref: "#/definitions/pin-switches"
  simple-audio-card,hp-det-gpio:
    maxItems: 1
  simple-audio-card,mic-det-gpio:
    maxItems: 1

patternProperties:
  "^simple-audio-card,cpu(@[0-9a-f]+)?$":
    $ref: "#/definitions/dai"
  "^simple-audio-card,codec(@[0-9a-f]+)?$":
    $ref: "#/definitions/dai"

  "^simple-audio-card,dai-link(@[0-9a-f]+)?$":
    description: |
      Container for dai-link level properties and the CPU and CODEC sub-nodes.
      This container may be omitted when the card has only one DAI link.
    type: object
    properties:
      reg:
        maxItems: 1

      # common properties
      frame-master:
        $ref: "#/definitions/frame-master"
      bitclock-master:
        $ref: "#/definitions/bitclock-master"
      frame-inversion:
        $ref: "#/definitions/frame-inversion"
      bitclock-inversion:
        $ref: "#/definitions/bitclock-inversion"
      format:
        $ref: "#/definitions/format"
      mclk-fs:
        $ref: "#/definitions/mclk-fs"
      aux-devs:
        $ref: "#/definitions/aux-devs"
      convert-rate:
        $ref: "#/definitions/convert-rate"
      convert-channels:
        $ref: "#/definitions/convert-channels"
      prefix:
        $ref: "#/definitions/prefix"
      pin-switches:
        $ref: "#/definitions/pin-switches"
      hp-det-gpio:
        maxItems: 1
      mic-det-gpio:
        maxItems: 1

    patternProperties:
      "^cpu(@[0-9a-f]+)?":
        $ref: "#/definitions/dai"
      "^codec(@[0-9a-f]+)?":
        $ref: "#/definitions/dai"
    additionalProperties: false

required:
  - compatible

additionalProperties: false

examples:
#--------------------
# single DAI link
#--------------------
  - |
    sound {
        compatible = "simple-audio-card";
        simple-audio-card,name = "VF610-Tower-Sound-Card";
        simple-audio-card,format = "left_j";
        simple-audio-card,bitclock-master = <&dailink0_master>;
        simple-audio-card,frame-master = <&dailink0_master>;
        simple-audio-card,widgets =
                "Microphone", "Microphone Jack",
                "Headphone", "Headphone Jack",
                "Speaker", "External Speaker";
        simple-audio-card,routing =
                "MIC_IN", "Microphone Jack",
                "Headphone Jack", "HP_OUT",
                "External Speaker", "LINE_OUT";

        simple-audio-card,cpu {
            sound-dai = <&sh_fsi2 0>;
        };

        dailink0_master: simple-audio-card,codec {
            sound-dai = <&ak4648>;
            clocks = <&osc>;
        };
    };

#--------------------
# Multi DAI links
#--------------------
  - |
    sound {
        compatible = "simple-audio-card";
        simple-audio-card,name = "Cubox Audio";

        #address-cells = <1>;
        #size-cells = <0>;

        simple-audio-card,dai-link@0 {		/* I2S - HDMI */
            reg = <0>;
            format = "i2s";
            cpu {
                sound-dai = <&audio0>;
            };
            codec {
                sound-dai = <&tda998x0>;
            };
        };

        simple-audio-card,dai-link@1 {		/* S/PDIF - HDMI */
            reg = <1>;
            cpu {
                sound-dai = <&audio1>;
            };
            codec {
                sound-dai = <&tda998x1>;
            };
        };

        simple-audio-card,dai-link@2 {		/* S/PDIF - S/PDIF */
            reg = <2>;
            cpu {
                sound-dai = <&audio2>;
            };
            codec {
                sound-dai = <&spdif_codec>;
            };
        };
    };

#--------------------
# route audio from IMX6 SSI2 through TLV320DAC3100 codec
# through TPA6130A2 amplifier to headphones:
#--------------------
  - |
    sound {
        compatible = "simple-audio-card";

        simple-audio-card,widgets =
            "Headphone", "Headphone Jack";
        simple-audio-card,routing =
            "Headphone Jack", "HPLEFT",
            "Headphone Jack", "HPRIGHT",
            "LEFTIN", "HPL",
            "RIGHTIN", "HPR";
        simple-audio-card,aux-devs = <&amp>;
        simple-audio-card,cpu {
            sound-dai = <&ssi2>;
        };
        simple-audio-card,codec {
            sound-dai = <&codec>;
            clocks = <&clocks>;
        };
    };

#--------------------
# Sampling Rate Conversion
#--------------------
  - |
    sound {
        compatible = "simple-audio-card";

        simple-audio-card,name = "rsnd-ak4643";
        simple-audio-card,format = "left_j";
        simple-audio-card,bitclock-master = <&sndcodec>;
        simple-audio-card,frame-master = <&sndcodec>;

        simple-audio-card,convert-rate = <48000>;

        simple-audio-card,prefix = "ak4642";
        simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
                                    "DAI0 Capture", "ak4642 Capture";

        sndcpu: simple-audio-card,cpu {
            sound-dai = <&rcar_sound>;
        };

        sndcodec: simple-audio-card,codec {
            sound-dai = <&ak4643>;
            system-clock-frequency = <11289600>;
        };
    };

#--------------------
# 2 CPU 1 Codec (Mixing)
#--------------------
  - |
    sound {
        compatible = "simple-audio-card";
        #address-cells = <1>;
        #size-cells = <0>;

        simple-audio-card,name = "rsnd-ak4643";
        simple-audio-card,format = "left_j";
        simple-audio-card,bitclock-master = <&dpcmcpu>;
        simple-audio-card,frame-master = <&dpcmcpu>;

        simple-audio-card,convert-rate = <48000>;
        simple-audio-card,convert-channels = <2>;

        simple-audio-card,routing = "ak4642 Playback", "DAI0 Playback",
                                    "ak4642 Playback", "DAI1 Playback";

        dpcmcpu: simple-audio-card,cpu@0 {
            reg = <0>;
            sound-dai = <&rcar_sound 0>;
        };

        simple-audio-card,cpu@1 {
            reg = <1>;
            sound-dai = <&rcar_sound 1>;
        };

        simple-audio-card,codec {
            prefix = "ak4642";
            sound-dai = <&ak4643>;
            clocks = <&audio_clock>;
        };
    };

#--------------------
# Multi DAI links with DPCM:
#
# CPU0 ------ ak4613
# CPU1 ------ PCM3168A-p  /* DPCM 1ch/2ch */
# CPU2 --/                /* DPCM 3ch/4ch */
# CPU3 --/                /* DPCM 5ch/6ch */
# CPU4 --/                /* DPCM 7ch/8ch */
# CPU5 ------ PCM3168A-c
#--------------------
  - |
    sound {
        compatible = "simple-audio-card";
        #address-cells = <1>;
        #size-cells = <0>;

        simple-audio-card,routing =
            "pcm3168a Playback", "DAI1 Playback",
            "pcm3168a Playback", "DAI2 Playback",
            "pcm3168a Playback", "DAI3 Playback",
            "pcm3168a Playback", "DAI4 Playback";

        simple-audio-card,dai-link@0 {
            reg = <0>;
            format = "left_j";
            bitclock-master = <&sndcpu0>;
            frame-master = <&sndcpu0>;

            sndcpu0: cpu {
                sound-dai = <&rcar_sound 0>;
            };
            codec {
                sound-dai = <&ak4613>;
            };
        };

        simple-audio-card,dai-link@1 {
            reg = <1>;
            format = "i2s";
            bitclock-master = <&sndcpu1>;
            frame-master = <&sndcpu1>;

            convert-channels = <8>; /* TDM Split */

            sndcpu1: cpu0 {
                sound-dai = <&rcar_sound 1>;
            };
            cpu1 {
                sound-dai = <&rcar_sound 2>;
            };
            cpu2 {
                sound-dai = <&rcar_sound 3>;
            };
            cpu3 {
                sound-dai = <&rcar_sound 4>;
            };
            codec {
                mclk-fs = <512>;
                prefix = "pcm3168a";
                dai-tdm-slot-num = <8>;
                sound-dai = <&pcm3168a 0>;
            };
        };

        simple-audio-card,dai-link@2 {
            reg = <2>;
            format = "i2s";
            bitclock-master = <&sndcpu2>;
            frame-master = <&sndcpu2>;

            sndcpu2: cpu {
                sound-dai = <&rcar_sound 5>;
            };
            codec {
                mclk-fs = <512>;
                prefix = "pcm3168a";
                sound-dai = <&pcm3168a 1>;
            };
        };
    };


code:
* SiRF SoC audio port

Required properties:
- compatible: "sirf,audio-port"
- reg: Base address and size entries:
- 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:

audioport: audioport@b0040000 {
	compatible = "sirf,audio-port";
	reg = <0xb0040000 0x10000>;
	dmas = <&dmac1 3>, <&dmac1 8>;
	dma-names = "rx", "tx";
};


code:
* SiRF atlas6 and prima2 internal audio codec and port based audio setups

Required properties:
- compatible: "sirf,sirf-audio-card"
- sirf,audio-platform: phandle for the platform node
- sirf,audio-codec: phandle for the SiRF internal codec node

Optional properties:
- hp-pa-gpios: Need to be present if the board need control external
  headphone amplifier.
- spk-pa-gpios: Need to be present if the board need control external
  speaker amplifier.
- hp-switch-gpios: Need to be present if the board capable to detect jack
  insertion, removal.

Available audio endpoints for the audio-routing table:

Board connectors:
 * Headset Stereophone
 * Ext Spk
 * Line In
 * Mic

SiRF internal audio codec pins:
 * HPOUTL
 * HPOUTR
 * SPKOUT
 * Ext Mic
 * Mic Bias

Example:

sound {
		compatible = "sirf,sirf-audio-card";
		sirf,audio-codec = <&audiocodec>;
		sirf,audio-platform = <&audioport>;
		hp-pa-gpios = <&gpio 44 0>;
		spk-pa-gpios = <&gpio 46 0>;
		hp-switch-gpios = <&gpio 45 0>;
};


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

title: DesignWare I2S controller

maintainers:
  - Jose Abreu <joabreu@synopsys.com>

properties:
  compatible:
    oneOf:
      - items:
          - const: canaan,k210-i2s
          - const: snps,designware-i2s
      - enum:
          - snps,designware-i2s

  reg:
    maxItems: 1

  interrupts:
    description: |
      The interrupt line number for the I2S controller. Add this
      parameter if the I2S controller that you are using does not
      support DMA.
    maxItems: 1

  clocks:
    description: Sampling rate reference clock
    maxItems: 1

  clock-names:
    const: i2sclk

  resets:
    maxItems: 1

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

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

allOf:
  - $ref: dai-common.yaml#
  - if:
      properties:
        compatible:
          contains:
            const: canaan,k210-i2s
    then:
      properties:
        "#sound-dai-cells":
          const: 1
    else:
      properties:
        "#sound-dai-cells":
          const: 0

required:
  - compatible
  - reg
  - clocks
  - clock-names

oneOf:
  - required:
      - dmas
      - dma-names
  - required:
      - interrupts

unevaluatedProperties: false

examples:
  - |
    soc_i2s: i2s@7ff90000 {
      compatible = "snps,designware-i2s";
      reg = <0x7ff90000 0x1000>;
      clocks = <&scpi_i2sclk 0>;
      clock-names = "i2sclk";
      #sound-dai-cells = <0>;
      dmas = <&dma0 5>;
      dma-names = "tx";
    };


code:
AC97 link bindings

These bindings can be included within any other device node.

Required properties:
 - pinctrl-names: Has to contain following states to setup the correct
   pinmuxing for the used gpios:
	"ac97-running": AC97-link is active
	"ac97-reset": AC97-link reset state
	"ac97-warm-reset": AC97-link warm reset state
 - ac97-gpios: List of gpio phandles with args in the order ac97-sync,
   ac97-sdata, ac97-reset

Example:

ssi {
	...

	pinctrl-names = "default", "ac97-running", "ac97-reset", "ac97-warm-reset";
	pinctrl-0 = <&ac97link_running>;
	pinctrl-1 = <&ac97link_running>;
	pinctrl-2 = <&ac97link_reset>;
	pinctrl-3 = <&ac97link_warm_reset>;
	ac97-gpios = <&gpio3 20 0 &gpio3 22 0 &gpio3 28 0>;

	...
};


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

title: UniPhier AIO audio system

maintainers:
  - <alsa-devel@alsa-project.org>

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

properties:
  compatible:
    enum:
      - socionext,uniphier-ld11-aio
      - socionext,uniphier-ld20-aio
      - socionext,uniphier-pxs2-aio

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clock-names:
    const: aio

  clocks:
    maxItems: 1

  reset-names:
    const: aio

  resets:
    maxItems: 1

  socionext,syscon:
    description: |
      Specifies a phandle to soc-glue, which is used for changing mode of S/PDIF
      signal pin to output from Hi-Z. This property is optional if you use I2S
      signal pins only.
    $ref: "/schemas/types.yaml#/definitions/phandle"

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

patternProperties:
  "^port@[0-9]$":
    description: |
      Port number of DT node is specified by the following DAI channels that
      depends on SoC.
      ld11-aio,ld20-aio:
        0: hdmi
        1: pcmin2
        2: line
        3: hpcmout1
        4: pcmout3
        5: hiecout1
        6: epcmout2
        7: epcmout3
        8: hieccompout1
      pxs2-aio:
        0: hdmi
        1: line
        2: aux
        3: hiecout1
        4: iecout1
        5: hieccompout1
        6: ieccompout1
    $ref: audio-graph-port.yaml#
    unevaluatedProperties: false

unevaluatedProperties: false

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

examples:
  - |
    audio@56000000 {
        compatible = "socionext,uniphier-ld20-aio";
        reg = <0x56000000 0x80000>;
        interrupts = <0 144 4>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_aout>;
        clock-names = "aio";
        clocks = <&sys_clk 40>;
        reset-names = "aio";
        resets = <&sys_rst 40>;
        #sound-dai-cells = <1>;
        socionext,syscon = <&soc_glue>;
    };


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

title: UniPhier EVEA SoC-internal sound codec

maintainers:
  - <alsa-devel@alsa-project.org>

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

properties:
  compatible:
    const: socionext,uniphier-evea

  reg:
    maxItems: 1

  clock-names:
    items:
      - const: evea
      - const: exiv

  clocks:
    minItems: 2
    maxItems: 2

  reset-names:
    items:
      - const: evea
      - const: exiv
      - const: adamv

  resets:
    minItems: 3
    maxItems: 3

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

patternProperties:
  "^port@[0-9]$":
    description: |
      Port number of DT node is specified by the following DAI channels.
        0: line1
        1: hp
        2: line2
    $ref: audio-graph-port.yaml#
    unevaluatedProperties: false

unevaluatedProperties: false

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

examples:
  - |
    codec@57900000 {
        compatible = "socionext,uniphier-evea";
        reg = <0x57900000 0x1000>;
        clock-names = "evea", "exiv";
        clocks = <&sys_clk 41>, <&sys_clk 42>;
        reset-names = "evea", "exiv", "adamv";
        resets = <&sys_rst 41>, <&sys_rst 42>, <&adamv_rst 0>;
        #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/sound-dai.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Digital Audio Interface consumer

maintainers:
  - Rob Herring <robh@kernel.org>

select: true

properties:
  sound-dai:
    $ref: /schemas/types.yaml#/definitions/phandle-array
    description: A phandle plus args to digital audio interface provider(s)

additionalProperties: true
...


code:
Device-Tree bindings for dummy spdif receiver

Required properties:
	- compatible: should be "linux,spdif-dir".

Example node:

	codec: spdif-receiver {
		compatible = "linux,spdif-dir";
	};


code:
Spreadtrum Multi-Channel Data Transfer Binding

The Multi-channel data transfer controller is used for sound stream
transmission between audio subsystem and other AP/CP subsystem. It
supports 10 DAC channel and 10 ADC channel, and each channel can be
configured with DMA mode or interrupt mode.

Required properties:
- compatible: Should be "sprd,sc9860-mcdt".
- reg: Should contain registers address and length.
- interrupts: Should contain one interrupt shared by all channel.

Example:

mcdt@41490000 {
	compatible = "sprd,sc9860-mcdt";
	reg = <0 0x41490000 0 0x170>;
	interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>;
};


code:
* Spreadtrum DMA platfrom bindings

Required properties:
- compatible: Should be "sprd,pcm-platform".
- dmas: Specify the 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.

Example:

	audio_platform:platform@0 {
		compatible = "sprd,pcm-platform";
		dmas = <&agcp_dma 1 1>, <&agcp_dma 2 2>,
		     <&agcp_dma 3 3>, <&agcp_dma 4 4>,
		     <&agcp_dma 5 5>, <&agcp_dma 6 6>,
		     <&agcp_dma 7 7>, <&agcp_dma 8 8>,
		     <&agcp_dma 9 9>, <&agcp_dma 10 10>;
		dma-names = "normal_p_l", "normal_p_r",
			"normal_c_l", "normal_c_r",
			"voice_c", "fast_p",
			"loop_c", "loop_p",
			"voip_c", "voip_p";
	};


code:
SSM2518 audio amplifier

This device supports I2C only.

Required properties:
  - compatible : Must be "adi,ssm2518"
  - reg : the I2C address of the device. This will either be 0x34 (ADDR pin low)
	or 0x35 (ADDR pin high)

Optional properties:
  - gpios : GPIO connected to the nSD pin. If the property is not present it is
	        assumed that the nSD pin is hardwired to always on.

Example:

	ssm2518: ssm2518@34 {
		compatible = "adi,ssm2518";
		reg = <0x34>;
		gpios = <&gpio 5 0>;
	};


code:
Analog Devices SSM4567 audio amplifier

This device supports I2C only.

Required properties:
  - compatible : Must be "adi,ssm4567"
  - reg : the I2C address of the device. This will either be 0x34 (LR_SEL/ADDR connected to AGND),
	0x35 (LR_SEL/ADDR connected to IOVDD) or 0x36 (LR_SEL/ADDR open).

Example:

	ssm4567: ssm4567@34 {
		compatible = "adi,ssm4567";
		reg = <0x34>;
	};


code:
STA32X audio CODEC

The driver for this device only supports I2C.

Required properties:

  - compatible: "st,sta32x"
  - reg: the I2C address of the device for I2C
  - reset-gpios: a GPIO spec for the reset pin. If specified, it will be
		 deasserted before communication to the codec starts.

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

  - Vdda-supply: regulator spec, providing 3.3V
  - Vdd3-supply: regulator spec, providing 3.3V
  - Vcc-supply: regulator spec, providing 5V - 26V

Optional properties:

  - clocks, clock-names: Clock specifier for XTI input clock.
	If specified, the clock will be enabled when the codec is probed,
	and disabled when it is removed. The 'clock-names' must be set to 'xti'.

  -  st,output-conf: number, Selects the output configuration:
	0: 2-channel (full-bridge) power, 2-channel data-out
	1: 2 (half-bridge). 1 (full-bridge) on-board power
	2: 2 Channel (Full-Bridge) Power, 1 Channel FFX
	3: 1 Channel Mono-Parallel
	If parameter is missing, mode 0 will be enabled.
	This property has to be specified as '/bits/ 8' value.

  -  st,ch1-output-mapping: Channel 1 output mapping
  -  st,ch2-output-mapping: Channel 2 output mapping
  -  st,ch3-output-mapping: Channel 3 output mapping
	0: Channel 1
	1: Channel 2
	2: Channel 3
	If parameter is missing, channel 1 is chosen.
	This properties have to be specified as '/bits/ 8' values.

  -  st,thermal-warning-recover:
	If present, thermal warning recovery is enabled.

  - st,fault-detect-recovery:
	If present, fault detect recovery is enabled.

  -  st,thermal-warning-adjustment:
	If present, thermal warning adjustment is enabled.

  -  st,fault-detect-recovery:
	If present, then fault recovery will be enabled.

  -  st,drop-compensation-ns: number
	Only required for "st,ffx-power-output-mode" ==
	"variable-drop-compensation".
	Specifies the drop compensation in nanoseconds.
	The value must be in the range of 0..300, and only
	multiples of 20 are allowed. Default is 140ns.

  -  st,max-power-use-mpcc:
	If present, then MPCC bits are used for MPC coefficients,
	otherwise standard MPC coefficients are used.

  -  st,max-power-corr:
	If present, power bridge correction for THD reduction near maximum
	power output is enabled.

  -  st,am-reduction-mode:
	If present, FFX mode runs in AM reduction mode, otherwise normal
	FFX mode is used.

  -  st,odd-pwm-speed-mode:
	If present, PWM speed mode run on odd speed mode (341.3 kHz) on all
	channels. If not present, normal PWM spped mode (384 kHz) will be used.

  -  st,invalid-input-detect-mute:
	If present, automatic invalid input detect mute is enabled.

Example:

codec: sta32x@38 {
	compatible = "st,sta32x";
	reg = <0x1c>;
	clocks = <&clock>;
	clock-names = "xti";
	reset-gpios = <&gpio1 19 0>;
	power-down-gpios = <&gpio1 16 0>;
	st,output-conf = /bits/ 8  <0x3>;	// set output to 2-channel
						// (full-bridge) power,
						// 2-channel data-out
	st,ch1-output-mapping = /bits/ 8 <0>;	// set channel 1 output ch 1
	st,ch2-output-mapping = /bits/ 8 <0>;	// set channel 2 output ch 1
	st,ch3-output-mapping = /bits/ 8 <0>;	// set channel 3 output ch 1
	st,max-power-correction;		// enables power bridge
						// correction for THD reduction
						// near maximum power output
	st,invalid-input-detect-mute;		// mute if no valid digital
						// audio signal is provided.
};


code:
STA350 audio CODEC

The driver for this device only supports I2C.

Required properties:

  - compatible: "st,sta350"
  - reg: the I2C address of the device for I2C
  - reset-gpios: a GPIO spec for the reset pin. If specified, it will be
		 deasserted before communication to the codec starts.

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

  - vdd-dig-supply: regulator spec, providing 3.3V
  - vdd-pll-supply: regulator spec, providing 3.3V
  - vcc-supply: regulator spec, providing 5V - 26V

Optional properties:

  -  st,output-conf: number, Selects the output configuration:
	0: 2-channel (full-bridge) power, 2-channel data-out
	1: 2 (half-bridge). 1 (full-bridge) on-board power
	2: 2 Channel (Full-Bridge) Power, 1 Channel FFX
	3: 1 Channel Mono-Parallel
	If parameter is missing, mode 0 will be enabled.
	This property has to be specified as '/bits/ 8' value.

  -  st,ch1-output-mapping: Channel 1 output mapping
  -  st,ch2-output-mapping: Channel 2 output mapping
  -  st,ch3-output-mapping: Channel 3 output mapping
	0: Channel 1
	1: Channel 2
	2: Channel 3
	If parameter is missing, channel 1 is chosen.
	This properties have to be specified as '/bits/ 8' values.

  -  st,thermal-warning-recover:
	If present, thermal warning recovery is enabled.

  -  st,thermal-warning-adjustment:
	If present, thermal warning adjustment is enabled.

  -  st,fault-detect-recovery:
	If present, then fault recovery will be enabled.

  -  st,ffx-power-output-mode: string
	The FFX power output mode selects how the FFX output timing is
	configured. Must be one of these values:
	  -  "drop-compensation"
	  -  "tapered-compensation"
	  -  "full-power-mode"
	  -  "variable-drop-compensation" (default)

  -  st,drop-compensation-ns: number
	Only required for "st,ffx-power-output-mode" ==
	"variable-drop-compensation".
	Specifies the drop compensation in nanoseconds.
	The value must be in the range of 0..300, and only
	multiples of 20 are allowed. Default is 140ns.

  -  st,overcurrent-warning-adjustment:
	If present, overcurrent warning adjustment is enabled.

  -  st,max-power-use-mpcc:
	If present, then MPCC bits are used for MPC coefficients,
	otherwise standard MPC coefficients are used.

  -  st,max-power-corr:
	If present, power bridge correction for THD reduction near maximum
	power output is enabled.

  -  st,am-reduction-mode:
	If present, FFX mode runs in AM reduction mode, otherwise normal
	FFX mode is used.

  -  st,odd-pwm-speed-mode:
	If present, PWM speed mode run on odd speed mode (341.3 kHz) on all
	channels. If not present, normal PWM spped mode (384 kHz) will be used.

  -  st,distortion-compensation:
	If present, distortion compensation variable uses DCC coefficient.
	If not present, preset DC coefficient is used.

  -  st,invalid-input-detect-mute:
	If present, automatic invalid input detect mute is enabled.

  -  st,activate-mute-output:
	If present, a mute output will be activated in ase the volume will
	reach a value lower than -76 dBFS.

  -  st,bridge-immediate-off:
	If present, the bridge will be switched off immediately after the
	power-down-gpio goes low. Otherwise, the bridge will wait for 13
	million clock cycles to pass before shutting down.

  -  st,noise-shape-dc-cut:
	If present, the noise-shaping technique on the DC cutoff filter are
	enabled.

  -  st,powerdown-master-volume:
	If present, the power-down pin and I2C power-down functions will
	act on the master volume. Otherwise, the functions will act on the
	mute commands.

  -  st,powerdown-delay-divider:
	If present, the bridge power-down time will be divided by the provided
	value. If not specified, a divider of 1 will be used. Allowed values
	are 1, 2, 4, 8, 16, 32, 64 and 128.
	This property has to be specified as '/bits/ 8' value.

Example:

codec: sta350@38 {
	compatible = "st,sta350";
	reg = <0x1c>;
	reset-gpios = <&gpio1 19 0>;
	power-down-gpios = <&gpio1 16 0>;
	st,output-conf = /bits/ 8  <0x3>;	// set output to 2-channel
						// (full-bridge) power,
						// 2-channel data-out
	st,ch1-output-mapping = /bits/ 8 <0>;	// set channel 1 output ch 1
	st,ch2-output-mapping = /bits/ 8 <0>;	// set channel 2 output ch 1
	st,ch3-output-mapping = /bits/ 8 <0>;	// set channel 3 output ch 1
	st,max-power-correction;		// enables power bridge
						// correction for THD reduction
						// near maximum power output
	st,invalid-input-detect-mute;		// mute if no valid digital
						// audio signal is provided.
};


code:
STMicroelectronics sti ASoC cards

The sti ASoC Sound Card can be used, for all sti SoCs using internal sti-sas
codec or external codecs.

sti sound drivers allows to expose sti SoC audio interface through the
generic ASoC simple card. For details about sound card declaration please refer to
Documentation/devicetree/bindings/sound/simple-card.yaml.

1) sti-uniperiph-dai: audio dai device.
---------------------------------------

Required properties:
  - compatible: "st,stih407-uni-player-hdmi", "st,stih407-uni-player-pcm-out",
		"st,stih407-uni-player-dac", "st,stih407-uni-player-spdif",
		"st,stih407-uni-reader-pcm_in", "st,stih407-uni-reader-hdmi",

  - st,syscfg: phandle to boot-device system configuration registers

  - clock-names: name of the clocks listed in clocks property in the same order

  - reg: CPU DAI IP Base address and size entries, listed  in same
	 order than the CPU_DAI properties.

  - reg-names: names of the mapped memory regions listed in regs property in
	       the same order.

  - interrupts: CPU_DAI interrupt line, listed in the same order than the
		CPU_DAI properties.

  - dma: CPU_DAI DMA controller phandle and DMA request line, listed in the same
	 order than the CPU_DAI properties.

  - dma-names: identifier string for each DMA request line in the dmas property.
	"tx" for "st,sti-uni-player" compatibility
	"rx" for "st,sti-uni-reader" compatibility

Required properties ("st,sti-uni-player" compatibility only):
  - clocks: CPU_DAI IP clock source, listed in the same order than the
	    CPU_DAI properties.

Optional properties:
  - pinctrl-0: defined for CPU_DAI@1 and CPU_DAI@4 to describe I2S PIOs for
	       external codecs connection.

  - pinctrl-names: should contain only one value - "default".

  - st,tdm-mode: to declare to set TDM mode for unireader and uniplayer IPs.
	Only compartible with IPs in charge of the external I2S/TDM bus.
	Should be declared depending on associated codec.

Example:

	sti_uni_player1: sti-uni-player@8d81000 {
		compatible = "st,stih407-uni-player-hdmi";
		#sound-dai-cells = <0>;
		st,syscfg = <&syscfg_core>;
		clocks = <&clk_s_d0_flexgen CLK_PCM_1>;
		reg = <0x8D81000 0x158>;
		interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
		dmas = <&fdma0 3 0 1>;
		dma-names = "tx";
		st,tdm-mode = <1>;
	};

	sti_uni_player2: sti-uni-player@8d82000 {
		compatible = "st,stih407-uni-player-pcm-out";
		#sound-dai-cells = <0>;
		st,syscfg = <&syscfg_core>;
		clocks = <&clk_s_d0_flexgen CLK_PCM_2>;
		reg = <0x8D82000 0x158>;
		interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>;
		dmas = <&fdma0 4 0 1>;
		dma-names = "tx";
	};

	sti_uni_player3: sti-uni-player@8d85000 {
		compatible = "st,stih407-uni-player-spdif";
		#sound-dai-cells = <0>;
		st,syscfg = <&syscfg_core>;
		clocks = <&clk_s_d0_flexgen CLK_SPDIFF>;
		reg = <0x8D85000 0x158>;
		interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>;
		dmas = <&fdma0 7 0 1>;
		dma-names = "tx";
	};

	sti_uni_reader1: sti-uni-reader@8d84000 {
		compatible = "st,stih407-uni-reader-hdmi";
		#sound-dai-cells = <0>;
		st,syscfg = <&syscfg_core>;
		reg = <0x8D84000 0x158>;
		interrupts = <GIC_SPI 88 IRQ_TYPE_NONE>;
		dmas = <&fdma0 6 0 1>;
		dma-names = "rx";
	};

2) sti-sas-codec: internal audio codec IPs driver
-------------------------------------------------

Required properties:
  - compatible: "st,sti<chip>-sas-codec" .
	Should be chip "st,stih416-sas-codec" or "st,stih407-sas-codec"

  - st,syscfg: phandle to boot-device system configuration registers.

  - pinctrl-0: SPDIF PIO description.

  - pinctrl-names: should contain only one value - "default".

Example:
	sti_sas_codec: sti-sas-codec {
		compatible = "st,stih407-sas-codec";
		#sound-dai-cells = <1>;
		st,reg_audio = <&syscfg_core>;
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_spdif_out >;
	};

Example of audio card declaration:
	sound {
		compatible = "simple-audio-card";
		simple-audio-card,name = "sti audio card";

		simple-audio-card,dai-link@0 {
			/* DAC */
			format = "i2s";
			dai-tdm-slot-width = <32>;
			cpu {
				sound-dai = <&sti_uni_player2>;
			};

			codec {
				sound-dai = <&sti_sasg_codec 1>;
			};
		};
		simple-audio-card,dai-link@1 {
			/* SPDIF */
			format = "left_j";
			cpu {
				sound-dai = <&sti_uni_player3>;
			};

			codec {
				sound-dai = <&sti_sasg_codec 0>;
			};
		};
		simple-audio-card,dai-link@2 {
			/* TDM playback  */
			format = "left_j";
			frame-inversion = <1>;
			cpu {
				sound-dai = <&sti_uni_player1>;
				dai-tdm-slot-num = <16>;
				dai-tdm-slot-width = <16>;
				dai-tdm-slot-tx-mask =
					<1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 1>;
			};

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


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

title: STMicroelectronics STM32 SPI/I2S Controller

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

description:
  The SPI/I2S block supports I2S/PCM protocols when configured on I2S mode.
  Only some SPI instances support I2S.

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

properties:
  compatible:
    enum:
      - st,stm32h7-i2s

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

  reg:
    maxItems: 1

  clocks:
    items:
      - description: clock feeding the peripheral bus interface.
      - description: clock feeding the internal clock generator.
      - description: I2S parent clock for sampling rates multiple of 8kHz.
      - description: I2S parent clock for sampling rates multiple of 11.025kHz.

  clock-names:
    items:
      - const: pclk
      - const: i2sclk
      - const: x8k
      - const: x11k

  interrupts:
    maxItems: 1

  dmas:
    items:
      - description: audio capture DMA.
      - description: audio playback DMA.

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

  resets:
    maxItems: 1

  "#clock-cells":
    description: Configure the I2S device as MCLK clock provider.
    const: 0

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

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/clock/stm32mp1-clks.h>
    i2s2: audio-controller@4000b000 {
        compatible = "st,stm32h7-i2s";
        #sound-dai-cells = <0>;
        reg = <0x4000b000 0x400>;
        clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
        clock-names = "pclk", "i2sclk", "x8k", "x11k";
        interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
        dmas = <&dmamux1 39 0x400 0x01>,
               <&dmamux1 40 0x400 0x01>;
        dma-names = "rx", "tx";
        pinctrl-names = "default";
        pinctrl-0 = <&i2s2_pins_a>;
    };

...


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

title: STMicroelectronics STM32 Serial Audio Interface (SAI)

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

description:
  The SAI interface (Serial Audio Interface) offers a wide set of audio
  protocols as I2S standards, LSB or MSB-justified, PCM/DSP, TDM, and AC'97.
  The SAI contains two independent audio sub-blocks. Each sub-block has
  its own clock generator and I/O lines controller.

properties:
  compatible:
    enum:
      - st,stm32f4-sai
      - st,stm32h7-sai

  reg:
    items:
      - description: Base address and size of SAI common register set.
      - description: Base address and size of SAI identification register set.
    minItems: 1

  ranges:
    maxItems: 1

  interrupts:
    maxItems: 1

  resets:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 1

  clocks:
    maxItems: 3

  clock-names:
    maxItems: 3

required:
  - compatible
  - reg
  - ranges
  - "#address-cells"
  - "#size-cells"
  - clocks
  - clock-names

patternProperties:
  "^audio-controller@[0-9a-f]+$":
    type: object
    additionalProperties: false
    description:
      Two subnodes corresponding to SAI sub-block instances A et B
      can be defined. Subnode can be omitted for unsused sub-block.

    properties:
      compatible:
        description: Compatible for SAI sub-block A or B.
        pattern: "st,stm32-sai-sub-[ab]"

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

      reg:
        maxItems: 1

      clocks:
        items:
          - description: sai_ck clock feeding the internal clock generator.
          - description: MCLK clock from a SAI set as master clock provider.
        minItems: 1

      clock-names:
        items:
          - const: sai_ck
          - const: MCLK
        minItems: 1

      dmas:
        maxItems: 1

      dma-names:
        description: |
          rx: SAI sub-block is configured as a capture DAI.
          tx: SAI sub-block is configured as a playback DAI.
        enum: [ rx, tx ]

      st,sync:
        description:
          Configure the SAI sub-block as slave of another SAI sub-block.
          By default SAI sub-block is in asynchronous mode.
          Must contain the phandle and index of the SAI sub-block providing
          the synchronization.
        $ref: /schemas/types.yaml#/definitions/phandle-array
        items:
          - items:
              - description: phandle of the SAI sub-block
              - description: index of the SAI sub-block

      st,iec60958:
        description:
          If set, support S/PDIF IEC6958 protocol for playback.
          IEC60958 protocol is not available for capture.
          By default, custom protocol is assumed, meaning that protocol is
          configured according to protocol defined in related DAI link node,
          such as i2s, left justified, right justified, dsp and pdm protocols.
        $ref: /schemas/types.yaml#/definitions/flag

      "#clock-cells":
        description: Configure the SAI device as master clock provider.
        const: 0

      port:
        $ref: audio-graph-port.yaml#
        unevaluatedProperties: false

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

allOf:
  - if:
      properties:
        compatible:
          contains:
            const: st,stm32f4-sai
    then:
      properties:
        clocks:
          items:
            - description: x8k, SAI parent clock for sampling rates multiple of 8kHz.
            - description: x11k, SAI parent clock for sampling rates multiple of 11.025kHz.

        clock-names:
          items:
            - const: x8k
            - const: x11k
    else:
      properties:
        clocks:
          items:
            - description: pclk feeds the peripheral bus interface.
            - description: x8k, SAI parent clock for sampling rates multiple of 8kHz.
            - description: x11k, SAI parent clock for sampling rates multiple of 11.025kHz.

        clock-names:
          items:
            - const: pclk
            - const: x8k
            - const: x11k

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/clock/stm32mp1-clks.h>
    #include <dt-bindings/reset/stm32mp1-resets.h>
    sai2: sai@4400b000 {
      compatible = "st,stm32h7-sai";
      #address-cells = <1>;
      #size-cells = <1>;
      ranges = <0 0x4400b000 0x400>;
      reg = <0x4400b000 0x4>, <0x4400b3f0 0x10>;
      clocks = <&rcc SAI2>, <&rcc PLL3_Q>, <&rcc PLL3_R>;
      clock-names = "pclk", "x8k", "x11k";
      pinctrl-names = "default", "sleep";
      pinctrl-0 = <&sai2a_pins_a>, <&sai2b_pins_b>;
      pinctrl-1 = <&sai2a_sleep_pins_a>, <&sai2b_sleep_pins_b>;

      sai2a: audio-controller@4400b004 {
        #sound-dai-cells = <0>;
        compatible = "st,stm32-sai-sub-a";
        reg = <0x4 0x1c>;
        dmas = <&dmamux1 89 0x400 0x01>;
        dma-names = "tx";
        clocks = <&rcc SAI2_K>;
        clock-names = "sai_ck";
      };
    };

...


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

title: STMicroelectronics STM32 S/PDIF receiver (SPDIFRX)

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

description: |
  The SPDIFRX peripheral, is designed to receive an S/PDIF flow compliant with
  IEC-60958 and IEC-61937.

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

properties:
  compatible:
    enum:
      - st,stm32h7-spdifrx

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

  reg:
    maxItems: 1

  clocks:
    maxItems: 1

  clock-names:
    items:
      - const: kclk

  interrupts:
    maxItems: 1

  dmas:
    items:
      - description: audio data capture DMA
      - description: IEC status bits capture DMA

  dma-names:
    items:
      - const: rx
      - const: rx-ctrl

  resets:
    maxItems: 1

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

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/clock/stm32mp1-clks.h>
    spdifrx: spdifrx@40004000 {
        compatible = "st,stm32h7-spdifrx";
        #sound-dai-cells = <0>;
        reg = <0x40004000 0x400>;
        clocks = <&rcc SPDIF_K>;
        clock-names = "kclk";
        interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
        dmas = <&dmamux1 2 93 0x400 0x0>,
               <&dmamux1 3 94 0x400 0x0>;
        dma-names = "rx", "rx-ctrl";
        pinctrl-0 = <&spdifrx_pins>;
        pinctrl-names = "default";
    };

...


code:
* Sound complex for Storm boards

Models a soundcard for Storm boards with the Qualcomm Technologies IPQ806x SOC
connected to a MAX98357A DAC via I2S.

Required properties:

- compatible	: "google,storm-audio"
- cpu		: Phandle of the CPU DAI
- codec		: Phandle of the codec DAI

Optional properties:

- qcom,model	: The user-visible name of this sound card.

Example:

sound {
	compatible = "google,storm-audio";
	qcom,model = "ipq806x-storm";
	cpu = <&lpass_cpu>;
	codec = <&max98357a>;
};