xref: /freebsd/sys/contrib/device-tree/Bindings/sound/realtek,rt5677.yaml (revision 0e8011faf58b743cc652e3b2ad0f7671227610df)
1*0e8011faSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*0e8011faSEmmanuel Vadot%YAML 1.2
3*0e8011faSEmmanuel Vadot---
4*0e8011faSEmmanuel Vadot$id: http://devicetree.org/schemas/sound/realtek,rt5677.yaml#
5*0e8011faSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*0e8011faSEmmanuel Vadot
7*0e8011faSEmmanuel Vadottitle: RT5677 audio CODEC
8*0e8011faSEmmanuel Vadot
9*0e8011faSEmmanuel Vadotmaintainers:
10*0e8011faSEmmanuel Vadot  - Animesh Agarwal <animeshagarwal28@gmail.com>
11*0e8011faSEmmanuel Vadot
12*0e8011faSEmmanuel Vadotdescription: |
13*0e8011faSEmmanuel Vadot  This device supports I2C only.
14*0e8011faSEmmanuel Vadot
15*0e8011faSEmmanuel Vadot  Pins on the device (for linking into audio routes):
16*0e8011faSEmmanuel Vadot    * IN1P
17*0e8011faSEmmanuel Vadot    * IN1N
18*0e8011faSEmmanuel Vadot    * IN2P
19*0e8011faSEmmanuel Vadot    * IN2N
20*0e8011faSEmmanuel Vadot    * MICBIAS1
21*0e8011faSEmmanuel Vadot    * DMIC1
22*0e8011faSEmmanuel Vadot    * DMIC2
23*0e8011faSEmmanuel Vadot    * DMIC3
24*0e8011faSEmmanuel Vadot    * DMIC4
25*0e8011faSEmmanuel Vadot    * LOUT1
26*0e8011faSEmmanuel Vadot    * LOUT2
27*0e8011faSEmmanuel Vadot    * LOUT3
28*0e8011faSEmmanuel Vadot
29*0e8011faSEmmanuel VadotallOf:
30*0e8011faSEmmanuel Vadot  - $ref: dai-common.yaml#
31*0e8011faSEmmanuel Vadot
32*0e8011faSEmmanuel Vadotproperties:
33*0e8011faSEmmanuel Vadot  compatible:
34*0e8011faSEmmanuel Vadot    const: realtek,rt5677
35*0e8011faSEmmanuel Vadot
36*0e8011faSEmmanuel Vadot  reg:
37*0e8011faSEmmanuel Vadot    maxItems: 1
38*0e8011faSEmmanuel Vadot
39*0e8011faSEmmanuel Vadot  interrupts:
40*0e8011faSEmmanuel Vadot    maxItems: 1
41*0e8011faSEmmanuel Vadot
42*0e8011faSEmmanuel Vadot  gpio-controller: true
43*0e8011faSEmmanuel Vadot
44*0e8011faSEmmanuel Vadot  '#gpio-cells':
45*0e8011faSEmmanuel Vadot    const: 2
46*0e8011faSEmmanuel Vadot
47*0e8011faSEmmanuel Vadot  realtek,pow-ldo2-gpio:
48*0e8011faSEmmanuel Vadot    maxItems: 1
49*0e8011faSEmmanuel Vadot    description: CODEC's POW_LDO2 pin.
50*0e8011faSEmmanuel Vadot
51*0e8011faSEmmanuel Vadot  realtek,reset-gpio:
52*0e8011faSEmmanuel Vadot    maxItems: 1
53*0e8011faSEmmanuel Vadot    description: CODEC's RESET pin. Active low.
54*0e8011faSEmmanuel Vadot
55*0e8011faSEmmanuel Vadot  realtek,gpio-config:
56*0e8011faSEmmanuel Vadot    description: |
57*0e8011faSEmmanuel Vadot      Array of six 8bit elements that configures GPIO.
58*0e8011faSEmmanuel Vadot      0 - floating (reset value)
59*0e8011faSEmmanuel Vadot      1 - pull down
60*0e8011faSEmmanuel Vadot      2 - pull up
61*0e8011faSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
62*0e8011faSEmmanuel Vadot    minItems: 6
63*0e8011faSEmmanuel Vadot    maxItems: 6
64*0e8011faSEmmanuel Vadot    items:
65*0e8011faSEmmanuel Vadot      maximum: 2
66*0e8011faSEmmanuel Vadot
67*0e8011faSEmmanuel Vadot  realtek,jd1-gpio:
68*0e8011faSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
69*0e8011faSEmmanuel Vadot    enum:
70*0e8011faSEmmanuel Vadot      - 0 # OFF
71*0e8011faSEmmanuel Vadot      - 1 # GPIO1 for jd1.
72*0e8011faSEmmanuel Vadot      - 2 # GPIO2 for jd1.
73*0e8011faSEmmanuel Vadot      - 3 # GPIO3 for jd1.
74*0e8011faSEmmanuel Vadot    description: Configures GPIO Mic Jack detection 1.
75*0e8011faSEmmanuel Vadot
76*0e8011faSEmmanuel Vadot  realtek,jd2-gpio:
77*0e8011faSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
78*0e8011faSEmmanuel Vadot    enum:
79*0e8011faSEmmanuel Vadot      - 0 # OFF
80*0e8011faSEmmanuel Vadot      - 1 # GPIO4 for jd2.
81*0e8011faSEmmanuel Vadot      - 2 # GPIO5 for jd2.
82*0e8011faSEmmanuel Vadot      - 3 # GPIO6 for jd2.
83*0e8011faSEmmanuel Vadot    description: Configures GPIO Mic Jack detection 2.
84*0e8011faSEmmanuel Vadot
85*0e8011faSEmmanuel Vadot  realtek,jd3-gpio:
86*0e8011faSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
87*0e8011faSEmmanuel Vadot    enum:
88*0e8011faSEmmanuel Vadot      - 0 # OFF
89*0e8011faSEmmanuel Vadot      - 1 # GPIO4 for jd3.
90*0e8011faSEmmanuel Vadot      - 2 # GPIO5 for jd3.
91*0e8011faSEmmanuel Vadot      - 3 # GPIO6 for jd3.
92*0e8011faSEmmanuel Vadot    description: Configures GPIO Mic Jack detection 3.
93*0e8011faSEmmanuel Vadot
94*0e8011faSEmmanuel VadotpatternProperties:
95*0e8011faSEmmanuel Vadot  '^realtek,in[1-2]-differential$':
96*0e8011faSEmmanuel Vadot    type: boolean
97*0e8011faSEmmanuel Vadot    description: Indicate MIC1/2 input are differential, rather than
98*0e8011faSEmmanuel Vadot      single-ended.
99*0e8011faSEmmanuel Vadot
100*0e8011faSEmmanuel Vadot  '^realtek,lout[1-3]-differential$':
101*0e8011faSEmmanuel Vadot    type: boolean
102*0e8011faSEmmanuel Vadot    description: Indicate LOUT1/2/3 outputs are differential, rather than
103*0e8011faSEmmanuel Vadot      single-ended.
104*0e8011faSEmmanuel Vadot
105*0e8011faSEmmanuel Vadotrequired:
106*0e8011faSEmmanuel Vadot  - compatible
107*0e8011faSEmmanuel Vadot  - reg
108*0e8011faSEmmanuel Vadot  - interrupts
109*0e8011faSEmmanuel Vadot  - gpio-controller
110*0e8011faSEmmanuel Vadot  - '#gpio-cells'
111*0e8011faSEmmanuel Vadot
112*0e8011faSEmmanuel VadotunevaluatedProperties: false
113*0e8011faSEmmanuel Vadot
114*0e8011faSEmmanuel Vadotexamples:
115*0e8011faSEmmanuel Vadot  - |
116*0e8011faSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
117*0e8011faSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
118*0e8011faSEmmanuel Vadot
119*0e8011faSEmmanuel Vadot    i2c {
120*0e8011faSEmmanuel Vadot        #address-cells = <1>;
121*0e8011faSEmmanuel Vadot        #size-cells = <0>;
122*0e8011faSEmmanuel Vadot
123*0e8011faSEmmanuel Vadot        codec@2c {
124*0e8011faSEmmanuel Vadot            compatible = "realtek,rt5677";
125*0e8011faSEmmanuel Vadot            reg = <0x2c>;
126*0e8011faSEmmanuel Vadot            interrupt-parent = <&gpio>;
127*0e8011faSEmmanuel Vadot            interrupts = <3 IRQ_TYPE_LEVEL_HIGH>;
128*0e8011faSEmmanuel Vadot            gpio-controller;
129*0e8011faSEmmanuel Vadot            #gpio-cells = <2>;
130*0e8011faSEmmanuel Vadot            realtek,pow-ldo2-gpio = <&gpio 3 GPIO_ACTIVE_HIGH>;
131*0e8011faSEmmanuel Vadot            realtek,reset-gpio = <&gpio 3 GPIO_ACTIVE_LOW>;
132*0e8011faSEmmanuel Vadot            realtek,in1-differential;
133*0e8011faSEmmanuel Vadot            realtek,gpio-config = <0 0 0 0 0 2>;
134*0e8011faSEmmanuel Vadot        };
135*0e8011faSEmmanuel Vadot    };
136