Skip to content

Commit 19406b0

Browse files
justephjic23
authored andcommitted
dt-bindings: iio: adc: ad7380: add adaq4370-4 and adaq4380-4 compatible parts
adaq4370-4 (2MSPS) and adaq4380-4 (4MSPS) are quad-channel precision data acquisition signal chain μModule solutions compatible with the ad738x family, with the following differences: - pin selectable gain in front of each 4 adc - internal reference is 3V derived from refin-supply (5V) - additional supplies To select the gain a new patternProperties is added to describe each channel. It is restricted to adaq devices. Reviewed-by: Conor Dooley <[email protected]> Signed-off-by: Julien Stephan <[email protected]> Reviewed-by: David Lechner <[email protected]> Link: https://patch.msgid.link/20241030-ad7380-add-adaq4380-4-support-v4-1-864ff02babae@baylibre.com Signed-off-by: Jonathan Cameron <[email protected]>
1 parent e459ca0 commit 19406b0

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed

Documentation/devicetree/bindings/iio/adc/adi,ad7380.yaml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ description: |
2525
* https://www.analog.com/en/products/ad7386-4.html
2626
* https://www.analog.com/en/products/ad7387-4.html
2727
* https://www.analog.com/en/products/ad7388-4.html
28+
* https://www.analog.com/en/products/adaq4370-4.html
29+
* https://www.analog.com/en/products/adaq4380-4.html
2830
2931
3032
$ref: /schemas/spi/spi-peripheral-props.yaml#
@@ -46,6 +48,8 @@ properties:
4648
- adi,ad7386-4
4749
- adi,ad7387-4
4850
- adi,ad7388-4
51+
- adi,adaq4370-4
52+
- adi,adaq4380-4
4953

5054
reg:
5155
maxItems: 1
@@ -70,6 +74,20 @@ properties:
7074
refin-supply:
7175
description:
7276
A 2.5V to 3.3V supply for external reference voltage, for ad7380-4 only.
77+
For adaq devices, a 5V supply voltage. A 3.3V internal reference is
78+
derived from it. Connect to vs-p-supply for normal operation.
79+
80+
vs-p-supply:
81+
description:
82+
Amplifiers positive supply.
83+
84+
vs-n-supply:
85+
description:
86+
Amplifiers negative supply.
87+
88+
ldo-supply:
89+
description:
90+
LDO supply. Connect to vs-p-supply or a 3.6 to 5.5 V supply.
7391

7492
aina-supply:
7593
description:
@@ -97,12 +115,45 @@ properties:
97115
specify the ALERT interrupt.
98116
maxItems: 1
99117

118+
"#address-cells":
119+
const: 1
120+
121+
"#size-cells":
122+
const: 0
123+
100124
required:
101125
- compatible
102126
- reg
103127
- vcc-supply
104128
- vlogic-supply
105129

130+
patternProperties:
131+
"^channel@[0-3]$":
132+
$ref: adc.yaml
133+
type: object
134+
135+
properties:
136+
reg:
137+
description:
138+
The channel number. From 0 to 3 corresponding to channels A,B,C,D
139+
minimum: 0
140+
maximum: 3
141+
142+
adi,gain-milli:
143+
description:
144+
The hardware gain applied to the ADC input (in milli units).
145+
If not present, default to 1000 (no actual gain applied).
146+
Refer to the typical connection diagrams section of the datasheet for
147+
pin wiring.
148+
$ref: /schemas/types.yaml#/definitions/uint16
149+
enum: [300, 600, 1000, 1600]
150+
default: 1000
151+
152+
required:
153+
- reg
154+
155+
additionalProperties: false
156+
106157
unevaluatedProperties: false
107158

108159
allOf:
@@ -140,13 +191,16 @@ allOf:
140191
aind-supply: false
141192

142193
# ad7380-4 uses refin-supply as external reference.
194+
# adaq devices use internal reference only, derived from refin-supply
143195
# All other chips from ad738x family use refio as optional external reference.
144196
# When refio-supply is omitted, internal reference is used.
145197
- if:
146198
properties:
147199
compatible:
148200
enum:
149201
- adi,ad7380-4
202+
- adi,adaq4370-4
203+
- adi,adaq4380-4
150204
then:
151205
properties:
152206
refio-supply: false
@@ -156,6 +210,27 @@ allOf:
156210
properties:
157211
refin-supply: false
158212

213+
# adaq devices need more supplies and using channel to declare gain property
214+
# only applies to adaq devices
215+
- if:
216+
properties:
217+
compatible:
218+
enum:
219+
- adi,adaq4370-4
220+
- adi,adaq4380-4
221+
then:
222+
required:
223+
- vs-p-supply
224+
- vs-n-supply
225+
- ldo-supply
226+
else:
227+
properties:
228+
vs-p-supply: false
229+
vs-n-supply: false
230+
ldo-supply: false
231+
patternProperties:
232+
"^channel@[0-3]$": false
233+
159234
examples:
160235
- |
161236
#include <dt-bindings/interrupt-controller/irq.h>
@@ -180,3 +255,48 @@ examples:
180255
refio-supply = <&supply_2_5V>;
181256
};
182257
};
258+
259+
- |
260+
#include <dt-bindings/interrupt-controller/irq.h>
261+
262+
spi {
263+
#address-cells = <1>;
264+
#size-cells = <0>;
265+
266+
adc@0 {
267+
compatible = "adi,adaq4380-4";
268+
reg = <0>;
269+
270+
spi-cpol;
271+
spi-cpha;
272+
spi-max-frequency = <80000000>;
273+
274+
interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
275+
interrupt-parent = <&gpio0>;
276+
277+
vcc-supply = <&supply_3_3V>;
278+
vlogic-supply = <&supply_3_3V>;
279+
refin-supply = <&supply_5V>;
280+
vs-p-supply = <&supply_5V>;
281+
vs-n-supply = <&supply_0V>;
282+
ldo-supply = <&supply_5V>;
283+
284+
#address-cells = <1>;
285+
#size-cells = <0>;
286+
287+
channel@0 {
288+
reg = <0>;
289+
adi,gain-milli = /bits/ 16 <300>;
290+
};
291+
292+
channel@2 {
293+
reg = <2>;
294+
adi,gain-milli = /bits/ 16 <600>;
295+
};
296+
297+
channel@3 {
298+
reg = <3>;
299+
adi,gain-milli = /bits/ 16 <1000>;
300+
};
301+
};
302+
};

0 commit comments

Comments
 (0)