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