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,amic-delay-ms:
65    description: |
66      Set the delay time (ms) for the requirement of the particular platform or AMIC.
67
68  realtek,dmic-clk-driving-high:
69    type: boolean
70    description: |
71      Set the high driving of the DMIC clock out.
72
73  clocks:
74    items:
75      - description: phandle and clock specifier for codec MCLK.
76
77  clock-names:
78    items:
79      - const: mclk
80
81  "#clock-cells":
82    const: 1
83
84  clock-output-names:
85    minItems: 2
86    maxItems: 2
87    description: Name given for DAI word clock and bit clock outputs.
88
89additionalProperties: false
90
91required:
92  - compatible
93  - reg
94
95examples:
96  - |
97    #include <dt-bindings/gpio/tegra-gpio.h>
98    #include <dt-bindings/interrupt-controller/irq.h>
99
100    i2c {
101        #address-cells = <1>;
102        #size-cells = <0>;
103
104        codec@1a {
105            compatible = "realtek,rt5682s";
106            reg = <0x1a>;
107            interrupt-parent = <&gpio>;
108            interrupts = <TEGRA_GPIO(U, 6) IRQ_TYPE_LEVEL_HIGH>;
109            realtek,ldo1-en-gpios =
110                <&gpio TEGRA_GPIO(R, 2) GPIO_ACTIVE_HIGH>;
111            realtek,dmic1-data-pin = <1>;
112            realtek,dmic1-clk-pin = <1>;
113            realtek,jd-src = <1>;
114
115            #clock-cells = <1>;
116            clock-output-names = "rt5682-dai-wclk", "rt5682-dai-bclk";
117
118            clocks = <&osc>;
119            clock-names = "mclk";
120        };
121    };
122