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