summaryrefslogtreecommitdiff
path: root/bindings/power/supply/qcom/qpnp-smb5.txt
blob: c1359c1cce47d51291909d17aa6942d7a2c96e93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
Qualcomm Technologies, Inc. SMB5 Charger Specific Bindings

SMB5 Charger is an efficient programmable battery charger capable of charging a
high-capacity lithium-ion battery over micro-USB or USB Type-C ultrafast with
Quick Charge 2.0, Quick Charge 3.0, and USB Power Delivery support. Wireless
charging features full A4WP Rezence 1.2, WPC 1.2, and PMA support.

=======================
Required Node Structure
=======================

SMB5 Charger must be described in two levels of devices nodes.

===============================
First Level Node - SMB5 Charger
===============================

Charger specific properties:
- compatible
  Usage:      required
  Value type: <string>
  Definition: "qcom,qpnp-smb5".

- qcom,pmic-revid
  Usage:      required
  Value type: phandle
  Definition: Should specify the phandle of PMI's revid module. This is used to
		identify the PMI subtype.

- qcom,sec-charger-config
  Usage:      optional
  Value type: <u32>
  Definition: Specify how the secondary chargers are configured.
		0 - No secondary charger.
		1 - Charge Pump SMB1390.
		2 - SMB1355 parallel charger.
		3 - Both Charge Pump and SMB1355.
		If the value is not present, 0 is used as default.

- io-channels
- io-channel-names
  Usage:      optional
  Value type: <phandle>
  Definition: For details about IIO bindings see:
		Documentation/devicetree/bindings/iio/iio-bindings.txt

- qcom,batteryless-platform
  Usage:      optional
  Value type: <empty>
  Definition: Boolean flag which indicates that the platform does not have a
		battery, and therefore charging should be disabled. In
		addition battery properties will be faked such that the device
		assumes normal operation.

- qcom,charger-temp-max
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the charger temp REG_H_THRESHOLD for PM8150B in deciDegC.
		If the value is not present, use the setting read from the device.

- qcom,smb-temp-max
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the charger temp REG_H_THRESHOLD for SMB1355 in deciDegC.
		If the value is not present, use the setting read from the device.

- qcom,fcc-max-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the maximum fast charge current in micro-amps.
		If the value is not present, 1Amp is used as default.

- qcom,fv-max-uv
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the maximum float voltage in micro-volts.
		If the value is not present, 4.35V is used as default.

- qcom,usb-icl-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the USB input current limit in micro-amps.
		 If the value is not present, 1.5Amps is used as default.

- qcom,usb-ocl-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the OTG output current limit in micro-amps.
		If the value is not present, 1.5Amps is used as default.

- qcom,dc-icl-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the DC input current limit in micro-amps.

- qcom,boost-threshold-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the boost current threshold in micro-amps.
		If the value is not present, 100mA is used as default.

- qcom,thermal-mitigation
  Usage:      optional
  Value type: Array of <u32>
  Definition: Array of fast charge current limit values for
		different system thermal mitigation levels.
		This should be a flat array that denotes the
		maximum charge current in mA for each thermal
		level.

- qcom,float-option
  Usage:      optional
  Value type: <u32>
  Definition: Configures how the charger behaves when a float charger is
	      detected by APSD.
	        1 - Treat as a DCP.
	        2 - Treat as a SDP.
	        3 - Disable charging.
	        4 - Suspend USB input.

- qcom,hvdcp-disable
  Usage:      optional
  Value type: <empty>
  Definition: Specifies if hvdcp charging is to be enabled or not.
		If this property is not specified hvdcp will be enabled.
		If this property is specified, hvdcp 2.0 detection will still
		happen but the adapter won't be asked to switch to a higher
		voltage point.

- qcom,chg-inhibit-threshold-mv
  Usage:      optional
  Value type: <u32>
  Definition: Charge inhibit threshold in milli-volts. Charging will be
		inhibited when the battery voltage is within this threshold
		from Vfloat at charger insertion. If this is not specified
		then charge inhibit will be disabled by default.
		Allowed values are: 50, 100, 200, 300.

- qcom,chg-term-src
  Usage:      optional
  Value type: <u32>
  Definition: Specify either the ADC or analog comparators to be used in order
		to set threshold values for charge termination current.
		0 - Unspecified
		1 - Select ADC comparator
		2 - Select ANALOG comparator

- qcom,chg-term-current-ma
  Usage:      optional
  Value type: <u32>
  Definition: When ADC comparator is selected as qcom,chg-term-src, this
		parameter should be set to the desired upper threshold.

