blob: 1659706138ed09fc04a16515d9d8df1e70c673ca [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
41 pmi8998_gpios: gpios {
42 compatible = "qcom,qpnp-pin";
43 gpio-controller;
44 #gpio-cells = <2>;
45 #address-cells = <1>;
46 #size-cells = <1>;
47 label = "pmi8998-gpio";
48
49 gpio@c000 {
50 reg = <0xc000 0x100>;
51 qcom,pin-num = <1>;
52 status = "disabled";
53 };
54
55 gpio@c100 {
56 reg = <0xc100 0x100>;
57 qcom,pin-num = <2>;
58 status = "disabled";
59 };
60
61 gpio@c200 {
62 reg = <0xc200 0x100>;
63 qcom,pin-num = <3>;
64 status = "disabled";
65 };
66
67 gpio@c300 {
68 reg = <0xc300 0x100>;
69 qcom,pin-num = <4>;
70 status = "disabled";
71 };
72
73 gpio@c400 {
74 reg = <0xc400 0x100>;
75 qcom,pin-num = <5>;
76 status = "disabled";
77 };
78
79 gpio@c500 {
80 reg = <0xc500 0x100>;
81 qcom,pin-num = <6>;
82 status = "disabled";
83 };
84
85 gpio@c600 {
86 reg = <0xc600 0x100>;
87 qcom,pin-num = <7>;
88 status = "disabled";
89 };
90
91 gpio@c700 {
92 reg = <0xc700 0x100>;
93 qcom,pin-num = <8>;
94 status = "disabled";
95 };
96
97 gpio@c800 {
98 reg = <0xc800 0x100>;
99 qcom,pin-num = <9>;
100 status = "disabled";
101 };
102
103 gpio@c900 {
104 reg = <0xc900 0x100>;
105 qcom,pin-num = <10>;
106 status = "disabled";
107 };
108
109 gpio@ca00 {
110 reg = <0xca00 0x100>;
111 qcom,pin-num = <11>;
112 status = "disabled";
113 };
114
115 gpio@cb00 {
116 reg = <0xcb00 0x100>;
117 qcom,pin-num = <12>;
118 status = "disabled";
119 };
120
121 gpio@cc00 {
122 reg = <0xcc00 0x100>;
123 qcom,pin-num = <13>;
124 status = "disabled";
125 };
126
127 gpio@cd00 {
128 reg = <0xcd00 0x100>;
129 qcom,pin-num = <14>;
130 status = "disabled";
131 };
132 };
133
134 pmi8998_rradc: rradc@4500 {
135 compatible = "qcom,rradc";
136 reg = <0x4500 0x100>;
137 #address-cells = <1>;
138 #size-cells = <0>;
139 #io-channel-cells = <1>;
140 qcom,pmic-revid = <&pmi8998_revid>;
141 };
142 };
143
144 qcom,pmi8998@3 {
145 compatible ="qcom,spmi-pmic";
146 reg = <0x3 SPMI_USID>;
147 #address-cells = <2>;
148 #size-cells = <0>;
149
150 pmi8998_pwm_1: pwm@b100 {
151 compatible = "qcom,qpnp-pwm";
152 reg = <0xb100 0x100>,
153 <0xb042 0x7e>;
154 reg-names = "qpnp-lpg-channel-base",
155 "qpnp-lpg-lut-base";
156 qcom,lpg-lut-size = <0x7e>;
157 qcom,channel-id = <1>;
158 qcom,supported-sizes = <6>, <9>;
159 qcom,ramp-index = <0>;
160 #pwm-cells = <2>;
161 status = "disabled";
162 };
163
164 pmi8998_pwm_2: pwm@b200 {
165 compatible = "qcom,qpnp-pwm";
166 reg = <0xb200 0x100>,
167 <0xb042 0x7e>;
168 reg-names = "qpnp-lpg-channel-base",
169 "qpnp-lpg-lut-base";
170 qcom,lpg-lut-size = <0x7e>;
171 qcom,channel-id = <2>;
172 qcom,supported-sizes = <6>, <9>;
173 qcom,ramp-index = <1>;
174 #pwm-cells = <2>;
175 status = "disabled";
176 };
177
178 pmi8998_pwm_3: pwm@b300 {
179 compatible = "qcom,qpnp-pwm";
180 reg = <0xb300 0x100>,
181 <0xb042 0x7e>;
182 reg-names = "qpnp-lpg-channel-base",
183 "qpnp-lpg-lut-base";
184 qcom,lpg-lut-size = <0x7e>;
185 qcom,channel-id = <3>;
186 qcom,supported-sizes = <6>, <9>;
187 qcom,ramp-index = <2>;
188 #pwm-cells = <2>;
189 };
190
191 pmi8998_pwm_4: pwm@b400 {
192 compatible = "qcom,qpnp-pwm";
193 reg = <0xb400 0x100>,
194 <0xb042 0x7e>;
195 reg-names = "qpnp-lpg-channel-base",
196 "qpnp-lpg-lut-base";
197 qcom,lpg-lut-size = <0x7e>;
198 qcom,channel-id = <4>;
199 qcom,supported-sizes = <6>, <9>;
200 qcom,ramp-index = <3>;
201 #pwm-cells = <2>;
202 };
203
204 pmi8998_pwm_5: pwm@b500 {
205 compatible = "qcom,qpnp-pwm";
206 reg = <0xb500 0x100>,
207 <0xb042 0x7e>;
208 reg-names = "qpnp-lpg-channel-base",
209 "qpnp-lpg-lut-base";
210 qcom,lpg-lut-size = <0x7e>;
211 qcom,channel-id = <5>;
212 qcom,supported-sizes = <6>, <9>;
213 qcom,ramp-index = <4>;
214 #pwm-cells = <2>;
215 };
216
217 pmi8998_pwm_6: pwm@b600 {
218 compatible = "qcom,qpnp-pwm";
219 reg = <0xb600 0x100>,
220 <0xb042 0x7e>;
221 reg-names = "qpnp-lpg-channel-base",
222 "qpnp-lpg-lut-base";
223 qcom,lpg-lut-size = <0x7e>;
224 qcom,channel-id = <6>;
225 qcom,supported-sizes = <6>, <9>;
226 qcom,ramp-index = <5>;
227 #pwm-cells = <2>;
228 status = "disabled";
229 };
230
231 qcom,leds@d000 {
232 compatible = "qcom,leds-qpnp";
233 reg = <0xd000 0x100>;
234 label = "rgb";
235 status = "okay";
236
237 red_led: qcom,rgb_0 {
238 label = "rgb";
239 qcom,id = <3>;
240 qcom,mode = "pwm";
241 pwms = <&pmi8998_pwm_5 0 0>;
242 qcom,pwm-us = <1000>;
243 qcom,max-current = <12>;
244 qcom,default-state = "off";
245 linux,name = "red";
246 linux,default-trigger = "battery-charging";
247 };
248
249 green_led: qcom,rgb_1 {
250 label = "rgb";
251 qcom,id = <4>;
252 qcom,mode = "pwm";
253 pwms = <&pmi8998_pwm_4 0 0>;
254 qcom,pwm-us = <1000>;
255 qcom,max-current = <12>;
256 qcom,default-state = "off";
257 linux,name = "green";
258 linux,default-trigger = "battery-full";
259 };
260
261 blue_led: qcom,rgb_2 {
262 label = "rgb";
263 qcom,id = <5>;
264 qcom,mode = "pwm";
265 pwms = <&pmi8998_pwm_3 0 0>;
266 qcom,pwm-us = <1000>;
267 qcom,max-current = <12>;
268 qcom,default-state = "off";
269 linux,name = "blue";
270 linux,default-trigger = "boot-indication";
271 };
272 };
273
274 labibb: qpnp-labibb-regulator {
275 compatible = "qcom,qpnp-labibb-regulator";
276 #address-cells = <1>;
277 #size-cells = <1>;
278 qcom,pmic-revid = <&pmi8998_revid>;
279 status = "disabled";
280
281 ibb_regulator: qcom,ibb@dc00 {
282 reg = <0xdc00 0x100>;
283 reg-names = "ibb_reg";
284 regulator-name = "ibb_reg";
285
286 regulator-min-microvolt = <4600000>;
287 regulator-max-microvolt = <6000000>;
288
289 qcom,qpnp-ibb-min-voltage = <1400000>;
290 qcom,qpnp-ibb-step-size = <100000>;
291 qcom,qpnp-ibb-slew-rate = <2000000>;
292 qcom,qpnp-ibb-use-default-voltage;
293 qcom,qpnp-ibb-init-voltage = <5500000>;
294 qcom,qpnp-ibb-init-amoled-voltage = <4000000>;
295 qcom,qpnp-ibb-init-lcd-voltage = <5500000>;
296
297 qcom,qpnp-ibb-soft-start = <1000>;
298
299 qcom,qpnp-ibb-lab-pwrup-delay = <8000>;
300 qcom,qpnp-ibb-lab-pwrdn-delay = <8000>;
301 qcom,qpnp-ibb-en-discharge;
302
303 qcom,qpnp-ibb-full-pull-down;
304 qcom,qpnp-ibb-pull-down-enable;
305 qcom,qpnp-ibb-switching-clock-frequency =
306 <1480>;
307 qcom,qpnp-ibb-limit-maximum-current = <1550>;
308 qcom,qpnp-ibb-debounce-cycle = <16>;
309 qcom,qpnp-ibb-limit-max-current-enable;
310 qcom,qpnp-ibb-ps-enable;
311 };
312
313 lab_regulator: qcom,lab@de00 {
314 reg = <0xde00 0x100>;
315 reg-names = "lab";
316 regulator-name = "lab_reg";
317
318 regulator-min-microvolt = <4600000>;
319 regulator-max-microvolt = <6000000>;
320
321 interrupts = <0x3 0xde 0x0
322 IRQ_TYPE_EDGE_RISING>;
323 interrupt-names = "lab-vreg-ok";
324 qcom,qpnp-lab-min-voltage = <4600000>;
325 qcom,qpnp-lab-step-size = <100000>;
326 qcom,qpnp-lab-slew-rate = <5000>;
327 qcom,qpnp-lab-use-default-voltage;
328 qcom,qpnp-lab-init-voltage = <5500000>;
329 qcom,qpnp-lab-init-amoled-voltage = <4600000>;
330 qcom,qpnp-lab-init-lcd-voltage = <5500000>;
331
332 qcom,qpnp-lab-soft-start = <800>;
333
334 qcom,qpnp-lab-full-pull-down;
335 qcom,qpnp-lab-pull-down-enable;
336 qcom,qpnp-lab-switching-clock-frequency =
337 <1600>;
338 qcom,qpnp-lab-limit-maximum-current = <1600>;
339 qcom,qpnp-lab-limit-max-current-enable;
340 qcom,qpnp-lab-ps-threshold = <20>;
341 qcom,qpnp-lab-ps-enable;
342 qcom,qpnp-lab-nfet-size = <100>;
343 qcom,qpnp-lab-pfet-size = <100>;
344 qcom,qpnp-lab-max-precharge-time = <500>;
345 };
346 };
347
348 pmi8998_wled: qcom,leds@d800 {
349 compatible = "qcom,qpnp-wled";
350 reg = <0xd800 0x100>,
351 <0xd900 0x100>;
352 reg-names = "qpnp-wled-ctrl-base",
353 "qpnp-wled-sink-base";
354 interrupts = <0x3 0xd8 0x1 IRQ_TYPE_EDGE_RISING>,
355 <0x3 0xd8 0x2 IRQ_TYPE_EDGE_RISING>;
356 interrupt-names = "ovp-irq", "sc-irq";
357 linux,name = "wled";
358 linux,default-trigger = "bkl-trigger";
359 qcom,fdbk-output = "auto";
360 qcom,vref-uv = <127500>;
361 qcom,switch-freq-khz = <800>;
362 qcom,ovp-mv = <29600>;
363 qcom,ilim-ma = <970>;
364 qcom,boost-duty-ns = <26>;
365 qcom,mod-freq-khz = <9600>;
366 qcom,dim-mode = "hybrid";
367 qcom,hyb-thres = <625>;
368 qcom,sync-dly-us = <800>;
369 qcom,fs-curr-ua = <25000>;
370 qcom,cons-sync-write-delay-us = <1000>;
371 qcom,led-strings-list = [00 01 02 03];
372 qcom,en-ext-pfet-sc-pro;
373 qcom,pmic-revid = <&pmi8998_revid>;
374 qcom,loop-auto-gm-en;
375 status = "okay";
376 };
377
378 flash_led: qcom,leds@d300 {
379 compatible = "qcom,qpnp-flash-led-v2";
380 status = "okay";
381 reg = <0xd300 0x100>;
382 label = "flash";
383 interrupts = <0x3 0xd3 0x0 IRQ_TYPE_EDGE_RISING>,
384 <0x3 0xd3 0x3 IRQ_TYPE_EDGE_RISING>,
385 <0x3 0xd3 0x4 IRQ_TYPE_EDGE_RISING>;
386 interrupt-names = "led-fault-irq",
387 "all-ramp-down-done-irq",
388 "all-ramp-up-done-irq";
389 qcom,hdrm-auto-mode;
390 qcom,short-circuit-det;
391 qcom,open-circuit-det;
392 qcom,vph-droop-det;
393 qcom,thermal-derate-en;
394 qcom,thermal-derate-current = <200 500 1000>;
395 qcom,isc-delay = <192>;
396 qcom,pmic-revid = <&pmi8998_revid>;
397
398 pmi8998_flash0: qcom,flash_0 {
399 label = "flash";
400 qcom,led-name = "led:flash_0";
401 qcom,max-current = <1500>;
402 qcom,default-led-trigger = "flash0_trigger";
403 qcom,id = <0>;
404 qcom,current-ma = <1000>;
405 qcom,duration-ms = <1280>;
406 qcom,ires-ua = <12500>;
407 qcom,hdrm-voltage-mv = <325>;
408 qcom,hdrm-vol-hi-lo-win-mv = <100>;
409 };
410
411 pmi8998_flash1: qcom,flash_1 {
412 label = "flash";
413 qcom,led-name = "led:flash_1";
414 qcom,max-current = <1500>;
415 qcom,default-led-trigger = "flash1_trigger";
416 qcom,id = <1>;
417 qcom,current-ma = <1000>;
418 qcom,duration-ms = <1280>;
419 qcom,ires-ua = <12500>;
420 qcom,hdrm-voltage-mv = <325>;
421 qcom,hdrm-vol-hi-lo-win-mv = <100>;
422 };
423
424 pmi8998_flash2: qcom,flash_2 {
425 label = "flash";
426 qcom,led-name = "led:flash_2";
427 qcom,max-current = <750>;
428 qcom,default-led-trigger = "flash2_trigger";
429 qcom,id = <2>;
430 qcom,current-ma = <500>;
431 qcom,duration-ms = <1280>;
432 qcom,ires-ua = <12500>;
433 qcom,hdrm-voltage-mv = <325>;
434 qcom,hdrm-vol-hi-lo-win-mv = <100>;
435 };
436
437 pmi8998_torch0: qcom,torch_0 {
438 label = "torch";
439 qcom,led-name = "led:torch_0";
440 qcom,max-current = <500>;
441 qcom,default-led-trigger = "torch0_trigger";
442 qcom,id = <0>;
443 qcom,current-ma = <300>;
444 qcom,ires-ua = <12500>;
445 qcom,hdrm-voltage-mv = <325>;
446 qcom,hdrm-vol-hi-lo-win-mv = <100>;
447 };
448
449 pmi8998_torch1: qcom,torch_1 {
450 label = "torch";
451 qcom,led-name = "led:torch_1";
452 qcom,max-current = <500>;
453 qcom,default-led-trigger = "torch1_trigger";
454 qcom,id = <1>;
455 qcom,current-ma = <300>;
456 qcom,ires-ua = <12500>;
457 qcom,hdrm-voltage-mv = <325>;
458 qcom,hdrm-vol-hi-lo-win-mv = <100>;
459 };
460
461 pmi8998_torch2: qcom,torch_2 {
462 label = "torch";
463 qcom,led-name = "led:torch_2";
464 qcom,max-current = <500>;
465 qcom,default-led-trigger = "torch2_trigger";
466 qcom,id = <2>;
467 qcom,current-ma = <300>;
468 qcom,ires-ua = <12500>;
469 qcom,hdrm-voltage-mv = <325>;
470 qcom,hdrm-vol-hi-lo-win-mv = <100>;
471 };
472
473 pmi8998_switch0: qcom,led_switch_0 {
474 label = "switch";
475 qcom,led-name = "led:switch_0";
476 qcom,led-mask = <3>;
477 qcom,default-led-trigger = "switch0_trigger";
478 };
479
480 pmi8998_switch1: qcom,led_switch_1 {
481 label = "switch";
482 qcom,led-name = "led:switch_1";
483 qcom,led-mask = <4>;
484 qcom,default-led-trigger = "switch1_trigger";
485 };
486 };
487 };
488};