Skip to content

Commit 0a83934

Browse files
committed
dt-bindings: iio: dac: Add MAX22007 DAC bindings
Add device tree bindings header for the MAX22007 4-channel 12-bit DAC. Defines constants for channel modes and other configuration options. Signed-off-by: Janani Sunil <[email protected]>
1 parent 36dbe4c commit 0a83934

File tree

2 files changed

+141
-0
lines changed

2 files changed

+141
-0
lines changed
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/iio/dac/adi,max22007.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Analog Devices MAX22007 DAC device driver
8+
9+
maintainers:
10+
- Janani Sunil <[email protected]>
11+
12+
description: |
13+
The MAX22007 is a quad-channel, 12-bit digital-to-analog converter (DAC)
14+
with integrated precision output amplifiers and current output capability.
15+
Each channel can be independently configured for voltage or current output.
16+
The driver supports runtime LDAC (Latch DAC) control via per-channel sysfs
17+
attributes for precise output timing control.
18+
Datasheet available at:
19+
https://www.analog.com/en/products/max22007.html
20+
21+
properties:
22+
compatible:
23+
const: adi,max22007
24+
25+
reg:
26+
maxItems: 1
27+
28+
spi-max-frequency:
29+
maximum: 500000
30+
description: Maximum SPI clock frequency in Hz.
31+
32+
'#address-cells':
33+
const: 1
34+
35+
'#size-cells':
36+
const: 0
37+
38+
vdd-supply:
39+
description: Low-Voltage Power Supply from +2.7V to +5.5V.
40+
41+
hvdd-supply:
42+
description: |
43+
Positive High-Voltage Power Supply from +8V to (HVSS +24V) for
44+
the Output Channels.
45+
46+
hvss-supply:
47+
description: |
48+
Negative High-Voltage Power Supply from -2V to 0V for the Output Channels.
49+
50+
adi,crc-enable:
51+
type: boolean
52+
description: |
53+
Enable CRC8 error checking for SPI communications. When enabled, all SPI
54+
transactions include a CRC8 byte for data integrity verification.
55+
56+
patternProperties:
57+
"^channel@[0-3]$":
58+
type: object
59+
description: |
60+
Represents the external channels which are connected to the DAC.
61+
Channels not specified in the device tree will be powered off.
62+
properties:
63+
reg:
64+
description: |
65+
This represents the channel number.
66+
maximum: 3
67+
68+
adi,dac-latch-mode:
69+
description: |
70+
DAC latch control mode for the channel.
71+
0 = LD_CTRL Bit in the control register or LDAC Pin controls the update (default)
72+
1 = Transparent latch mode (immediate update)
73+
$ref: /schemas/types.yaml#/definitions/uint32
74+
enum: [0, 1]
75+
76+
adi,mode:
77+
description: |
78+
Output mode for the channel.
79+
0 = Voltage output mode (default)
80+
1 = Current output mode
81+
$ref: /schemas/types.yaml#/definitions/uint32
82+
enum: [0, 1]
83+
84+
required:
85+
- reg
86+
87+
additionalProperties: false
88+
89+
required:
90+
- compatible
91+
- reg
92+
93+
anyOf:
94+
- required: [channel@0]
95+
- required: [channel@1]
96+
- required: [channel@2]
97+
- required: [channel@3]
98+
99+
allOf:
100+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
101+
102+
unevaluatedProperties: false
103+
104+
examples:
105+
- |
106+
#include <dt-bindings/iio/dac/adi,max22007.h>
107+
spi {
108+
#address-cells = <1>;
109+
#size-cells = <0>;
110+
111+
dac@0 {
112+
compatible = "adi,max22007";
113+
reg = <0>;
114+
spi-max-frequency = <500000>;
115+
adi,crc-enable;
116+
#address-cells = <1>;
117+
#size-cells = <0>;
118+
119+
channel@0 {
120+
reg = <0>;
121+
adi,mode = <0>;
122+
adi,dac-latch-mode = <MAX22007_LDAC_CONTROL>;
123+
};
124+
125+
channel@1 {
126+
reg = <1>;
127+
adi,mode = <0>;
128+
adi,dac-latch-mode = <MAX22007_TRANSPARENT_LATCH>;
129+
};
130+
};
131+
};
132+
...
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2+
3+
#ifndef _DT_BINDINGS_ADI_MAX22007_H
4+
#define _DT_BINDINGS_ADI_MAX22007_H
5+
6+
#define MAX22007_LDAC_CONTROL 0
7+
#define MAX22007_TRANSPARENT_LATCH 1
8+
9+
#endif /* _DT_BINDINGS_ADI_MAX22007_H */

0 commit comments

Comments
 (0)