- qcom,chg-term-base-current-ma
  Usage:      optional
  Value type: <u32>
  Definition: When ADC comparator is selected as qcom,chg-term-src, this
		parameter should be set to the desired lower threshold.

- qcom,auto-recharge-soc
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the SOC threshold at which the charger will
		restart charging after termination. The value specified
		ranges from 0 - 100. The feature is enabled if this
		property is specified with a valid SOC value.

- qcom,auto-recharge-vbat-mv
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the battery voltage threshold at which the charger
		will restart charging after termination. The value specified
		is in milli-volts.

- qcom,suspend-input-on-debug-batt
  Usage:      optional
  Value type: <empty>
  Definition: Boolean flag which when present enables input suspend for
		debug battery.

- qcom,fake-chg-status-on-debug-batt
  Usage:      optional
  Value type: <empty>
  Definition: Boolean flag which when present shows charging status as
		unknown for debug battery. This needs to be specified only if
		the device needs to be kept powered on always with
		"svc power stayon true".

- qcom,min-freq-khz
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the minimum charger buck/boost switching frequency
		in KHz. It overrides the min frequency defined for the charger.

- qcom,max-freq-khz
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the maximum charger buck/boost switching frequency in
		 KHz. It overrides the max frequency defined for the charger.

- qcom,otg-deglitch-time-ms
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the deglitch interval for OTG detection.
		If the value is not present, 50 msec is used as default.

- qcom,step-charging-enable
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present enables step-charging.

- qcom,typec-legacy-rp-icl
  Usage:       optional
  Value type:  bool
  Definition:  Boolean property to enable setting ICL based on Rp for
		Type-C non-compliant legacy cables.

- qcom,wd-bark-time-secs
  Usage:      optional
  Value type: <u32>
  Definition: WD bark-timeout in seconds. The possible values are
		16, 32, 64, 128. If not defined it defaults to 64.

- qcom,sw-jeita-enable
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present enables sw compensation for
		jeita.

- qcom,battery-data
  Usage:      optional
  Value type: <phandle>
  Definition: Specifies the phandle of the node which contains the battery
		profiles supported on the device.

- qcom,flash-derating-soc
  Usage:      optional
  Value type: <u32>
  Definition: SOC threshold in percentage below which hardware will start
		derating flash. This is only applicable to certain PMICs like
		PMI632 which has SCHGM_FLASH peripheral.

- qcom,flash-disable-soc
  Usage:      optional
  Value type: <u32>
  Definition: SOC threshold in percentage below which hardware will disable
		flash. This is only applicable to certain PMICs like PMI632
		which has SCHGM_FLASH peripheral.

- qcom,headroom-mode
  Usage:      optional
  Value type: <u32>
  Definition: Specifies flash hardware headroom management policy. The
		possible values are:
		<0>: Fixed mode, constant 5V at flash input.
		<1>: Adaptive mode allows charger output voltage to be
		dynamically controlled by the flash module based on the
		required flash headroom.
		This is only applicable to certain PMICs like PMI632 which
		has SCHGM_FLASH peripheral.

- qcom,fcc-stepping-enable
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present enables stepwise change in FCC.
		The default stepping rate is 100mA/sec.

- qcom,disable-suspend-on-collapse
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present disables suspend on collapse
		feature of charger hardware.

- qcom,uusb-moisture-protection-enable
	Usage:      optional
	Value type: bool
	Definition: Boolean flag which when present enables mositure protection
		    feature for uUSB connector type.

- qcom,hvdcp-autonomous-enable
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present enables hardware-controlled
		operation of HVDCP.

- qcom,usb-pd-disable
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present disables USB-PD operation.

- qcom,lpd-disable
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present disables liquid presence
		detection.

- qcom,hw-die-temp-mitigation
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present enables h/w based thermal
		mitigation.

- qcom,hw-connector-mitigation
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present enables h/w based
		connector temperature mitigation.

- qcom,hw-skin-temp-mitigation
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present enables h/w based skin
		temperature mitigation.

- qcom,en-skin-therm-mitigation
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present enables skin
		thermal mitigation.

- qcom,connector-internal-pull-kohm
  Usage:      optional
  Value type: <u32>
  Definition: Specifies internal pull-up configuration to be applied to
		connector THERM. The only valid values are (0/30/100/400).
		If not specified 100K is used as default pull-up.

- qcom,smb-internal-pull-kohm
  Usage:      optional
  Value type: <u32>
  Definition: Specifies internal pull-up configuration to be applied to
		connector THERM, only valid values are (0/30/100/400).
		If not specified 100K is used as default pull-up.

