xref: /linux/Documentation/devicetree/bindings/sound/realtek,rt5640.yaml (revision 7f71507851fc7764b36a3221839607d3a45c2025)
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,rt5640.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: RT5640/RT5639 audio CODEC
8
9maintainers:
10  - Neil Armstrong <neil.armstrong@linaro.org>
11
12description: |
13  This device supports I2C only.
14
15  Pins on the device (for linking into audio routes) for RT5639/RT5640:
16    * DMIC1
17    * DMIC2
18    * MICBIAS1
19    * IN1P
20    * IN1N
21    * IN2P
22    * IN2N
23    * IN3P
24    * IN3N
25    * HPOL
26    * HPOR
27    * LOUTL
28    * LOUTR
29    * SPOLP
30    * SPOLN
31    * SPORP
32    * SPORN
33
34  Additional pins on the device for RT5640:
35    * MONOP
36    * MONON
37
38allOf:
39  - $ref: dai-common.yaml#
40
41properties:
42  compatible:
43    enum:
44      - realtek,rt5640
45      - realtek,rt5639
46
47  reg:
48    maxItems: 1
49
50  interrupts:
51    maxItems: 1
52    description: The CODEC's interrupt output.
53
54  realtek,in1-differential:
55    description:
56      Indicate MIC1 input is differential, rather than single-ended.
57    type: boolean
58
59  realtek,in2-differential:
60    description:
61      Indicate MIC2 input is differential, rather than single-ended.
62    type: boolean
63
64  realtek,in3-differential:
65    description:
66      Indicate MIC3 input is differential, rather than single-ended.
67    type: boolean
68
69  realtek,lout-differential:
70    description:
71      Indicate LOUT output is differential, rather than single-ended.
72    type: boolean
73
74  realtek,dmic1-data-pin:
75    description: Specify which pin to be used as DMIC1 data pin.
76    $ref: /schemas/types.yaml#/definitions/uint32
77    enum:
78      - 0 # dmic1 is not used
79      - 1 # using IN2P pin as dmic1 data pin
80      - 2 # using GPIO3 pin as dmic1 data pin
81
82  realtek,dmic2-data-pin:
83    description: Specify which pin to be used as DMIC2 data pin.
84    $ref: /schemas/types.yaml#/definitions/uint32
85    enum:
86      - 0 # dmic2 is not used
87      - 1 # using IN2N pin as dmic2 data pin
88      - 2 # using GPIO4 pin as dmic2 data pin
89
90  realtek,jack-detect-source:
91    description: The Jack Detect source.
92    $ref: /schemas/types.yaml#/definitions/uint32
93    enum:
94      - 0 # Jack Detect function is not used
95      - 1 # Use GPIO1 for jack-detect
96      - 2 # Use JD1_IN4P for jack-detect
97      - 3 # Use JD2_IN4N for jack-detect
98      - 4 # Use GPIO2 for jack-detect
99      - 5 # Use GPIO3 for jack-detect
100      - 6 # Use GPIO4 for jack-detect
101
102  realtek,jack-detect-not-inverted:
103    description:
104      Normal jack-detect switches give an inverted signal, set this bool
105      in the rare case you've a jack-detect switch which is not inverted.
106    type: boolean
107
108  realtek,over-current-threshold-microamp:
109    description: micbias over-current detection threshold in µA
110    enum:
111      - 600
112      - 1500
113      - 2000
114
115  realtek,over-current-scale-factor:
116    description: micbias over-current detection scale-factor
117    $ref: /schemas/types.yaml#/definitions/uint32
118    enum:
119      - 0 # Scale current by 0.5
120      - 1 # Scale current by 0.75
121      - 2 # Scale current by 1.0
122      - 3 # Scale current by 1.5
123
124required:
125  - compatible
126  - reg
127  - interrupts
128
129unevaluatedProperties: false
130
131examples:
132  - |
133    #include <dt-bindings/gpio/gpio.h>
134    #include <dt-bindings/interrupt-controller/irq.h>
135
136    i2c {
137        #address-cells = <1>;
138        #size-cells = <0>;
139
140        codec@1a {
141            compatible = "realtek,rt5640";
142            reg = <0x1a>;
143            interrupt-parent = <&gpio>;
144            interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
145        };
146    };
147