xref: /freebsd-src/sys/contrib/device-tree/Bindings/iio/adc/microchip,mcp3564.yaml (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
1*84943d6fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*84943d6fSEmmanuel Vadot%YAML 1.2
3*84943d6fSEmmanuel Vadot---
4*84943d6fSEmmanuel Vadot$id: http://devicetree.org/schemas/iio/adc/microchip,mcp3564.yaml#
5*84943d6fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*84943d6fSEmmanuel Vadot
7*84943d6fSEmmanuel Vadottitle: Microchip MCP346X and MCP356X ADC Family
8*84943d6fSEmmanuel Vadot
9*84943d6fSEmmanuel Vadotmaintainers:
10*84943d6fSEmmanuel Vadot  - Marius Cristea <marius.cristea@microchip.com>
11*84943d6fSEmmanuel Vadot
12*84943d6fSEmmanuel Vadotdescription: |
13*84943d6fSEmmanuel Vadot  Bindings for the Microchip family of 153.6 ksps, Low-Noise 16/24-Bit
14*84943d6fSEmmanuel Vadot  Delta-Sigma ADCs with an SPI interface. Datasheet can be found here:
15*84943d6fSEmmanuel Vadot  Datasheet for MCP3561, MCP3562, MCP3564 can be found here:
16*84943d6fSEmmanuel Vadot    https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP3561-2-4-Family-Data-Sheet-DS20006181C.pdf
17*84943d6fSEmmanuel Vadot  Datasheet for MCP3561R, MCP3562R, MCP3564R can be found here:
18*84943d6fSEmmanuel Vadot    https://ww1.microchip.com/downloads/aemDocuments/documents/APID/ProductDocuments/DataSheets/MCP3561_2_4R-Data-Sheet-DS200006391C.pdf
19*84943d6fSEmmanuel Vadot  Datasheet for MCP3461, MCP3462, MCP3464 can be found here:
20*84943d6fSEmmanuel Vadot    https://ww1.microchip.com/downloads/aemDocuments/documents/APID/ProductDocuments/DataSheets/MCP3461-2-4-Two-Four-Eight-Channel-153.6-ksps-Low-Noise-16-Bit-Delta-Sigma-ADC-Data-Sheet-20006180D.pdf
21*84943d6fSEmmanuel Vadot  Datasheet for MCP3461R, MCP3462R, MCP3464R can be found here:
22*84943d6fSEmmanuel Vadot    https://ww1.microchip.com/downloads/aemDocuments/documents/APID/ProductDocuments/DataSheets/MCP3461-2-4R-Family-Data-Sheet-DS20006404C.pdf
23*84943d6fSEmmanuel Vadot
24*84943d6fSEmmanuel Vadotproperties:
25*84943d6fSEmmanuel Vadot  compatible:
26*84943d6fSEmmanuel Vadot    enum:
27*84943d6fSEmmanuel Vadot      - microchip,mcp3461
28*84943d6fSEmmanuel Vadot      - microchip,mcp3462
29*84943d6fSEmmanuel Vadot      - microchip,mcp3464
30*84943d6fSEmmanuel Vadot      - microchip,mcp3461r
31*84943d6fSEmmanuel Vadot      - microchip,mcp3462r
32*84943d6fSEmmanuel Vadot      - microchip,mcp3464r
33*84943d6fSEmmanuel Vadot      - microchip,mcp3561
34*84943d6fSEmmanuel Vadot      - microchip,mcp3562
35*84943d6fSEmmanuel Vadot      - microchip,mcp3564
36*84943d6fSEmmanuel Vadot      - microchip,mcp3561r
37*84943d6fSEmmanuel Vadot      - microchip,mcp3562r
38*84943d6fSEmmanuel Vadot      - microchip,mcp3564r
39*84943d6fSEmmanuel Vadot
40*84943d6fSEmmanuel Vadot  reg:
41*84943d6fSEmmanuel Vadot    maxItems: 1
42*84943d6fSEmmanuel Vadot
43*84943d6fSEmmanuel Vadot  spi-max-frequency:
44*84943d6fSEmmanuel Vadot    maximum: 20000000
45*84943d6fSEmmanuel Vadot
46*84943d6fSEmmanuel Vadot  spi-cpha: true
47*84943d6fSEmmanuel Vadot
48*84943d6fSEmmanuel Vadot  spi-cpol: true
49*84943d6fSEmmanuel Vadot
50*84943d6fSEmmanuel Vadot  vdd-supply: true
51*84943d6fSEmmanuel Vadot
52*84943d6fSEmmanuel Vadot  avdd-supply: true
53*84943d6fSEmmanuel Vadot
54*84943d6fSEmmanuel Vadot  clocks:
55*84943d6fSEmmanuel Vadot    description:
56*84943d6fSEmmanuel Vadot      Phandle and clock identifier for external sampling clock.
57*84943d6fSEmmanuel Vadot      If not specified, the internal crystal oscillator will be used.
58*84943d6fSEmmanuel Vadot    maxItems: 1
59*84943d6fSEmmanuel Vadot
60*84943d6fSEmmanuel Vadot  interrupts:
61*84943d6fSEmmanuel Vadot    description: IRQ line of the ADC
62*84943d6fSEmmanuel Vadot    maxItems: 1
63*84943d6fSEmmanuel Vadot
64*84943d6fSEmmanuel Vadot  drive-open-drain:
65*84943d6fSEmmanuel Vadot    description:
66*84943d6fSEmmanuel Vadot      Whether to drive the IRQ signal as push-pull (default) or open-drain. Note
67*84943d6fSEmmanuel Vadot      that the device requires this pin to become "high", otherwise it will stop
68*84943d6fSEmmanuel Vadot      converting.
69*84943d6fSEmmanuel Vadot    type: boolean
70*84943d6fSEmmanuel Vadot
71*84943d6fSEmmanuel Vadot  vref-supply:
72*84943d6fSEmmanuel Vadot    description:
73*84943d6fSEmmanuel Vadot      Some devices have a specific reference voltage supplied on a different
74*84943d6fSEmmanuel Vadot      pin to the other supplies. Needed to be able to establish channel scaling
75*84943d6fSEmmanuel Vadot      unless there is also an internal reference available (e.g. mcp3564r). In
76*84943d6fSEmmanuel Vadot      case of "r" devices (e. g. mcp3564r), if it does not exists the internal
77*84943d6fSEmmanuel Vadot      reference will be used.
78*84943d6fSEmmanuel Vadot
79*84943d6fSEmmanuel Vadot  microchip,hw-device-address:
80*84943d6fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
81*84943d6fSEmmanuel Vadot    minimum: 0
82*84943d6fSEmmanuel Vadot    maximum: 3
83*84943d6fSEmmanuel Vadot    description:
84*84943d6fSEmmanuel Vadot      The address is set on a per-device basis by fuses in the factory,
85*84943d6fSEmmanuel Vadot      configured on request. If not requested, the fuses are set for 0x1.
86*84943d6fSEmmanuel Vadot      The device address is part of the device markings to avoid
87*84943d6fSEmmanuel Vadot      potential confusion. This address is coded on two bits, so four possible
88*84943d6fSEmmanuel Vadot      addresses are available when multiple devices are present on the same
89*84943d6fSEmmanuel Vadot      SPI bus with only one Chip Select line for all devices.
90*84943d6fSEmmanuel Vadot      Each device communication starts by a CS falling edge, followed by the
91*84943d6fSEmmanuel Vadot      clocking of the device address (BITS[7:6] - top two bits of COMMAND BYTE
92*84943d6fSEmmanuel Vadot      which is first one on the wire).
93*84943d6fSEmmanuel Vadot
94*84943d6fSEmmanuel Vadot  "#io-channel-cells":
95*84943d6fSEmmanuel Vadot    const: 1
96*84943d6fSEmmanuel Vadot
97*84943d6fSEmmanuel Vadot  "#address-cells":
98*84943d6fSEmmanuel Vadot    const: 1
99*84943d6fSEmmanuel Vadot
100*84943d6fSEmmanuel Vadot  "#size-cells":
101*84943d6fSEmmanuel Vadot    const: 0
102*84943d6fSEmmanuel Vadot
103*84943d6fSEmmanuel VadotpatternProperties:
104*84943d6fSEmmanuel Vadot  "^channel@([0-9]|([1-7][0-9]))$":
105*84943d6fSEmmanuel Vadot    $ref: adc.yaml
106*84943d6fSEmmanuel Vadot    type: object
107*84943d6fSEmmanuel Vadot    unevaluatedProperties: false
108*84943d6fSEmmanuel Vadot    description: Represents the external channels which are connected to the ADC.
109*84943d6fSEmmanuel Vadot
110*84943d6fSEmmanuel Vadot    properties:
111*84943d6fSEmmanuel Vadot      reg:
112*84943d6fSEmmanuel Vadot        description: The channel number in single-ended and differential mode.
113*84943d6fSEmmanuel Vadot        minimum: 0
114*84943d6fSEmmanuel Vadot        maximum: 79
115*84943d6fSEmmanuel Vadot
116*84943d6fSEmmanuel Vadot    required:
117*84943d6fSEmmanuel Vadot      - reg
118*84943d6fSEmmanuel Vadot
119*84943d6fSEmmanuel Vadotdependencies:
120*84943d6fSEmmanuel Vadot  spi-cpol: [ spi-cpha ]
121*84943d6fSEmmanuel Vadot  spi-cpha: [ spi-cpol ]
122*84943d6fSEmmanuel Vadot
123*84943d6fSEmmanuel Vadotrequired:
124*84943d6fSEmmanuel Vadot  - compatible
125*84943d6fSEmmanuel Vadot  - reg
126*84943d6fSEmmanuel Vadot  - microchip,hw-device-address
127*84943d6fSEmmanuel Vadot  - spi-max-frequency
128*84943d6fSEmmanuel Vadot
129*84943d6fSEmmanuel VadotallOf:
130*84943d6fSEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
131*84943d6fSEmmanuel Vadot  - # External vref, no internal reference
132*84943d6fSEmmanuel Vadot    if:
133*84943d6fSEmmanuel Vadot      properties:
134*84943d6fSEmmanuel Vadot        compatible:
135*84943d6fSEmmanuel Vadot          contains:
136*84943d6fSEmmanuel Vadot            enum:
137*84943d6fSEmmanuel Vadot              - microchip,mcp3461
138*84943d6fSEmmanuel Vadot              - microchip,mcp3462
139*84943d6fSEmmanuel Vadot              - microchip,mcp3464
140*84943d6fSEmmanuel Vadot              - microchip,mcp3561
141*84943d6fSEmmanuel Vadot              - microchip,mcp3562
142*84943d6fSEmmanuel Vadot              - microchip,mcp3564
143*84943d6fSEmmanuel Vadot    then:
144*84943d6fSEmmanuel Vadot      required:
145*84943d6fSEmmanuel Vadot        - vref-supply
146*84943d6fSEmmanuel Vadot
147*84943d6fSEmmanuel VadotunevaluatedProperties: false
148*84943d6fSEmmanuel Vadot
149*84943d6fSEmmanuel Vadotexamples:
150*84943d6fSEmmanuel Vadot  - |
151*84943d6fSEmmanuel Vadot    spi {
152*84943d6fSEmmanuel Vadot        #address-cells = <1>;
153*84943d6fSEmmanuel Vadot        #size-cells = <0>;
154*84943d6fSEmmanuel Vadot
155*84943d6fSEmmanuel Vadot        adc@0 {
156*84943d6fSEmmanuel Vadot            compatible = "microchip,mcp3564r";
157*84943d6fSEmmanuel Vadot            reg = <0>;
158*84943d6fSEmmanuel Vadot            vref-supply = <&vref_reg>;
159*84943d6fSEmmanuel Vadot            spi-cpha;
160*84943d6fSEmmanuel Vadot            spi-cpol;
161*84943d6fSEmmanuel Vadot            spi-max-frequency = <10000000>;
162*84943d6fSEmmanuel Vadot            microchip,hw-device-address = <1>;
163*84943d6fSEmmanuel Vadot
164*84943d6fSEmmanuel Vadot            #address-cells = <1>;
165*84943d6fSEmmanuel Vadot            #size-cells = <0>;
166*84943d6fSEmmanuel Vadot
167*84943d6fSEmmanuel Vadot            channel@0 {
168*84943d6fSEmmanuel Vadot                /* CH0 to AGND */
169*84943d6fSEmmanuel Vadot                reg = <0>;
170*84943d6fSEmmanuel Vadot                label = "CH0";
171*84943d6fSEmmanuel Vadot            };
172*84943d6fSEmmanuel Vadot
173*84943d6fSEmmanuel Vadot            channel@1 {
174*84943d6fSEmmanuel Vadot                /* CH1 to AGND */
175*84943d6fSEmmanuel Vadot                reg = <1>;
176*84943d6fSEmmanuel Vadot                label = "CH1";
177*84943d6fSEmmanuel Vadot            };
178*84943d6fSEmmanuel Vadot
179*84943d6fSEmmanuel Vadot            /* diff-channels */
180*84943d6fSEmmanuel Vadot            channel@11 {
181*84943d6fSEmmanuel Vadot                reg = <11>;
182*84943d6fSEmmanuel Vadot
183*84943d6fSEmmanuel Vadot                /* CN0, CN1 */
184*84943d6fSEmmanuel Vadot                diff-channels = <0 1>;
185*84943d6fSEmmanuel Vadot                label = "CH0_CH1";
186*84943d6fSEmmanuel Vadot            };
187*84943d6fSEmmanuel Vadot
188*84943d6fSEmmanuel Vadot            channel@22 {
189*84943d6fSEmmanuel Vadot                reg = <0x22>;
190*84943d6fSEmmanuel Vadot
191*84943d6fSEmmanuel Vadot                /* CN1, CN2 */
192*84943d6fSEmmanuel Vadot                diff-channels = <1 2>;
193*84943d6fSEmmanuel Vadot                label = "CH1_CH3";
194*84943d6fSEmmanuel Vadot            };
195*84943d6fSEmmanuel Vadot
196*84943d6fSEmmanuel Vadot            channel@23 {
197*84943d6fSEmmanuel Vadot                reg = <0x23>;
198*84943d6fSEmmanuel Vadot
199*84943d6fSEmmanuel Vadot                /* CN1, CN3 */
200*84943d6fSEmmanuel Vadot                diff-channels = <1 3>;
201*84943d6fSEmmanuel Vadot                label = "CH1_CH3";
202*84943d6fSEmmanuel Vadot            };
203*84943d6fSEmmanuel Vadot        };
204*84943d6fSEmmanuel Vadot    };
205*84943d6fSEmmanuel Vadot...
206