xref: /linux/Documentation/devicetree/bindings/hwmon/microchip,mcp9982.yaml (revision 46576fa32908043975471bd26fe833a7d8015b35)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/hwmon/microchip,mcp9982.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Microchip MCP998X/33 and MCP998XD/33D Temperature Monitor
8
9maintainers:
10  - Victor Duicu <victor.duicu@microchip.com>
11
12description: |
13  The MCP998X/33 and MCP998XD/33D family is a high-accuracy 2-wire
14  multichannel automotive temperature monitor.
15  The datasheet can be found here:
16    https://ww1.microchip.com/downloads/aemDocuments/documents/MSLD/ProductDocuments/DataSheets/MCP998X-Family-Data-Sheet-DS20006827.pdf
17
18properties:
19  compatible:
20    enum:
21      - microchip,mcp9933
22      - microchip,mcp9933d
23      - microchip,mcp9982
24      - microchip,mcp9982d
25      - microchip,mcp9983
26      - microchip,mcp9983d
27      - microchip,mcp9984
28      - microchip,mcp9984d
29      - microchip,mcp9985
30      - microchip,mcp9985d
31
32  reg:
33    maxItems: 1
34
35  interrupts:
36    minItems: 1
37    maxItems: 2
38
39  interrupt-names:
40    description:
41      The chip family has three different interrupt pins divided among them.
42      The chips without "D" have alert-therm and therm-addr.
43      The chips with "D" have alert-therm and sys-shtdwn.
44    minItems: 1
45    items:
46      - enum: [alert-therm, therm-addr, sys-shtdwn]
47      - enum: [therm-addr, sys-shtdwn]
48
49  "#address-cells":
50    const: 1
51
52  "#size-cells":
53    const: 0
54
55  microchip,enable-anti-parallel:
56    description:
57      Enable anti-parallel diode mode operation.
58      MCP9984/84D/85/85D and MCP9933/33D support reading two external diodes
59      in anti-parallel connection on the same set of pins.
60    type: boolean
61
62  microchip,parasitic-res-on-channel1-2:
63    description:
64      Indicates that the chip and the diodes/transistors are sufficiently far
65      apart that a parasitic resistance is added to the wires, which can affect
66      the measurements. Due to the anti-parallel diode connections, channels
67      1 and 2 are affected together.
68    type: boolean
69
70  microchip,parasitic-res-on-channel3-4:
71    description:
72      Indicates that the chip and the diodes/transistors are sufficiently far
73      apart that a parasitic resistance is added to the wires, which can affect
74      the measurements. Due to the anti-parallel diode connections, channels
75      3 and 4 are affected together.
76    type: boolean
77
78  microchip,power-state:
79    description:
80      The chip can be set in Run state or Standby state. In Run state the ADC
81      is converting on all channels at the programmed conversion rate.
82      In Standby state the host must initiate a conversion cycle by writing
83      to the One-Shot register.
84      True value sets Run state.
85      Chips with "D" in the name can only be set in Run mode.
86    type: boolean
87
88  vdd-supply: true
89
90patternProperties:
91  "^channel@[1-4]$":
92    description:
93      Represents the external temperature channels to which
94      a remote diode is connected.
95    type: object
96
97    properties:
98      reg:
99        items:
100          maxItems: 1
101
102      label:
103        description: Unique name to identify which channel this is.
104
105    required:
106      - reg
107
108    additionalProperties: false
109
110required:
111  - compatible
112  - reg
113  - vdd-supply
114
115allOf:
116  - if:
117      properties:
118        compatible:
119          contains:
120            enum:
121              - microchip,mcp9982d
122              - microchip,mcp9983d
123              - microchip,mcp9984d
124              - microchip,mcp9985d
125              - microchip,mcp9933d
126    then:
127      properties:
128        interrupt-names:
129          items:
130            enum:
131              - alert-therm
132              - sys-shtdwn
133      required:
134        - microchip,power-state
135        - microchip,parasitic-res-on-channel1-2
136    else:
137      properties:
138        microchip,power-state: true
139        interrupt-names:
140          items:
141            enum:
142              - alert-therm
143              - therm-addr
144
145  - if:
146      properties:
147        compatible:
148          contains:
149            enum:
150              - microchip,mcp9983d
151              - microchip,mcp9984d
152              - microchip,mcp9985d
153    then:
154      required:
155        - microchip,parasitic-res-on-channel3-4
156
157  - if:
158      properties:
159        compatible:
160          contains:
161            enum:
162              - microchip,mcp9982
163              - microchip,mcp9982d
164    then:
165      properties:
166        microchip,enable-anti-parallel: false
167      patternProperties:
168        "^channel@[2-4]$": false
169
170  - if:
171      properties:
172        compatible:
173          contains:
174            enum:
175              - microchip,mcp9983
176              - microchip,mcp9983d
177    then:
178      properties:
179        microchip,enable-anti-parallel: false
180      patternProperties:
181        "^channel@[3-4]$": false
182
183  - if:
184      properties:
185        compatible:
186          contains:
187            enum:
188              - microchip,mcp9933
189              - microchip,mcp9933d
190    then:
191      patternProperties:
192        "^channel@[3-4]$": false
193
194  - if:
195      properties:
196        compatible:
197          contains:
198            enum:
199              - microchip,mcp9984
200              - microchip,mcp9984d
201    then:
202      properties:
203        channel@4: false
204
205additionalProperties: false
206
207examples:
208  - |
209    i2c {
210        #address-cells = <1>;
211        #size-cells = <0>;
212
213        temperature-sensor@4c {
214            compatible = "microchip,mcp9985";
215            reg = <0x4c>;
216
217            #address-cells = <1>;
218            #size-cells = <0>;
219
220            microchip,enable-anti-parallel;
221            microchip,parasitic-res-on-channel1-2;
222            microchip,parasitic-res-on-channel3-4;
223            vdd-supply = <&vdd>;
224
225            channel@1 {
226                reg = <1>;
227                label = "Room Temperature";
228            };
229
230            channel@2 {
231                reg = <2>;
232                label = "GPU Temperature";
233            };
234        };
235    };
236
237...
238