xref: /linux/Documentation/devicetree/bindings/iio/adc/rohm,bd79124.yaml (revision db4a3f0fbedb0398f77b9047e8b8bb2b49f355bb)
1# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/iio/adc/rohm,bd79124.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: ROHM BD79124 ADC/GPO
8
9maintainers:
10  - Matti Vaittinen <mazziesaccount@gmail.com>
11
12description: |
13  The ROHM BD79124 is a 12-bit, 8-channel, SAR ADC. The ADC supports
14  an automatic measurement mode, with an alarm interrupt for out-of-window
15  measurements. ADC input pins can be also configured as general purpose
16  outputs.
17
18properties:
19  compatible:
20    const: rohm,bd79124
21
22  reg:
23    description:
24      I2C slave address.
25    maxItems: 1
26
27  interrupts:
28    maxItems: 1
29
30  gpio-controller: true
31
32  "#gpio-cells":
33    const: 1
34    description:
35      The pin number.
36
37  vdd-supply: true
38
39  iovdd-supply: true
40
41  "#address-cells":
42    const: 1
43
44  "#size-cells":
45    const: 0
46
47patternProperties:
48  "^channel@[0-7]+$":
49    type: object
50    $ref: /schemas/iio/adc/adc.yaml#
51    description: Represents ADC channel.
52
53    properties:
54      reg:
55        description: AIN pin number
56        minimum: 0
57        maximum: 7
58
59    required:
60      - reg
61
62    additionalProperties: false
63
64required:
65  - compatible
66  - reg
67  - iovdd-supply
68  - vdd-supply
69
70additionalProperties: false
71
72examples:
73  - |
74    #include <dt-bindings/interrupt-controller/irq.h>
75    #include <dt-bindings/leds/common.h>
76    i2c {
77        #address-cells = <1>;
78        #size-cells = <0>;
79        adc: adc@10 {
80            compatible = "rohm,bd79124";
81            reg = <0x10>;
82
83            interrupt-parent = <&gpio1>;
84            interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
85
86            vdd-supply = <&dummyreg>;
87            iovdd-supply = <&dummyreg>;
88
89            #address-cells = <1>;
90            #size-cells = <0>;
91
92            channel@0 {
93                reg = <0>;
94            };
95            channel@1 {
96                reg = <1>;
97            };
98            channel@2 {
99                reg = <2>;
100            };
101            channel@3 {
102                reg = <3>;
103            };
104            channel@4 {
105                reg = <4>;
106            };
107            channel@5 {
108                reg = <5>;
109            };
110            channel@6 {
111                reg = <6>;
112            };
113        };
114    };
115