xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/sound/tlv320adcx140.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
2*4882a593Smuzhiyun# Copyright (C) 2019 Texas Instruments Incorporated
3*4882a593Smuzhiyun%YAML 1.2
4*4882a593Smuzhiyun---
5*4882a593Smuzhiyun$id: http://devicetree.org/schemas/sound/tlv320adcx140.yaml#
6*4882a593Smuzhiyun$schema: http://devicetree.org/meta-schemas/core.yaml#
7*4882a593Smuzhiyun
8*4882a593Smuzhiyuntitle: Texas Instruments TLV320ADCX140 Quad Channel Analog-to-Digital Converter
9*4882a593Smuzhiyun
10*4882a593Smuzhiyunmaintainers:
11*4882a593Smuzhiyun  - Dan Murphy <dmurphy@ti.com>
12*4882a593Smuzhiyun
13*4882a593Smuzhiyundescription: |
14*4882a593Smuzhiyun  The TLV320ADCX140 are multichannel (4-ch analog recording or 8-ch digital
15*4882a593Smuzhiyun  PDM microphones recording), high-performance audio, analog-to-digital
16*4882a593Smuzhiyun  converter (ADC) with analog inputs supporting up to 2V RMS. The TLV320ADCX140
17*4882a593Smuzhiyun  family supports line and  microphone Inputs, and offers a programmable
18*4882a593Smuzhiyun  microphone bias or supply voltage generation.
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun  Specifications can be found at:
21*4882a593Smuzhiyun    https://www.ti.com/lit/ds/symlink/tlv320adc3140.pdf
22*4882a593Smuzhiyun    https://www.ti.com/lit/ds/symlink/tlv320adc5140.pdf
23*4882a593Smuzhiyun    https://www.ti.com/lit/ds/symlink/tlv320adc6140.pdf
24*4882a593Smuzhiyun
25*4882a593Smuzhiyunproperties:
26*4882a593Smuzhiyun  compatible:
27*4882a593Smuzhiyun    oneOf:
28*4882a593Smuzhiyun      - const: ti,tlv320adc3140
29*4882a593Smuzhiyun      - const: ti,tlv320adc5140
30*4882a593Smuzhiyun      - const: ti,tlv320adc6140
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun  reg:
33*4882a593Smuzhiyun    maxItems: 1
34*4882a593Smuzhiyun    description: |
35*4882a593Smuzhiyun      I2C addresss of the device can be one of these 0x4c, 0x4d, 0x4e or 0x4f
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun  reset-gpios:
38*4882a593Smuzhiyun    description: |
39*4882a593Smuzhiyun      GPIO used for hardware reset.
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun  areg-supply:
42*4882a593Smuzhiyun    description: |
43*4882a593Smuzhiyun      Regulator with AVDD at 3.3V.  If not defined then the internal regulator
44*4882a593Smuzhiyun      is enabled.
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun  ti,mic-bias-source:
47*4882a593Smuzhiyun    description: |
48*4882a593Smuzhiyun      Indicates the source for MIC Bias.
49*4882a593Smuzhiyun      0 - Mic bias is set to VREF
50*4882a593Smuzhiyun      1 - Mic bias is set to VREF × 1.096
51*4882a593Smuzhiyun      6 - Mic bias is set to AVDD
52*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/uint32
53*4882a593Smuzhiyun    enum: [0, 1, 6]
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun  ti,vref-source:
56*4882a593Smuzhiyun    description: |
57*4882a593Smuzhiyun      Indicates the source for MIC Bias.
58*4882a593Smuzhiyun      0 - Set VREF to 2.75V
59*4882a593Smuzhiyun      1 - Set VREF to 2.5V
60*4882a593Smuzhiyun      2 - Set VREF to 1.375V
61*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/uint32
62*4882a593Smuzhiyun    enum: [0, 1, 2]
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun  ti,pdm-edge-select:
65*4882a593Smuzhiyun    description: |
66*4882a593Smuzhiyun       Defines the PDMCLK sampling edge configuration for the PDM inputs.  This
67*4882a593Smuzhiyun       array is defined as <PDMIN1 PDMIN2 PDMIN3 PDMIN4>.
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun       0 - (default) Odd channel is latched on the negative edge and even
70*4882a593Smuzhiyun       channel is latched on the the positive edge.
71*4882a593Smuzhiyun       1 - Odd channel is latched on the positive edge and even channel is
72*4882a593Smuzhiyun       latched on the the negative edge.
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun       PDMIN1 - PDMCLK latching edge used for channel 1 and 2 data
75*4882a593Smuzhiyun       PDMIN2 - PDMCLK latching edge used for channel 3 and 4 data
76*4882a593Smuzhiyun       PDMIN3 - PDMCLK latching edge used for channel 5 and 6 data
77*4882a593Smuzhiyun       PDMIN4 - PDMCLK latching edge used for channel 7 and 8 data
78*4882a593Smuzhiyun
79*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/uint32-array
80*4882a593Smuzhiyun    minItems: 1
81*4882a593Smuzhiyun    maxItems: 4
82*4882a593Smuzhiyun    items:
83*4882a593Smuzhiyun      maximum: 1
84*4882a593Smuzhiyun    default: [0, 0, 0, 0]
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun  ti,gpi-config:
87*4882a593Smuzhiyun    description: |
88*4882a593Smuzhiyun       Defines the configuration for the general purpose input pins (GPI).
89*4882a593Smuzhiyun       The array is defined as <GPI1 GPI2 GPI3 GPI4>.
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun       0 - (default) disabled
92*4882a593Smuzhiyun       1 - GPIX is configured as a general-purpose input (GPI)
93*4882a593Smuzhiyun       2 - GPIX is configured as a master clock input (MCLK)
94*4882a593Smuzhiyun       3 - GPIX is configured as an ASI input for daisy-chain (SDIN)
95*4882a593Smuzhiyun       4 - GPIX is configured as a PDM data input for channel 1 and channel
96*4882a593Smuzhiyun            (PDMDIN1)
97*4882a593Smuzhiyun       5 - GPIX is configured as a PDM data input for channel 3 and channel
98*4882a593Smuzhiyun            (PDMDIN2)
99*4882a593Smuzhiyun       6 - GPIX is configured as a PDM data input for channel 5 and channel
100*4882a593Smuzhiyun            (PDMDIN3)
101*4882a593Smuzhiyun       7 - GPIX is configured as a PDM data input for channel 7 and channel
102*4882a593Smuzhiyun            (PDMDIN4)
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/uint32-array
105*4882a593Smuzhiyun    minItems: 1
106*4882a593Smuzhiyun    maxItems: 4
107*4882a593Smuzhiyun    items:
108*4882a593Smuzhiyun      maximum: 7
109*4882a593Smuzhiyun    default: [0, 0, 0, 0]
110*4882a593Smuzhiyun
111*4882a593Smuzhiyun  ti,asi-tx-drive:
112*4882a593Smuzhiyun    type: boolean
113*4882a593Smuzhiyun    description: |
114*4882a593Smuzhiyun      When set the device will set the Tx ASI output to a Hi-Z state for unused
115*4882a593Smuzhiyun      data cycles. Default is to drive the output low on unused ASI cycles.
116*4882a593Smuzhiyun
117*4882a593SmuzhiyunpatternProperties:
118*4882a593Smuzhiyun  '^ti,gpo-config-[1-4]$':
119*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/uint32-array
120*4882a593Smuzhiyun    description: |
121*4882a593Smuzhiyun       Defines the configuration and output driver for the general purpose
122*4882a593Smuzhiyun       output pins (GPO).  These values are pairs, the first value is for the
123*4882a593Smuzhiyun       configuration type and the second value is for the output drive type.
124*4882a593Smuzhiyun       The array is defined as <GPO_CFG GPO_DRV>
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun       GPO output configuration can be one of the following:
127*4882a593Smuzhiyun
128*4882a593Smuzhiyun       0 - (default) disabled
129*4882a593Smuzhiyun       1 - GPOX is configured as a general-purpose output (GPO)
130*4882a593Smuzhiyun       2 - GPOX is configured as a device interrupt output (IRQ)
131*4882a593Smuzhiyun       3 - GPOX is configured as a secondary ASI output (SDOUT2)
132*4882a593Smuzhiyun       4 - GPOX is configured as a PDM clock output (PDMCLK)
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun       GPO output drive configuration for the GPO pins can be one of the following:
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun       0d - (default) Hi-Z output
137*4882a593Smuzhiyun       1d - Drive active low and active high
138*4882a593Smuzhiyun       2d - Drive active low and weak high
139*4882a593Smuzhiyun       3d - Drive active low and Hi-Z
140*4882a593Smuzhiyun       4d - Drive weak low and active high
141*4882a593Smuzhiyun       5d - Drive Hi-Z and active high
142*4882a593Smuzhiyun
143*4882a593Smuzhiyun  ti,gpio-config:
144*4882a593Smuzhiyun    description: |
145*4882a593Smuzhiyun       Defines the configuration and output drive for the General Purpose
146*4882a593Smuzhiyun       Input and Output pin (GPIO1). Its value is a pair, the first value is for
147*4882a593Smuzhiyun       the configuration type and the second value is for the output drive
148*4882a593Smuzhiyun       type. The array is defined as <GPIO1_CFG GPIO1_DRV>
149*4882a593Smuzhiyun
150*4882a593Smuzhiyun       configuration for the GPIO pin can be one of the following:
151*4882a593Smuzhiyun       0 - disabled
152*4882a593Smuzhiyun       1 - GPIO1 is configured as a general-purpose output (GPO)
153*4882a593Smuzhiyun       2 - (default) GPIO1 is configured as a device interrupt output (IRQ)
154*4882a593Smuzhiyun       3 - GPIO1 is configured as a secondary ASI output (SDOUT2)
155*4882a593Smuzhiyun       4 - GPIO1 is configured as a PDM clock output (PDMCLK)
156*4882a593Smuzhiyun       8 - GPIO1 is configured as an input to control when MICBIAS turns on or
157*4882a593Smuzhiyun           off (MICBIAS_EN)
158*4882a593Smuzhiyun       9 - GPIO1 is configured as a general-purpose input (GPI)
159*4882a593Smuzhiyun       10 - GPIO1 is configured as a master clock input (MCLK)
160*4882a593Smuzhiyun       11 - GPIO1 is configured as an ASI input for daisy-chain (SDIN)
161*4882a593Smuzhiyun       12 - GPIO1 is configured as a PDM data input for channel 1 and channel 2
162*4882a593Smuzhiyun            (PDMDIN1)
163*4882a593Smuzhiyun       13 - GPIO1 is configured as a PDM data input for channel 3 and channel 4
164*4882a593Smuzhiyun            (PDMDIN2)
165*4882a593Smuzhiyun       14 - GPIO1 is configured as a PDM data input for channel 5 and channel 6
166*4882a593Smuzhiyun            (PDMDIN3)
167*4882a593Smuzhiyun       15 - GPIO1 is configured as a PDM data input for channel 7 and channel 8
168*4882a593Smuzhiyun            (PDMDIN4)
169*4882a593Smuzhiyun
170*4882a593Smuzhiyun       output drive type for the GPIO pin can be one of the following:
171*4882a593Smuzhiyun       0 - Hi-Z output
172*4882a593Smuzhiyun       1 - Drive active low and active high
173*4882a593Smuzhiyun       2 - (default) Drive active low and weak high
174*4882a593Smuzhiyun       3 - Drive active low and Hi-Z
175*4882a593Smuzhiyun       4 - Drive weak low and active high
176*4882a593Smuzhiyun       5 - Drive Hi-Z and active high
177*4882a593Smuzhiyun
178*4882a593Smuzhiyun    allOf:
179*4882a593Smuzhiyun      - $ref: /schemas/types.yaml#/definitions/uint32-array
180*4882a593Smuzhiyun      - minItems: 2
181*4882a593Smuzhiyun        maxItems: 2
182*4882a593Smuzhiyun        items:
183*4882a593Smuzhiyun          maximum: 15
184*4882a593Smuzhiyun        default: [2, 2]
185*4882a593Smuzhiyun
186*4882a593Smuzhiyunrequired:
187*4882a593Smuzhiyun  - compatible
188*4882a593Smuzhiyun  - reg
189*4882a593Smuzhiyun
190*4882a593SmuzhiyunadditionalProperties: false
191*4882a593Smuzhiyun
192*4882a593Smuzhiyunexamples:
193*4882a593Smuzhiyun  - |
194*4882a593Smuzhiyun    #include <dt-bindings/gpio/gpio.h>
195*4882a593Smuzhiyun    i2c0 {
196*4882a593Smuzhiyun      #address-cells = <1>;
197*4882a593Smuzhiyun      #size-cells = <0>;
198*4882a593Smuzhiyun      codec: codec@4c {
199*4882a593Smuzhiyun        compatible = "ti,tlv320adc5140";
200*4882a593Smuzhiyun        reg = <0x4c>;
201*4882a593Smuzhiyun        ti,mic-bias-source = <6>;
202*4882a593Smuzhiyun        ti,pdm-edge-select = <0 1 0 1>;
203*4882a593Smuzhiyun        ti,gpi-config = <4 5 6 7>;
204*4882a593Smuzhiyun        ti,gpio-config = <10 2>;
205*4882a593Smuzhiyun        ti,gpo-config-1 = <0 0>;
206*4882a593Smuzhiyun        ti,gpo-config-2 = <0 0>;
207*4882a593Smuzhiyun        reset-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
208*4882a593Smuzhiyun      };
209*4882a593Smuzhiyun    };
210