1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/realtek,rt5682s.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Realtek rt5682s codec devicetree bindings
8
9maintainers:
10  - Derek Fang <derek.fang@realtek.com>
11
12description: |
13  Rt5682s(ALC5682I-VS) is a rt5682i variant which supports I2C only.
14
15properties:
16  compatible:
17    const: realtek,rt5682s
18
19  reg:
20    maxItems: 1
21    description: I2C address of the device.
22
23  interrupts:
24    description: The CODEC's interrupt output.
25
26  realtek,dmic1-data-pin:
27    $ref: /schemas/types.yaml#/definitions/uint32
28    enum:
29      - 0 # dmic1 data is not used
30      - 1 # using GPIO2 pin as dmic1 data pin
31      - 2 # using GPIO5 pin as dmic1 data pin
32    description: |
33      Specify which GPIO pin be used as DMIC1 data pin.
34
35  realtek,dmic1-clk-pin:
36    $ref: /schemas/types.yaml#/definitions/uint32
37    enum:
38      - 0 # dmic1 clk is not used
39      - 1 # using GPIO1 pin as dmic1 clock pin
40      - 2 # using GPIO3 pin as dmic1 clock pin
41    description: |
42      Specify which GPIO pin be used as DMIC1 clk pin.
43
44  realtek,jd-src:
45    $ref: /schemas/types.yaml#/definitions/uint32
46    enum:
47      - 0 # No JD is used
48      - 1 # using JD1 as JD source
49    description: |
50      Specify which JD source be used.
51
52  realtek,ldo1-en-gpios:
53    description: |
54      The GPIO that controls the CODEC's LDO1_EN pin.
55
56  realtek,dmic-clk-rate-hz:
57    description: |
58      Set the clock rate (hz) for the requirement of the particular DMIC.
59
60  realtek,dmic-delay-ms:
61    description: |
62      Set the delay time (ms) for the requirement of the particular DMIC.
63
64  realtek,dmic-clk-driving-high:
65    type: boolean
66    description: |
67      Set the high driving of the DMIC clock out.
68
69  clocks:
70    items:
71      - description: phandle and clock specifier for codec MCLK.
72
73  clock-names:
74    items:
75      - const: mclk
76
77  "#clock-cells":
78    const: 1
79
80  clock-output-names:
81    minItems: 2
82    maxItems: 2
83    description: Name given for DAI word clock and bit clock outputs.
84
85additionalProperties: false
86
87required:
88  - compatible
89  - reg
90
91examples:
92  - |
93    #include <dt-bindings/gpio/tegra-gpio.h>
94    #include <dt-bindings/interrupt-controller/irq.h>
95
96    i2c {
97        #address-cells = <1>;
98        #size-cells = <0>;
99
100        codec@1a {
101            compatible = "realtek,rt5682s";
102            reg = <0x1a>;
103            interrupt-parent = <&gpio>;
104            interrupts = <TEGRA_GPIO(U, 6) IRQ_TYPE_LEVEL_HIGH>;
105            realtek,ldo1-en-gpios =
106                <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_HIGH>;
107            realtek,dmic1-data-pin = <1>;
108            realtek,dmic1-clk-pin = <1>;
109            realtek,jd-src = <1>;
110
111            #clock-cells = <1>;
112            clock-output-names = "rt5682-dai-wclk", "rt5682-dai-bclk";
113
114            clocks = <&osc>;
115            clock-names = "mclk";
116        };
117    };
118