1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/adc/ti,ads1015.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: TI ADS1015 4 channel I2C analog to digital converter
8
9maintainers:
10  - Daniel Baluta <daniel.baluta@nxp.com>
11
12description: |
13  Datasheet at: https://www.ti.com/lit/gpn/ads1015
14  Supports both single ended and differential channels.
15
16properties:
17  compatible:
18    const: ti,ads1015
19
20  reg:
21    maxItems: 1
22
23  "#address-cells":
24    const: 1
25
26  "#size-cells":
27    const: 0
28
29  "#io-channel-cells":
30    const: 1
31
32required:
33  - compatible
34  - reg
35  - "#address-cells"
36  - "#size-cells"
37
38additionalProperties: false
39
40patternProperties:
41  "^channel@[0-7]+$":
42    type: object
43    description:
44      Child nodes needed for each channel that the platform uses.
45
46    properties:
47      reg:
48        description: |
49          0: Voltage over AIN0 and AIN1.
50          1: Voltage over AIN0 and AIN3.
51          2: Voltage over AIN1 and AIN3.
52          3: Voltage over AIN2 and AIN3.
53          4: Voltage over AIN0 and GND.
54          5: Voltage over AIN1 and GND.
55          6: Voltage over AIN2 and GND.
56          7: Voltage over AIN3 and GND.
57        items:
58          - minimum: 0
59            maximum: 7
60
61      ti,gain:
62        $ref: /schemas/types.yaml#/definitions/uint32
63        minimum: 0
64        maximum: 5
65        description: |
66          pga is the programmable gain amplifier (values are full scale)
67          0: +/- 6.144 V
68          1: +/- 4.096 V
69          2: +/- 2.048 V (default)
70          3: +/- 1.024 V
71          4: +/- 0.512 V
72          5: +/- 0.256 V
73
74      ti,datarate:
75        $ref: /schemas/types.yaml#/definitions/uint32
76        minimum: 0
77        maximum: 6
78        description: |
79          Data acquisition rate in samples per second
80          0: 128
81          1: 250
82          2: 490
83          3: 920
84          4: 1600 (default)
85          5: 2400
86          6: 3300
87
88    required:
89      - reg
90
91examples:
92  - |
93    i2c {
94        #address-cells = <1>;
95        #size-cells = <0>;
96
97        adc@49 {
98            compatible = "ti,ads1015";
99            reg = <0x49>;
100            #address-cells = <1>;
101            #size-cells = <0>;
102            channel@0 {
103              reg = <0>;
104            };
105            channel@4 {
106              reg = <4>;
107              ti,gain = <3>;
108              ti,datarate = <5>;
109            };
110        };
111    };
112...
113