xref: /linux/arch/arm/boot/dts/qcom/pm8941.dtsi (revision 30e48a75df9c6ead93866bdf1511ca6ecfe17fbe)
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		pon@800 {
54			compatible = "qcom,pm8941-pon";
55			reg = <0x800>;
56
57			pwrkey {
58				compatible = "qcom,pm8941-pwrkey";
59				interrupts = <0x0 0x8 0 IRQ_TYPE_EDGE_BOTH>;
60				debounce = <15625>;
61				bias-pull-up;
62			};
63
64			pm8941_resin: resin {
65				compatible = "qcom,pm8941-resin";
66				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
67				debounce = <15625>;
68				bias-pull-up;
69				status = "disabled";
70			};
71		};
72
73		usb_id: usb-detect@900 {
74			compatible = "qcom,pm8941-misc";
75			reg = <0x900>;
76			interrupts = <0x0 0x9 0 IRQ_TYPE_EDGE_BOTH>;
77			interrupt-names = "usb_id";
78		};
79
80		smbb: charger@1000 {
81			compatible = "qcom,pm8941-charger";
82			reg = <0x1000>;
83			interrupts = <0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
84				     <0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
85				     <0x0 0x10 4 IRQ_TYPE_EDGE_BOTH>,
86				     <0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
87				     <0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
88				     <0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
89				     <0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
90				     <0x0 0x14 1 IRQ_TYPE_EDGE_BOTH>;
91			interrupt-names = "chg-done",
92					  "chg-fast",
93					  "chg-trkl",
94					  "bat-temp-ok",
95					  "bat-present",
96					  "chg-gone",
97					  "usb-valid",
98					  "dc-valid";
99
100			usb-otg-in-supply = <&pm8941_5vs1>;
101
102			status = "disabled";
103
104			chg_otg: otg-vbus { };
105		};
106
107		pm8941_gpios: gpio@c000 {
108			compatible = "qcom,pm8941-gpio", "qcom,spmi-gpio";
109			reg = <0xc000>;
110			gpio-controller;
111			gpio-ranges = <&pm8941_gpios 0 0 36>;
112			#gpio-cells = <2>;
113			interrupt-controller;
114			#interrupt-cells = <2>;
115
116			boost_bypass_n_pin: boost-bypass-state {
117				pins = "gpio21";
118				function = "normal";
119			};
120		};
121
122		pm8941_mpps: mpps@a000 {
123			compatible = "qcom,pm8941-mpp", "qcom,spmi-mpp";
124			reg = <0xa000>;
125			gpio-controller;
126			#gpio-cells = <2>;
127			gpio-ranges = <&pm8941_mpps 0 0 8>;
128			interrupt-controller;
129			#interrupt-cells = <2>;
130		};
131
132		pm8941_temp: temp-alarm@2400 {
133			compatible = "qcom,spmi-temp-alarm";
134			reg = <0x2400>;
135			interrupts = <0 0x24 0 IRQ_TYPE_EDGE_RISING>;
136			io-channels = <&pm8941_vadc VADC_DIE_TEMP>;
137			io-channel-names = "thermal";
138			#thermal-sensor-cells = <0>;
139		};
140
141		pm8941_vadc: adc@3100 {
142			compatible = "qcom,spmi-vadc";
143			reg = <0x3100>;
144			interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
145			#address-cells = <1>;
146			#size-cells = <0>;
147			#io-channel-cells = <1>;
148
149
150			channel@6 {
151				reg = <VADC_VBAT_SNS>;
152			};
153
154			channel@8 {
155				reg = <VADC_DIE_TEMP>;
156			};
157
158			channel@9 {
159				reg = <VADC_REF_625MV>;
160			};
161
162			channel@a {
163				reg = <VADC_REF_1250MV>;
164			};
165
166			channel@e {
167				reg = <VADC_GND_REF>;
168			};
169
170			channel@f {
171				reg = <VADC_VDD_VADC>;
172			};
173
174			channel@30 {
175				reg = <VADC_LR_MUX1_BAT_THERM>;
176			};
177		};
178
179		pm8941_iadc: adc@3600 {
180			compatible = "qcom,pm8941-iadc", "qcom,spmi-iadc";
181			reg = <0x3600>;
182			interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
183			qcom,external-resistor-micro-ohms = <10000>;
184		};
185
186		pm8941_coincell: charger@2800 {
187			compatible = "qcom,pm8941-coincell";
188			reg = <0x2800>;
189			status = "disabled";
190		};
191	};
192
193	pm8941_1: pm8941@1 {
194		compatible = "qcom,pm8941", "qcom,spmi-pmic";
195		reg = <0x1 SPMI_USID>;
196		#address-cells = <1>;
197		#size-cells = <0>;
198
199		pm8941_lpg: pwm {
200			compatible = "qcom,pm8941-lpg";
201
202			#address-cells = <1>;
203			#size-cells = <0>;
204			#pwm-cells = <2>;
205
206			status = "disabled";
207		};
208
209		pm8941_vib: vibrator@c000 {
210			compatible = "qcom,pm8916-vib";
211			reg = <0xc000>;
212			status = "disabled";
213		};
214
215		pm8941_wled: wled@d800 {
216			compatible = "qcom,pm8941-wled";
217			reg = <0xd800>;
218			label = "backlight";
219
220			status = "disabled";
221		};
222
223		regulators {
224			compatible = "qcom,pm8941-regulators";
225			interrupts = <0x1 0x83 0x2 0>, <0x1 0x84 0x2 0>;
226			interrupt-names = "ocp-5vs1", "ocp-5vs2";
227			vin_5vs-supply = <&pm8941_5v>;
228
229			pm8941_5v: s4 {
230				regulator-min-microvolt = <5000000>;
231				regulator-max-microvolt = <5000000>;
232				regulator-enable-ramp-delay = <500>;
233			};
234
235			pm8941_5vs1: 5vs1 {
236				regulator-enable-ramp-delay = <1000>;
237				regulator-pull-down;
238				regulator-over-current-protection;
239				qcom,ocp-max-retries = <10>;
240				qcom,ocp-retry-delay = <30>;
241				qcom,vs-soft-start-strength = <0>;
242				regulator-initial-mode = <1>;
243			};
244
245			pm8941_5vs2: 5vs2 {
246				regulator-enable-ramp-delay = <1000>;
247				regulator-pull-down;
248				regulator-over-current-protection;
249				qcom,ocp-max-retries = <10>;
250				qcom,ocp-retry-delay = <30>;
251				qcom,vs-soft-start-strength = <0>;
252				regulator-initial-mode = <1>;
253			};
254		};
255	};
256};
257