- qcom,wd-snarl-time-config
  Usage:      optional
  Value type: <u32>
  Definition: WDOG snarl timeout configuration value. The possible values are
		0 to 7, where 0 = 62.5ms, 1 = 125ms, 2 = 250ms, 3 = 500ms,
		4 = 1s, 5 = 2s, 6 = 4s and 7 = 8s. If not defined, wdog-snarl
		irq is disabled by default.

- qcom,adc-based-aicl
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present enables ADC based AICL.

- qcom,wls-current-max-ua
  Usage:      optional
  Value type: <u32>
  Definition: Upper limit of charging current supplied by the wireless charger.
		If left unspecified, the HW min value of 1.5 A is applied by
		default.

- qcom,fcc-step-delay-ms
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the delay between each step of FCC stepper algorithm.
		If left unspecified, the default value is 1 Sec.

- qcom,fcc-step-size-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the step size of each step of FCC stepper algorithm.
		If left unspecified, the default value is 100mA.

- qcom,hvdcp2-max-icl-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the maximum input current limit that can be configured
		for HVDCP2 adapter when it's working at 5V and 9V.
		If left unspecified, the default value is 3000mA.

- qcom,hvdcp2-12v-max-icl-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the maximum input current limit that can be configured
		for HVDCP2 adapter when it's working at 12V.
		If left unspecified, the default value is the same value
		specified in "qcom,hvdcp2-max-icl-ua".

- qcom,hvdcp3-max-icl-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the maximum input current limit that can be configured
		for HVDCP3 adapter.
		If left unspecified, the default value is 3000mA.

- qcom,hvdcp3-standalone-config
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present indicates that the charging is
		only done by the main charger (standalone, no CP) with a QC 3.0
		adapter.

- qcom,disable-fcc-restriction
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present disables FCC restriction.

- qcom,qc4-max-icl-ua
  Usage:      optional
  Value type: <u32>
  Definition: Specifies the maximum input current limit that can be configured
		for PPS adapter in CV mode.
		If left unspecified, the default value is 4000mA.

- qcom,jeita-arb-enable
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which indicates if JETIA ARB handling when
		Vjeita > Vbatt is enabled.

=============================================
Second Level Nodes - SMB5 Charger Peripherals
=============================================

Peripheral specific properties:
- reg
  Usage:      required
  Value type: <prop-encoded-array>
  Definition: Address and size of the peripheral's register block.

- interrupts
  Usage:      required
  Value type: <prop-encoded-array>
  Definition: Peripheral interrupt specifier.

- interrupt-names
  Usage:      required
  Value type: <stringlist>
  Definition: Interrupt names.  This list must match up 1-to-1 with the
	      interrupts specified in the 'interrupts' property.

=======
Example
=======

