blob: 44658b80fbd7a03df9f791915270080bd97711ef [file] [log] [blame]
David Collinsbbed9aa2017-03-10 11:53:10 -08001/* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#include <dt-bindings/spmi/spmi.h>
14#include <dt-bindings/interrupt-controller/irq.h>
15
16&spmi_bus {
17 qcom,pmi8998@2 {
18 compatible = "qcom,spmi-pmic";
19 reg = <0x2 SPMI_USID>;
20 #address-cells = <2>;
21 #size-cells = <0>;
22
23 pmi8998_revid: qcom,revid@100 {
24 compatible = "qcom,qpnp-revid";
25 reg = <0x100 0x100>;
26 qcom,fab-id-valid;
27 };
28
29 qcom,power-on@800 {
30 compatible = "qcom,qpnp-power-on";
31 reg = <0x800 0x100>;
32 };
33
34 qcom,temp-alarm@2400 {
35 compatible = "qcom,qpnp-temp-alarm";
36 reg = <0x2400 0x100>;
37 interrupts = <0x2 0x24 0x0 IRQ_TYPE_EDGE_RISING>;
38 label = "pmi8998_tz";
39 };
40
Fenglin Wu5a50fc82017-03-22 12:27:31 +080041 pmi8998_gpios: pinctrl@c000 {
42 compatible = "qcom,spmi-gpio";
43 reg = <0xc000 0xe00>;
44 interrupts = <0x2 0xc0 0 IRQ_TYPE_NONE>,
45 <0x2 0xc1 0 IRQ_TYPE_NONE>,
46 <0x2 0xc2 0 IRQ_TYPE_NONE>,
47 <0x2 0xc4 0 IRQ_TYPE_NONE>,
48 <0x2 0xc5 0 IRQ_TYPE_NONE>,
49 <0x2 0xc7 0 IRQ_TYPE_NONE>,
50 <0x2 0xc8 0 IRQ_TYPE_NONE>,
51 <0x2 0xc9 0 IRQ_TYPE_NONE>,
52 <0x2 0xca 0 IRQ_TYPE_NONE>,
53 <0x2 0xcb 0 IRQ_TYPE_NONE>,
54 <0x2 0xcd 0 IRQ_TYPE_NONE>;
55 interrupt-names = "pmi8998_gpio1", "pmi8998_gpio2",
56 "pmi8998_gpio3", "pmi8998_gpio5",
57 "pmi8998_gpio6", "pmi8998_gpio8",
58 "pmi8998_gpio9", "pmi8998_gpio10",
59 "pmi8998_gpio11", "pmi8998_gpio12",
60 "pmi8998_gpio14";
David Collinsbbed9aa2017-03-10 11:53:10 -080061 gpio-controller;
62 #gpio-cells = <2>;
Fenglin Wu5a50fc82017-03-22 12:27:31 +080063 qcom,gpios-disallowed = <4 7 13>;
David Collinsbbed9aa2017-03-10 11:53:10 -080064 };
65
66 pmi8998_rradc: rradc@4500 {
67 compatible = "qcom,rradc";
68 reg = <0x4500 0x100>;
69 #address-cells = <1>;
70 #size-cells = <0>;
71 #io-channel-cells = <1>;
72 qcom,pmic-revid = <&pmi8998_revid>;
73 };
74 };
75
76 qcom,pmi8998@3 {
77 compatible ="qcom,spmi-pmic";
78 reg = <0x3 SPMI_USID>;
79 #address-cells = <2>;
80 #size-cells = <0>;
81
82 pmi8998_pwm_1: pwm@b100 {
83 compatible = "qcom,qpnp-pwm";
84 reg = <0xb100 0x100>,
85 <0xb042 0x7e>;
86 reg-names = "qpnp-lpg-channel-base",
87 "qpnp-lpg-lut-base";
88 qcom,lpg-lut-size = <0x7e>;
89 qcom,channel-id = <1>;
90 qcom,supported-sizes = <6>, <9>;
91 qcom,ramp-index = <0>;
92 #pwm-cells = <2>;
93 status = "disabled";
94 };
95
96 pmi8998_pwm_2: pwm@b200 {
97 compatible = "qcom,qpnp-pwm";
98 reg = <0xb200 0x100>,
99 <0xb042 0x7e>;
100 reg-names = "qpnp-lpg-channel-base",
101 "qpnp-lpg-lut-base";
102 qcom,lpg-lut-size = <0x7e>;
103 qcom,channel-id = <2>;
104 qcom,supported-sizes = <6>, <9>;
105 qcom,ramp-index = <1>;
106 #pwm-cells = <2>;
107 status = "disabled";
108 };
109
110 pmi8998_pwm_3: pwm@b300 {
111 compatible = "qcom,qpnp-pwm";
112 reg = <0xb300 0x100>,
113 <0xb042 0x7e>;
114 reg-names = "qpnp-lpg-channel-base",
115 "qpnp-lpg-lut-base";
116 qcom,lpg-lut-size = <0x7e>;
117 qcom,channel-id = <3>;
118 qcom,supported-sizes = <6>, <9>;
119 qcom,ramp-index = <2>;
120 #pwm-cells = <2>;
121 };
122
123 pmi8998_pwm_4: pwm@b400 {
124 compatible = "qcom,qpnp-pwm";
125 reg = <0xb400 0x100>,
126 <0xb042 0x7e>;
127 reg-names = "qpnp-lpg-channel-base",
128 "qpnp-lpg-lut-base";
129 qcom,lpg-lut-size = <0x7e>;
130 qcom,channel-id = <4>;
131 qcom,supported-sizes = <6>, <9>;
132 qcom,ramp-index = <3>;
133 #pwm-cells = <2>;
134 };
135
136 pmi8998_pwm_5: pwm@b500 {
137 compatible = "qcom,qpnp-pwm";
138 reg = <0xb500 0x100>,
139 <0xb042 0x7e>;
140 reg-names = "qpnp-lpg-channel-base",
141 "qpnp-lpg-lut-base";
142 qcom,lpg-lut-size = <0x7e>;
143 qcom,channel-id = <5>;
144 qcom,supported-sizes = <6>, <9>;
145 qcom,ramp-index = <4>;
146 #pwm-cells = <2>;
147 };
148
149 pmi8998_pwm_6: pwm@b600 {
150 compatible = "qcom,qpnp-pwm";
151 reg = <0xb600 0x100>,
152 <0xb042 0x7e>;
153 reg-names = "qpnp-lpg-channel-base",
154 "qpnp-lpg-lut-base";
155 qcom,lpg-lut-size = <0x7e>;
156 qcom,channel-id = <6>;
157 qcom,supported-sizes = <6>, <9>;
158 qcom,ramp-index = <5>;
159 #pwm-cells = <2>;
160 status = "disabled";
161 };
162
163 qcom,leds@d000 {
164 compatible = "qcom,leds-qpnp";
165 reg = <0xd000 0x100>;
166 label = "rgb";
167 status = "okay";
168
169 red_led: qcom,rgb_0 {
170 label = "rgb";
171 qcom,id = <3>;
172 qcom,mode = "pwm";
173 pwms = <&pmi8998_pwm_5 0 0>;
174 qcom,pwm-us = <1000>;
175 qcom,max-current = <12>;
176 qcom,default-state = "off";
177 linux,name = "red";
178 linux,default-trigger = "battery-charging";
179 };
180
181 green_led: qcom,rgb_1 {
182 label = "rgb";
183 qcom,id = <4>;
184 qcom,mode = "pwm";
185 pwms = <&pmi8998_pwm_4 0 0>;
186 qcom,pwm-us = <1000>;
187 qcom,max-current = <12>;
188 qcom,default-state = "off";
189 linux,name = "green";
190 linux,default-trigger = "battery-full";
191 };
192
193 blue_led: qcom,rgb_2 {
194 label = "rgb";
195 qcom,id = <5>;
196 qcom,mode = "pwm";
197 pwms = <&pmi8998_pwm_3 0 0>;
198 qcom,pwm-us = <1000>;
199 qcom,max-current = <12>;
200 qcom,default-state = "off";
201 linux,name = "blue";
202 linux,default-trigger = "boot-indication";
203 };
204 };
205
206 labibb: qpnp-labibb-regulator {
207 compatible = "qcom,qpnp-labibb-regulator";
208 #address-cells = <1>;
209 #size-cells = <1>;
210 qcom,pmic-revid = <&pmi8998_revid>;
211 status = "disabled";
212
213 ibb_regulator: qcom,ibb@dc00 {
214 reg = <0xdc00 0x100>;
215 reg-names = "ibb_reg";
216 regulator-name = "ibb_reg";
217
218 regulator-min-microvolt = <4600000>;
219 regulator-max-microvolt = <6000000>;
220
221 qcom,qpnp-ibb-min-voltage = <1400000>;
222 qcom,qpnp-ibb-step-size = <100000>;
223 qcom,qpnp-ibb-slew-rate = <2000000>;
224 qcom,qpnp-ibb-use-default-voltage;
225 qcom,qpnp-ibb-init-voltage = <5500000>;
226 qcom,qpnp-ibb-init-amoled-voltage = <4000000>;
227 qcom,qpnp-ibb-init-lcd-voltage = <5500000>;
228
229 qcom,qpnp-ibb-soft-start = <1000>;
230
231 qcom,qpnp-ibb-lab-pwrup-delay = <8000>;
232 qcom,qpnp-ibb-lab-pwrdn-delay = <8000>;
233 qcom,qpnp-ibb-en-discharge;
234
235 qcom,qpnp-ibb-full-pull-down;
236 qcom,qpnp-ibb-pull-down-enable;
237 qcom,qpnp-ibb-switching-clock-frequency =
238 <1480>;
239 qcom,qpnp-ibb-limit-maximum-current = <1550>;
240 qcom,qpnp-ibb-debounce-cycle = <16>;
241 qcom,qpnp-ibb-limit-max-current-enable;
242 qcom,qpnp-ibb-ps-enable;
243 };
244
245 lab_regulator: qcom,lab@de00 {
246 reg = <0xde00 0x100>;
247 reg-names = "lab";
248 regulator-name = "lab_reg";
249
250 regulator-min-microvolt = <4600000>;
251 regulator-max-microvolt = <6000000>;
252
253 interrupts = <0x3 0xde 0x0
254 IRQ_TYPE_EDGE_RISING>;
255 interrupt-names = "lab-vreg-ok";
256 qcom,qpnp-lab-min-voltage = <4600000>;
257 qcom,qpnp-lab-step-size = <100000>;
258 qcom,qpnp-lab-slew-rate = <5000>;
259 qcom,qpnp-lab-use-default-voltage;
260 qcom,qpnp-lab-init-voltage = <5500000>;
261 qcom,qpnp-lab-init-amoled-voltage = <4600000>;
262 qcom,qpnp-lab-init-lcd-voltage = <5500000>;
263
264 qcom,qpnp-lab-soft-start = <800>;
265
266 qcom,qpnp-lab-full-pull-down;
267 qcom,qpnp-lab-pull-down-enable;
268 qcom,qpnp-lab-switching-clock-frequency =
269 <1600>;
270 qcom,qpnp-lab-limit-maximum-current = <1600>;
271 qcom,qpnp-lab-limit-max-current-enable;
272 qcom,qpnp-lab-ps-threshold = <20>;
273 qcom,qpnp-lab-ps-enable;
274 qcom,qpnp-lab-nfet-size = <100>;
275 qcom,qpnp-lab-pfet-size = <100>;
276 qcom,qpnp-lab-max-precharge-time = <500>;
277 };
278 };
279
280 pmi8998_wled: qcom,leds@d800 {
281 compatible = "qcom,qpnp-wled";
282 reg = <0xd800 0x100>,
283 <0xd900 0x100>;
284 reg-names = "qpnp-wled-ctrl-base",
285 "qpnp-wled-sink-base";
286 interrupts = <0x3 0xd8 0x1 IRQ_TYPE_EDGE_RISING>,
287 <0x3 0xd8 0x2 IRQ_TYPE_EDGE_RISING>;
288 interrupt-names = "ovp-irq", "sc-irq";
289 linux,name = "wled";
290 linux,default-trigger = "bkl-trigger";
291 qcom,fdbk-output = "auto";
292 qcom,vref-uv = <127500>;
293 qcom,switch-freq-khz = <800>;
294 qcom,ovp-mv = <29600>;
295 qcom,ilim-ma = <970>;
296 qcom,boost-duty-ns = <26>;
297 qcom,mod-freq-khz = <9600>;
298 qcom,dim-mode = "hybrid";
299 qcom,hyb-thres = <625>;
300 qcom,sync-dly-us = <800>;
301 qcom,fs-curr-ua = <25000>;
302 qcom,cons-sync-write-delay-us = <1000>;
303 qcom,led-strings-list = [00 01 02 03];
304 qcom,en-ext-pfet-sc-pro;
305 qcom,pmic-revid = <&pmi8998_revid>;
306 qcom,loop-auto-gm-en;
307 status = "okay";
308 };
309
310 flash_led: qcom,leds@d300 {
311 compatible = "qcom,qpnp-flash-led-v2";
312 status = "okay";
313 reg = <0xd300 0x100>;
314 label = "flash";
315 interrupts = <0x3 0xd3 0x0 IRQ_TYPE_EDGE_RISING>,
316 <0x3 0xd3 0x3 IRQ_TYPE_EDGE_RISING>,
317 <0x3 0xd3 0x4 IRQ_TYPE_EDGE_RISING>;
318 interrupt-names = "led-fault-irq",
319 "all-ramp-down-done-irq",
320 "all-ramp-up-done-irq";
321 qcom,hdrm-auto-mode;
322 qcom,short-circuit-det;
323 qcom,open-circuit-det;
324 qcom,vph-droop-det;
325 qcom,thermal-derate-en;
326 qcom,thermal-derate-current = <200 500 1000>;
327 qcom,isc-delay = <192>;
328 qcom,pmic-revid = <&pmi8998_revid>;
329
330 pmi8998_flash0: qcom,flash_0 {
331 label = "flash";
332 qcom,led-name = "led:flash_0";
333 qcom,max-current = <1500>;
334 qcom,default-led-trigger = "flash0_trigger";
335 qcom,id = <0>;
336 qcom,current-ma = <1000>;
337 qcom,duration-ms = <1280>;
338 qcom,ires-ua = <12500>;
339 qcom,hdrm-voltage-mv = <325>;
340 qcom,hdrm-vol-hi-lo-win-mv = <100>;
341 };
342
343 pmi8998_flash1: qcom,flash_1 {
344 label = "flash";
345 qcom,led-name = "led:flash_1";
346 qcom,max-current = <1500>;
347 qcom,default-led-trigger = "flash1_trigger";
348 qcom,id = <1>;
349 qcom,current-ma = <1000>;
350 qcom,duration-ms = <1280>;
351 qcom,ires-ua = <12500>;
352 qcom,hdrm-voltage-mv = <325>;
353 qcom,hdrm-vol-hi-lo-win-mv = <100>;
354 };
355
356 pmi8998_flash2: qcom,flash_2 {
357 label = "flash";
358 qcom,led-name = "led:flash_2";
359 qcom,max-current = <750>;
360 qcom,default-led-trigger = "flash2_trigger";
361 qcom,id = <2>;
362 qcom,current-ma = <500>;
363 qcom,duration-ms = <1280>;
364 qcom,ires-ua = <12500>;
365 qcom,hdrm-voltage-mv = <325>;
366 qcom,hdrm-vol-hi-lo-win-mv = <100>;
367 };
368
369 pmi8998_torch0: qcom,torch_0 {
370 label = "torch";
371 qcom,led-name = "led:torch_0";
372 qcom,max-current = <500>;
373 qcom,default-led-trigger = "torch0_trigger";
374 qcom,id = <0>;
375 qcom,current-ma = <300>;
376 qcom,ires-ua = <12500>;
377 qcom,hdrm-voltage-mv = <325>;
378 qcom,hdrm-vol-hi-lo-win-mv = <100>;
379 };
380
381 pmi8998_torch1: qcom,torch_1 {
382 label = "torch";
383 qcom,led-name = "led:torch_1";
384 qcom,max-current = <500>;
385 qcom,default-led-trigger = "torch1_trigger";
386 qcom,id = <1>;
387 qcom,current-ma = <300>;
388 qcom,ires-ua = <12500>;
389 qcom,hdrm-voltage-mv = <325>;
390 qcom,hdrm-vol-hi-lo-win-mv = <100>;
391 };
392
393 pmi8998_torch2: qcom,torch_2 {
394 label = "torch";
395 qcom,led-name = "led:torch_2";
396 qcom,max-current = <500>;
397 qcom,default-led-trigger = "torch2_trigger";
398 qcom,id = <2>;
399 qcom,current-ma = <300>;
400 qcom,ires-ua = <12500>;
401 qcom,hdrm-voltage-mv = <325>;
402 qcom,hdrm-vol-hi-lo-win-mv = <100>;
403 };
404
405 pmi8998_switch0: qcom,led_switch_0 {
406 label = "switch";
407 qcom,led-name = "led:switch_0";
408 qcom,led-mask = <3>;
409 qcom,default-led-trigger = "switch0_trigger";
410 };
411
412 pmi8998_switch1: qcom,led_switch_1 {
413 label = "switch";
414 qcom,led-name = "led:switch_1";
415 qcom,led-mask = <4>;
416 qcom,default-led-trigger = "switch1_trigger";
417 };
418 };
419 };
420};