1// SPDX-License-Identifier: GPL-2.0
2#include <dt-bindings/iio/qcom,spmi-vadc.h>
3#include <dt-bindings/interrupt-controller/irq.h>
4#include <dt-bindings/spmi/spmi.h>
5
6
7/ {
8	thermal-zones {
9		pm8941-thermal {
10			polling-delay-passive = <100>;
11			polling-delay = <0>;
12			thermal-sensors = <&pm8941_temp>;
13
14			trips {
15				trip0 {
16					temperature = <105000>;
17					hysteresis = <2000>;
18					type = "passive";
19				};
20
21				trip1 {
22					temperature = <125000>;
23					hysteresis = <2000>;
24					type = "hot";
25				};
26
27				crit {
28					temperature = <145000>;
29					hysteresis = <2000>;
30					type = "critical";
31				};
32			};
33		};
34	};
35};
36
37&spmi_bus {
38
39	pm8941_0: pm8941@0 {
40		compatible = "qcom,pm8941", "qcom,spmi-pmic";
41		reg = <0x0 SPMI_USID>;
42		#address-cells = <1>;
43		#size-cells = <0>;
44
45		rtc@6000 {
46			compatible = "qcom,pm8941-rtc";
47			reg = <0x6000>,
48			      <0x6100>;
49			reg-names = "rtc", "alarm";
50			interrupts = <0x0 0x61 0x1 IRQ_TYPE_EDGE_RISING>;
51		};
52
53		pwrkey@800 {
54			compatible = "qcom,pm8941-pwrkey";
55			reg = <0x800>;
56			interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
57			debounce = <15625>;
58			bias-pull-up;
59		};
60
61		usb_id: usb-detect@900 {
62			compatible = "qcom,pm8941-misc";
63			reg = <0x900>;
64			interrupts = <0x0 0x9 0 IRQ_TYPE_EDGE_BOTH>;
65			interrupt-names = "usb_id";
66		};
67
68		smbb: charger@1000 {
69			compatible = "qcom,pm8941-charger";
70			reg = <0x1000>;
71			interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
72				     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
73				     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
74				     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
75				     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
76				     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
77				     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
78				     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
79			interrupt-names = "chg-done",
80					  "chg-fast",
81					  "chg-trkl",
82					  "bat-temp-ok",
83					  "bat-present",
84					  "chg-gone",
85					  "usb-valid",
86					  "dc-valid";
87
88			usb-otg-in-supply = <&pm8941_5vs1>;
89
90			chg_otg: otg-vbus { };
91		};
92
93		pm8941_gpios: gpio@c000 {
94			compatible = "qcom,pm8941-gpio", "qcom,spmi-gpio";
95			reg = <0xc000>;
96			gpio-controller;
97			gpio-ranges = <&pm8941_gpios 0 0 36>;
98			#gpio-cells = <2>;
99			interrupt-controller;
100			#interrupt-cells = <2>;
101
102			boost_bypass_n_pin: boost-bypass-state {
103				pins = "gpio21";
104				function = "normal";
105			};
106		};
107
108		pm8941_mpps: mpps@a000 {
109			compatible = "qcom,pm8941-mpp", "qcom,spmi-mpp";
110			reg = <0xa000>;
111			gpio-controller;
112			#gpio-cells = <2>;
113			gpio-ranges = <&pm8941_mpps 0 0 8>;
114			interrupt-controller;
115			#interrupt-cells = <2>;
116		};
117
118		pm8941_temp: temp-alarm@2400 {
119			compatible = "qcom,spmi-temp-alarm";
120			reg = <0x2400>;
121			interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
122			io-channels = <&pm8941_vadc VADC_DIE_TEMP>;
123			io-channel-names = "thermal";
124			#thermal-sensor-cells = <0>;
125		};
126
127		pm8941_vadc: adc@3100 {
128			compatible = "qcom,spmi-vadc";
129			reg = <0x3100>;
130			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
131			#address-cells = <1>;
132			#size-cells = <0>;
133			#io-channel-cells = <1>;
134
135
136			adc-chan@6 {
137				reg = <VADC_VBAT_SNS>;
138			};
139
140			adc-chan@8 {
141				reg = <VADC_DIE_TEMP>;
142			};
143
144			adc-chan@9 {
145				reg = <VADC_REF_625MV>;
146			};
147
148			adc-chan@a {
149				reg = <VADC_REF_1250MV>;
150			};
151
152			adc-chan@e {
153				reg = <VADC_GND_REF>;
154			};
155
156			adc-chan@f {
157				reg = <VADC_VDD_VADC>;
158			};
159
160			adc-chan@30 {
161				reg = <VADC_LR_MUX1_BAT_THERM>;
162			};
163		};
164
165		pm8941_iadc: adc@3600 {
166			compatible = "qcom,pm8941-iadc", "qcom,spmi-iadc";
167			reg = <0x3600>;
168			interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
169			qcom,external-resistor-micro-ohms = <10000>;
170		};
171
172		pm8941_coincell: charger@2800 {
173			compatible = "qcom,pm8941-coincell";
174			reg = <0x2800>;
175			status = "disabled";
176		};
177	};
178
179	pm8941_1: pm8941@1 {
180		compatible = "qcom,pm8941", "qcom,spmi-pmic";
181		reg = <0x1 SPMI_USID>;
182		#address-cells = <1>;
183		#size-cells = <0>;
184
185		pm8941_lpg: pwm {
186			compatible = "qcom,pm8941-lpg";
187
188			#address-cells = <1>;
189			#size-cells = <0>;
190			#pwm-cells = <2>;
191
192			status = "disabled";
193		};
194
195		pm8941_vib: vibrator@c000 {
196			compatible = "qcom,pm8916-vib";
197			reg = <0xc000>;
198			status = "disabled";
199		};
200
201		pm8941_wled: wled@d800 {
202			compatible = "qcom,pm8941-wled";
203			reg = <0xd800>;
204			label = "backlight";
205
206			status = "disabled";
207		};
208
209		regulators {
210			compatible = "qcom,pm8941-regulators";
211			interrupts = <0x1 0x83 0x2 0>, <0x1 0x84 0x2 0>;
212			interrupt-names = "ocp-5vs1", "ocp-5vs2";
213			vin_5vs-supply = <&pm8941_5v>;
214
215			pm8941_5v: s4 {
216				regulator-min-microvolt = <5000000>;
217				regulator-max-microvolt = <5000000>;
218				regulator-enable-ramp-delay = <500>;
219			};
220
221			pm8941_5vs1: 5vs1 {
222				regulator-enable-ramp-delay = <1000>;
223				regulator-pull-down;
224				regulator-over-current-protection;
225				qcom,ocp-max-retries = <10>;
226				qcom,ocp-retry-delay = <30>;
227				qcom,vs-soft-start-strength = <0>;
228				regulator-initial-mode = <1>;
229			};
230
231			pm8941_5vs2: 5vs2 {
232				regulator-enable-ramp-delay = <1000>;
233				regulator-pull-down;
234				regulator-over-current-protection;
235				qcom,ocp-max-retries = <10>;
236				qcom,ocp-retry-delay = <30>;
237				qcom,vs-soft-start-strength = <0>;
238				regulator-initial-mode = <1>;
239			};
240		};
241	};
242};
243