Merge tag 'for-5.12-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / mfd / gateworks-gsc.yaml
1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/mfd/gateworks-gsc.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Gateworks System Controller
8
9 description: |
10   The Gateworks System Controller (GSC) is a device present across various
11   Gateworks product families that provides a set of system related features
12   such as the following (refer to the board hardware user manuals to see what
13   features are present)
14    - Watchdog Timer
15    - GPIO
16    - Pushbutton controller
17    - Hardware monitor with ADC's for temperature and voltage rails and
18      fan controller
19
20 maintainers:
21   - Tim Harvey <tharvey@gateworks.com>
22   - Robert Jones <rjones@gateworks.com>
23
24 properties:
25   $nodename:
26     pattern: "gsc@[0-9a-f]{1,2}"
27   compatible:
28     const: gw,gsc
29
30   reg:
31     description: I2C device address
32     maxItems: 1
33
34   interrupts:
35     maxItems: 1
36
37   interrupt-controller: true
38
39   "#interrupt-cells":
40     const: 1
41
42   "#address-cells":
43     const: 1
44
45   "#size-cells":
46     const: 0
47
48   adc:
49     type: object
50     description: Optional hardware monitoring module
51
52     properties:
53       compatible:
54         const: gw,gsc-adc
55
56       "#address-cells":
57         const: 1
58
59       "#size-cells":
60         const: 0
61
62     patternProperties:
63       "^channel@[0-9]+$":
64         type: object
65         description: |
66           Properties for a single ADC which can report cooked values
67           (i.e. temperature sensor based on thermister), raw values
68           (i.e. voltage rail with a pre-scaling resistor divider).
69
70         properties:
71           reg:
72             description: Register of the ADC
73             maxItems: 1
74
75           label:
76             description: Name of the ADC input
77
78           gw,mode:
79             description: |
80               conversion mode:
81                 0 - temperature, in C*10
82                 1 - pre-scaled 24-bit voltage value
83                 2 - scaled voltage based on an optional resistor divider
84                     and optional offset
85                 3 - pre-scaled 16-bit voltage value
86                 4 - fan tach input to report RPM's
87             $ref: /schemas/types.yaml#/definitions/uint32
88             enum: [0, 1, 2, 3, 4]
89
90           gw,voltage-divider-ohms:
91             description: Values of resistors for divider on raw ADC input
92             maxItems: 2
93             items:
94               minimum: 1000
95               maximum: 1000000
96
97           gw,voltage-offset-microvolt:
98             description: |
99               A positive voltage offset to apply to a raw ADC
100               (i.e. to compensate for a diode drop).
101             minimum: 0
102             maximum: 1000000
103
104         required:
105           - gw,mode
106           - reg
107           - label
108
109     required:
110       - compatible
111       - "#address-cells"
112       - "#size-cells"
113
114 patternProperties:
115   "^fan-controller@[0-9a-f]+$":
116     type: object
117     description: Optional fan controller
118
119     properties:
120       compatible:
121         const: gw,gsc-fan
122
123       "#address-cells":
124         const: 1
125
126       "#size-cells":
127         const: 0
128
129       reg:
130         description: The fan controller base address
131         maxItems: 1
132
133     required:
134       - compatible
135       - reg
136       - "#address-cells"
137       - "#size-cells"
138
139 required:
140   - compatible
141   - reg
142   - interrupts
143   - interrupt-controller
144   - "#interrupt-cells"
145   - "#address-cells"
146   - "#size-cells"
147
148 additionalProperties: false
149
150 examples:
151   - |
152     #include <dt-bindings/gpio/gpio.h>
153     #include <dt-bindings/interrupt-controller/irq.h>
154     i2c {
155         #address-cells = <1>;
156         #size-cells = <0>;
157
158         gsc@20 {
159             compatible = "gw,gsc";
160             reg = <0x20>;
161             interrupt-parent = <&gpio1>;
162             interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
163             interrupt-controller;
164             #interrupt-cells = <1>;
165             #address-cells = <1>;
166             #size-cells = <0>;
167
168             adc {
169                 compatible = "gw,gsc-adc";
170                 #address-cells = <1>;
171                 #size-cells = <0>;
172
173                 channel@0 { /* A0: Board Temperature */
174                     reg = <0x00>;
175                     label = "temp";
176                     gw,mode = <0>;
177                 };
178
179                 channel@2 { /* A1: Input Voltage (raw ADC) */
180                     reg = <0x02>;
181                     label = "vdd_vin";
182                     gw,mode = <1>;
183                     gw,voltage-divider-ohms = <22100 1000>;
184                     gw,voltage-offset-microvolt = <800000>;
185                 };
186
187                 channel@b { /* A2: Battery voltage */
188                     reg = <0x0b>;
189                     label = "vdd_bat";
190                     gw,mode = <1>;
191                 };
192             };
193
194             fan-controller@2c {
195                 #address-cells = <1>;
196                 #size-cells = <0>;
197                 compatible = "gw,gsc-fan";
198                 reg = <0x2c>;
199             };
200         };
201     };