1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2023, Linaro Limited
5 */
6
7#include <dt-bindings/input/input.h>
8#include <dt-bindings/interrupt-controller/irq.h>
9#include <dt-bindings/spmi/spmi.h>
10#include <dt-bindings/iio/qcom,spmi-vadc.h>
11
12/ {
13	thermal-zones {
14		pmc8180-thermal {
15			polling-delay-passive = <100>;
16			polling-delay = <0>;
17
18			thermal-sensors = <&pmc8180_temp>;
19
20			trips {
21				trip0 {
22					temperature = <95000>;
23					hysteresis = <0>;
24					type = "passive";
25				};
26
27				trip1 {
28					temperature = <115000>;
29					hysteresis = <0>;
30					type = "hot";
31				};
32
33				trip2 {
34					temperature = <145000>;
35					hysteresis = <0>;
36					type = "critical";
37				};
38			};
39		};
40
41		pmc8180c-thermal {
42			polling-delay-passive = <100>;
43			polling-delay = <0>;
44
45			thermal-sensors = <&pmc8180c_temp>;
46
47			trips {
48				trip0 {
49					temperature = <95000>;
50					hysteresis = <0>;
51					type = "passive";
52				};
53
54				trip1 {
55					temperature = <115000>;
56					hysteresis = <0>;
57					type = "hot";
58				};
59
60				trip2 {
61					temperature = <145000>;
62					hysteresis = <0>;
63					type = "critical";
64				};
65			};
66		};
67	};
68};
69
70&spmi_bus {
71	pmc8180_0: pmic@0 {
72		compatible = "qcom,pm8150", "qcom,spmi-pmic";
73		reg = <0x0 SPMI_USID>;
74		#address-cells = <1>;
75		#size-cells = <0>;
76
77		pon: power-on@800 {
78			compatible = "qcom,pm8916-pon";
79			reg = <0x0800>;
80			pwrkey {
81				compatible = "qcom,pm8941-pwrkey";
82				interrupts = <0x0 0x8 0x0 IRQ_TYPE_EDGE_BOTH>;
83				debounce = <15625>;
84				bias-pull-up;
85				linux,code = <KEY_POWER>;
86
87				status = "disabled";
88			};
89		};
90
91		pmc8180_temp: temp-alarm@2400 {
92			compatible = "qcom,spmi-temp-alarm";
93			reg = <0x2400>;
94			interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
95			io-channels = <&pmc8180_adc ADC5_DIE_TEMP>;
96			io-channel-names = "thermal";
97			#thermal-sensor-cells = <0>;
98		};
99
100		pmc8180_adc: adc@3100 {
101			compatible = "qcom,spmi-adc5";
102			reg = <0x3100>;
103			#address-cells = <1>;
104			#size-cells = <0>;
105			#io-channel-cells = <1>;
106			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
107
108			ref-gnd@0 {
109				reg = <ADC5_REF_GND>;
110				qcom,pre-scaling = <1 1>;
111				label = "ref_gnd";
112			};
113
114			vref-1p25@1 {
115				reg = <ADC5_1P25VREF>;
116				qcom,pre-scaling = <1 1>;
117				label = "vref_1p25";
118			};
119
120			die-temp@6 {
121				reg = <ADC5_DIE_TEMP>;
122				qcom,pre-scaling = <1 1>;
123				label = "die_temp";
124			};
125		};
126
127		pmc8180_adc_tm: adc-tm@3500 {
128			compatible = "qcom,spmi-adc-tm5";
129			reg = <0x3500>;
130			interrupts = <0x0 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
131			#thermal-sensor-cells = <1>;
132			#address-cells = <1>;
133			#size-cells = <0>;
134			status = "disabled";
135		};
136
137		rtc@6000 {
138			compatible = "qcom,pm8941-rtc";
139			reg = <0x6000>;
140			reg-names = "rtc", "alarm";
141			interrupts = <0x0 0x61 0x1 IRQ_TYPE_NONE>;
142		};
143
144		pmc8180_gpios: gpio@c000 {
145			compatible = "qcom,pmc8180-gpio";
146			reg = <0xc000>;
147			gpio-controller;
148			#gpio-cells = <2>;
149			interrupt-controller;
150			#interrupt-cells = <2>;
151		};
152	};
153
154	pmic@1 {
155		compatible = "qcom,pmc8180", "qcom,spmi-pmic";
156		reg = <0x1 SPMI_USID>;
157		#address-cells = <1>;
158		#size-cells = <0>;
159	};
160
161	pmic@2 {
162		compatible = "qcom,smb2351", "qcom,spmi-pmic";
163		reg = <0x2 SPMI_USID>;
164		#address-cells = <1>;
165		#size-cells = <0>;
166
167		adc@3100 {
168			compatible = "qcom,spmi-adc-rev2";
169			reg = <0x3100>;
170			#address-cells = <1>;
171			#size-cells = <0>;
172			#io-channel-cells = <1>;
173			interrupts = <0x2 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
174
175			ref-gnd@0 {
176				reg = <ADC5_REF_GND>;
177				qcom,pre-scaling = <1 1>;
178				label = "ref_gnd";
179			};
180
181			vref-1p25@1 {
182				reg = <ADC5_1P25VREF>;
183				qcom,pre-scaling = <1 1>;
184				label = "vref_1p25";
185			};
186
187			vcoin@85 {
188				reg = <0x85>;
189				qcom,pre-scaling = <1 1>;
190				label = "vcoin2";
191			};
192		};
193	};
194
195	pmic@6 {
196		compatible = "qcom,pm8150c", "qcom,spmi-pmic";
197		reg = <0x6 SPMI_USID>;
198		#address-cells = <1>;
199		#size-cells = <0>;
200	};
201
202	pmic@8 {
203		compatible = "qcom,pm8150", "qcom,spmi-pmic";
204		reg = <0x8 SPMI_USID>;
205		#address-cells = <1>;
206		#size-cells = <0>;
207	};
208
209	pmic@a {
210		compatible = "qcom,smb2351", "qcom,spmi-pmic";
211		reg = <0xa SPMI_USID>;
212		#address-cells = <1>;
213		#size-cells = <0>;
214
215		adc@3100 {
216			compatible = "qcom,spmi-adc-rev2";
217			reg = <0x3100>;
218			#address-cells = <1>;
219			#size-cells = <0>;
220			#io-channel-cells = <1>;
221			interrupts = <0xa 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
222
223			ref-gnd@0 {
224				reg = <ADC5_REF_GND>;
225				qcom,pre-scaling = <1 1>;
226				label = "ref_gnd";
227			};
228
229			vref-1p25@1 {
230				reg = <ADC5_1P25VREF>;
231				qcom,pre-scaling = <1 1>;
232				label = "vref_1p25";
233			};
234
235			vcoin@85 {
236				reg = <0x85>;
237				qcom,pre-scaling = <1 1>;
238				label = "vcoin";
239			};
240		};
241	};
242
243	pmic@4 {
244		compatible = "qcom,pm8150c", "qcom,spmi-pmic";
245		reg = <0x4 SPMI_USID>;
246		#address-cells = <1>;
247		#size-cells = <0>;
248
249		power-on@800 {
250			compatible = "qcom,pm8916-pon";
251			reg = <0x0800>;
252
253			status = "disabled";
254		};
255
256		pmc8180c_temp: temp-alarm@2400 {
257			compatible = "qcom,spmi-temp-alarm";
258			reg = <0x2400>;
259			interrupts = <0x4 0x24 0x0 IRQ_TYPE_EDGE_BOTH>;
260			io-channels = <&pmc8180c_adc ADC5_DIE_TEMP>;
261			io-channel-names = "thermal";
262			#thermal-sensor-cells = <0>;
263		};
264
265		pmc8180c_adc: adc@3100 {
266			compatible = "qcom,spmi-adc5";
267			reg = <0x3100>;
268			#address-cells = <1>;
269			#size-cells = <0>;
270			#io-channel-cells = <1>;
271			interrupts = <0x4 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
272
273			ref-gnd@0 {
274				reg = <ADC5_REF_GND>;
275				qcom,pre-scaling = <1 1>;
276				label = "ref_gnd";
277			};
278
279			vref-1p25@1 {
280				reg = <ADC5_1P25VREF>;
281				qcom,pre-scaling = <1 1>;
282				label = "vref_1p25";
283			};
284
285			die-temp@6 {
286				reg = <ADC5_DIE_TEMP>;
287				qcom,pre-scaling = <1 1>;
288				label = "die_temp";
289			};
290		};
291
292		pmc8180c_adc_tm: adc-tm@3500 {
293			compatible = "qcom,spmi-adc-tm5";
294			reg = <0x3500>;
295			interrupts = <0x4 0x35 0x0 IRQ_TYPE_EDGE_RISING>;
296			#thermal-sensor-cells = <1>;
297			#address-cells = <1>;
298			#size-cells = <0>;
299			status = "disabled";
300		};
301
302		pmc8180c_gpios: gpio@c000 {
303			compatible = "qcom,pmc8180c-gpio";
304			reg = <0xc000>;
305			gpio-controller;
306			#gpio-cells = <2>;
307			interrupt-controller;
308			#interrupt-cells = <2>;
309		};
310	};
311
312	pmic@5 {
313		compatible = "qcom,pmc8180c", "qcom,spmi-pmic";
314		reg = <0x5 SPMI_USID>;
315
316		pmc8180c_lpg: lpg {
317			compatible = "qcom,pmc8180c-lpg";
318
319			#address-cells = <1>;
320			#size-cells = <0>;
321			#pwm-cells = <2>;
322
323			status = "disabled";
324		};
325	};
326};
327