pm8150b_charger: qcom,qpnp-smb5 {
	compatible = "qcom,qpnp-smb5";
	#address-cells = <1>;
	#size-cells = <1>;

	qcom,pmic-revid = <&pm8150b_revid>;

	dpdm-supply = <&qusb_phy0>;

	qcom,sec-charger-config = <1>;

	io-channels = <&pm8150b_vadc ADC_USB_IN_V_16>,
	              <&pm8150b_vadc ADC_USB_IN_I>,
	              <&pm8150b_vadc ADC_CHG_TEMP>;
	io-channel-names = "usb_in_voltage",
	                   "usb_in_current",
	                   "chg_temp";

	qcom,chgr@1000 {
		reg = <0x1000 0x100>;
		interrupts =	<0x2 0x10 0x0 IRQ_TYPE_NONE>,
				<0x2 0x10 0x1 IRQ_TYPE_NONE>,
				<0x2 0x10 0x2 IRQ_TYPE_NONE>,
				<0x2 0x10 0x3 IRQ_TYPE_NONE>,
				<0x2 0x10 0x4 IRQ_TYPE_NONE>;

		interrupt-names =	"chg-error",
					"chg-state-change",
					"step-chg-state-change",
					"step-chg-soc-update-fail",
					"step-chg-soc-update-request";
	};

	qcom,otg@1100 {
		reg = <0x1100 0x100>;
		interrupts =	<0x2 0x11 0x0 IRQ_TYPE_NONE>,
				<0x2 0x11 0x1 IRQ_TYPE_NONE>,
				<0x2 0x11 0x2 IRQ_TYPE_NONE>,
				<0x2 0x11 0x3 IRQ_TYPE_NONE>;

		interrupt-names =	"otg-fail",
					"otg-overcurrent",
					"otg-oc-dis-sw-sts",
					"testmode-change-detect";
	};

	qcom,bat-if@1200 {
		reg = <0x1200 0x100>;
		interrupts =	<0x2 0x12 0x0 IRQ_TYPE_NONE>,
				<0x2 0x12 0x1 IRQ_TYPE_NONE>,
				<0x2 0x12 0x2 IRQ_TYPE_NONE>,
				<0x2 0x12 0x3 IRQ_TYPE_NONE>,
				<0x2 0x12 0x4 IRQ_TYPE_NONE>,
				<0x2 0x12 0x5 IRQ_TYPE_NONE>;

		interrupt-names =	"bat-temp",
					"bat-ocp",
					"bat-ov",
					"bat-low",
					"bat-therm-or-id-missing",
					"bat-terminal-missing";
	};

	qcom,usb-chgpth@1300 {
		reg = <0x1300 0x100>;
		interrupts =	<0x2 0x13 0x0 IRQ_TYPE_NONE>,
				<0x2 0x13 0x1 IRQ_TYPE_NONE>,
				<0x2 0x13 0x2 IRQ_TYPE_NONE>,
				<0x2 0x13 0x3 IRQ_TYPE_NONE>,
				<0x2 0x13 0x4 IRQ_TYPE_NONE>,
				<0x2 0x13 0x5 IRQ_TYPE_NONE>,
				<0x2 0x13 0x6 IRQ_TYPE_NONE>,
				<0x2 0x13 0x7 IRQ_TYPE_NONE>;

		interrupt-names =	"usbin-collapse",
					"usbin-lt-3p6v",
					"usbin-uv",
					"usbin-ov",
					"usbin-plugin",
					"usbin-src-change",
					"usbin-icl-change",
					"type-c-change";
	};

	qcom,dc-chgpth@1400 {
		reg = <0x1400 0x100>;
		interrupts =	<0x2 0x14 0x0 IRQ_TYPE_NONE>,
				<0x2 0x14 0x1 IRQ_TYPE_NONE>,
				<0x2 0x14 0x2 IRQ_TYPE_NONE>,
				<0x2 0x14 0x3 IRQ_TYPE_NONE>,
				<0x2 0x14 0x4 IRQ_TYPE_NONE>,
				<0x2 0x14 0x5 IRQ_TYPE_NONE>,
				<0x2 0x14 0x6 IRQ_TYPE_NONE>;

		interrupt-names =	"dcin-collapse",
					"dcin-lt-3p6v",
					"dcin-uv",
					"dcin-ov",
					"dcin-plugin",
					"div2-en-dg",
					"dcin-icl-change";
	};

	qcom,chgr-misc@1600 {
		reg = <0x1600 0x100>;
		interrupts =	<0x2 0x16 0x0 IRQ_TYPE_NONE>,
				<0x2 0x16 0x1 IRQ_TYPE_NONE>,
				<0x2 0x16 0x2 IRQ_TYPE_NONE>,
				<0x2 0x16 0x3 IRQ_TYPE_NONE>,
				<0x2 0x16 0x4 IRQ_TYPE_NONE>,
				<0x2 0x16 0x5 IRQ_TYPE_NONE>,
				<0x2 0x16 0x6 IRQ_TYPE_NONE>,
				<0x2 0x16 0x7 IRQ_TYPE_NONE>;

		interrupt-names =	"wdog-snarl",
					"wdog-bark",
					"aicl-fail",
					"aicl-done",
					"high-duty-cycle",
					"input-current-limiting",
					"temperature-change",
					"switcher-power-ok";
	};

	qcom,schgm-flash@a600 {
		reg = <0xa600 0x100>;
		interrupts =	<0x2 0xa6 0x0 IRQ_TYPE_NONE>,
				<0x2 0xa6 0x1 IRQ_TYPE_NONE>,
				<0x2 0xa6 0x2 IRQ_TYPE_NONE>,
				<0x2 0xa6 0x3 IRQ_TYPE_NONE>,
				<0x2 0xa6 0x4 IRQ_TYPE_NONE>,
				<0x2 0xa6 0x5 IRQ_TYPE_NONE>,
				<0x2 0xa6 0x6 IRQ_TYPE_NONE>,
				<0x2 0xa6 0x7 IRQ_TYPE_NONE>;

		interrupt-names =	"flash-en",
					"torch-req",
					"flash-state-change",
					"vout-up",
					"vout-down",
					"ilim1-s1",
					"ilim2-s2",
					"vreg-ok";
	};
};