xref: /linux/arch/arm64/boot/dts/qcom/pm660.dtsi (revision 0354ab18ef5ef11f3139c7252f573c5d4af87c60)
1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2020, Konrad Dybcio
4 */
5
6#include <dt-bindings/iio/qcom,spmi-vadc.h>
7#include <dt-bindings/input/linux-event-codes.h>
8#include <dt-bindings/interrupt-controller/irq.h>
9#include <dt-bindings/spmi/spmi.h>
10#include <dt-bindings/thermal/thermal.h>
11
12/ {
13	thermal-zones {
14		pm660-thermal {
15			polling-delay-passive = <250>;
16			polling-delay = <1000>;
17
18			thermal-sensors = <&pm660_temp>;
19
20			trips {
21				pm660_alert0: pm660-alert0 {
22					temperature = <95000>;
23					hysteresis = <2000>;
24					type = "passive";
25				};
26				pm660_crit: pm660-crit {
27					temperature = <125000>;
28					hysteresis = <2000>;
29					type = "critical";
30				};
31			};
32		};
33	};
34};
35
36&spmi_bus {
37
38	pmic@0 {
39		compatible = "qcom,pm660", "qcom,spmi-pmic";
40		reg = <0x0 SPMI_USID>;
41		#address-cells = <1>;
42		#size-cells = <0>;
43
44		rtc@6000 {
45			compatible = "qcom,pm8941-rtc";
46			reg = <0x6000>, <0x6100>;
47			reg-names = "rtc", "alarm";
48			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
49		};
50
51		pon: pon@800 {
52			compatible = "qcom,pm8998-pon";
53			reg = <0x800>;
54			mode-bootloader = <0x2>;
55			mode-recovery = <0x1>;
56
57			pon_pwrkey: pwrkey {
58				compatible = "qcom,pm8941-pwrkey";
59				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
60				debounce = <15625>;
61				bias-pull-up;
62				linux,code = <KEY_POWER>;
63
64				status = "disabled";
65			};
66
67			pon_resin: resin {
68				compatible = "qcom,pm8941-resin";
69				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
70				debounce = <15625>;
71				bias-pull-up;
72
73				status = "disabled";
74			};
75		};
76
77		pm660_charger: charger@1000 {
78			compatible = "qcom,pm660-charger";
79			reg = <0x1000>;
80
81			interrupts = <0x0 0x13 0x4 IRQ_TYPE_EDGE_BOTH>,
82				     <0x0 0x12 0x2 IRQ_TYPE_EDGE_BOTH>,
83				     <0x0 0x16 0x1 IRQ_TYPE_EDGE_RISING>,
84				     <0x0 0x13 0x6 IRQ_TYPE_EDGE_RISING>;
85			interrupt-names = "usb-plugin", "bat-ov", "wdog-bark", "usbin-icl-change";
86
87			io-channels = <&pm660_rradc 3>,
88				      <&pm660_rradc 4>;
89			io-channel-names = "usbin_i", "usbin_v";
90
91			status = "disabled";
92		};
93
94		pm660_temp: temp-alarm@2400 {
95			compatible = "qcom,spmi-temp-alarm";
96			reg = <0x2400>;
97			interrupts = <0x0 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
98			io-channels = <&pm660_adc ADC5_DIE_TEMP>;
99			io-channel-names = "thermal";
100			#thermal-sensor-cells = <0>;
101		};
102
103		pm660_adc: adc@3100 {
104			compatible = "qcom,spmi-adc-rev2";
105			reg = <0x3100>;
106			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
107			#address-cells = <1>;
108			#size-cells = <0>;
109			#io-channel-cells = <1>;
110
111			channel@0 {
112				reg = <ADC5_REF_GND>;
113				qcom,decimation = <1024>;
114				qcom,pre-scaling = <1 1>;
115				label = "ref_gnd";
116			};
117
118			channel@1 {
119				reg = <ADC5_1P25VREF>;
120				qcom,decimation = <1024>;
121				qcom,pre-scaling = <1 1>;
122				label = "vref_1p25";
123			};
124
125			channel@6 {
126				reg = <ADC5_DIE_TEMP>;
127				qcom,decimation = <1024>;
128				qcom,pre-scaling = <1 1>;
129				label = "die_temp";
130			};
131
132			channel@4c {
133				reg = <ADC5_XO_THERM_100K_PU>;
134				qcom,pre-scaling = <1 1>;
135				qcom,decimation = <1024>;
136				qcom,hw-settle-time = <200>;
137				qcom,ratiometric;
138				label = "xo_therm";
139			};
140
141			channel@4d {
142				reg = <ADC5_AMUX_THM1_100K_PU>;
143				qcom,pre-scaling = <1 1>;
144				qcom,decimation = <1024>;
145				qcom,hw-settle-time = <200>;
146				qcom,ratiometric;
147				label = "msm_therm";
148			};
149
150			channel@4e {
151				reg = <ADC5_AMUX_THM2_100K_PU>;
152				qcom,pre-scaling = <1 1>;
153				qcom,decimation = <1024>;
154				qcom,hw-settle-time = <200>;
155				qcom,ratiometric;
156				label = "emmc_therm";
157			};
158
159			channel@4f {
160				reg = <ADC5_AMUX_THM3_100K_PU>;
161				qcom,pre-scaling = <1 1>;
162				qcom,decimation = <1024>;
163				qcom,hw-settle-time = <200>;
164				qcom,ratiometric;
165				label = "pa_therm0";
166			};
167
168			channel@50 {
169				reg = <ADC5_AMUX_THM4_100K_PU>;
170				qcom,pre-scaling = <1 1>;
171				qcom,decimation = <1024>;
172				qcom,hw-settle-time = <200>;
173				qcom,ratiometric;
174				label = "pa_therm1";
175			};
176
177			channel@51 {
178				reg = <ADC5_AMUX_THM5_100K_PU>;
179				qcom,pre-scaling = <1 1>;
180				qcom,decimation = <1024>;
181				qcom,hw-settle-time = <200>;
182				qcom,ratiometric;
183				label = "quiet_therm";
184			};
185
186			channel@83 {
187				reg = <ADC5_VPH_PWR>;
188				qcom,decimation = <1024>;
189				qcom,pre-scaling = <1 3>;
190				label = "vph_pwr";
191			};
192
193			channel@85 {
194				reg = <ADC5_VCOIN>;
195				qcom,decimation = <1024>;
196				qcom,pre-scaling = <1 3>;
197				label = "vcoin";
198			};
199		};
200
201		pm660_rradc: adc@4500 {
202			compatible = "qcom,pm660-rradc";
203			reg = <0x4500>;
204			#io-channel-cells = <1>;
205
206			status = "disabled";
207		};
208
209		pm660_gpios: gpio@c000 {
210			compatible = "qcom,pm660-gpio", "qcom,spmi-gpio";
211			reg = <0xc000>;
212			gpio-controller;
213			gpio-ranges = <&pm660_gpios 0 0 13>;
214			#gpio-cells = <2>;
215			interrupt-controller;
216			#interrupt-cells = <2>;
217		};
218	};
219
220	pmic@1 {
221		compatible = "qcom,pm660", "qcom,spmi-pmic";
222		reg = <0x1 SPMI_USID>;
223		#address-cells = <1>;
224		#size-cells = <0>;
225
226		pm660_spmi_regulators: regulators {
227			compatible = "qcom,pm660-regulators";
228		};
229	};
230};
231