treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / Documentation / ABI / testing / sysfs-class-power
blobbf3b48f022dc1d802fe90bd951ed1d6291b73aaa
1 ===== General Properties =====
3 What:           /sys/class/power_supply/<supply_name>/manufacturer
4 Date:           May 2007
5 Contact:        linux-pm@vger.kernel.org
6 Description:
7                 Reports the name of the device manufacturer.
9                 Access: Read
10                 Valid values: Represented as string
12 What:           /sys/class/power_supply/<supply_name>/model_name
13 Date:           May 2007
14 Contact:        linux-pm@vger.kernel.org
15 Description:
16                 Reports the name of the device model.
18                 Access: Read
19                 Valid values: Represented as string
21 What:           /sys/class/power_supply/<supply_name>/serial_number
22 Date:           January 2008
23 Contact:        linux-pm@vger.kernel.org
24 Description:
25                 Reports the serial number of the device.
27                 Access: Read
28                 Valid values: Represented as string
30 What:           /sys/class/power_supply/<supply_name>/type
31 Date:           May 2010
32 Contact:        linux-pm@vger.kernel.org
33 Description:
34                 Describes the main type of the supply.
36                 Access: Read
37                 Valid values: "Battery", "UPS", "Mains", "USB"
39 ===== Battery Properties =====
41 What:           /sys/class/power_supply/<supply_name>/capacity
42 Date:           May 2007
43 Contact:        linux-pm@vger.kernel.org
44 Description:
45                 Fine grain representation of battery capacity.
46                 Access: Read
47                 Valid values: 0 - 100 (percent)
49 What:           /sys/class/power_supply/<supply_name>/capacity_alert_max
50 Date:           July 2012
51 Contact:        linux-pm@vger.kernel.org
52 Description:
53                 Maximum battery capacity trip-wire value where the supply will
54                 notify user-space of the event. This is normally used for the
55                 battery discharging scenario where user-space needs to know the
56                 battery has dropped to an upper level so it can take
57                 appropriate action (e.g. warning user that battery level is
58                 low).
60                 Access: Read, Write
61                 Valid values: 0 - 100 (percent)
63 What:           /sys/class/power_supply/<supply_name>/capacity_alert_min
64 Date:           July 2012
65 Contact:        linux-pm@vger.kernel.org
66 Description:
67                 Minimum battery capacity trip-wire value where the supply will
68                 notify user-space of the event. This is normally used for the
69                 battery discharging scenario where user-space needs to know the
70                 battery has dropped to a lower level so it can take
71                 appropriate action (e.g. warning user that battery level is
72                 critically low).
74                 Access: Read, Write
75                 Valid values: 0 - 100 (percent)
77 What:           /sys/class/power_supply/<supply_name>/capacity_level
78 Date:           June 2009
79 Contact:        linux-pm@vger.kernel.org
80 Description:
81                 Coarse representation of battery capacity.
83                 Access: Read
84                 Valid values: "Unknown", "Critical", "Low", "Normal", "High",
85                               "Full"
87 What:           /sys/class/power_supply/<supply_name>/current_avg
88 Date:           May 2007
89 Contact:        linux-pm@vger.kernel.org
90 Description:
91                 Reports an average IBAT current reading for the battery, over a
92                 fixed period. Normally devices will provide a fixed interval in
93                 which they average readings to smooth out the reported value.
95                 Access: Read
96                 Valid values: Represented in microamps
98 What:           /sys/class/power_supply/<supply_name>/current_max
99 Date:           October 2010
100 Contact:        linux-pm@vger.kernel.org
101 Description:
102                 Reports the maximum IBAT current allowed into the battery.
104                 Access: Read
105                 Valid values: Represented in microamps
107 What:           /sys/class/power_supply/<supply_name>/current_now
108 Date:           May 2007
109 Contact:        linux-pm@vger.kernel.org
110 Description:
111                 Reports an instant, single IBAT current reading for the battery.
112                 This value is not averaged/smoothed.
114                 Access: Read
115                 Valid values: Represented in microamps
117 What:           /sys/class/power_supply/<supply_name>/charge_control_limit
118 Date:           Oct 2012
119 Contact:        linux-pm@vger.kernel.org
120 Description:
121                 Maximum allowable charging current. Used for charge rate
122                 throttling for thermal cooling or improving battery health.
124                 Access: Read, Write
125                 Valid values: Represented in microamps
127 What:           /sys/class/power_supply/<supply_name>/charge_control_limit_max
128 Date:           Oct 2012
129 Contact:        linux-pm@vger.kernel.org
130 Description:
131                 Maximum legal value for the charge_control_limit property.
133                 Access: Read
134                 Valid values: Represented in microamps
136 What:           /sys/class/power_supply/<supply_name>/charge_control_start_threshold
137 Date:           April 2019
138 Contact:        linux-pm@vger.kernel.org
139 Description:
140                 Represents a battery percentage level, below which charging will
141                 begin.
143                 Access: Read, Write
144                 Valid values: 0 - 100 (percent)
146 What:           /sys/class/power_supply/<supply_name>/charge_control_end_threshold
147 Date:           April 2019
148 Contact:        linux-pm@vger.kernel.org
149 Description:
150                 Represents a battery percentage level, above which charging will
151                 stop.
153                 Access: Read, Write
154                 Valid values: 0 - 100 (percent)
156 What:           /sys/class/power_supply/<supply_name>/charge_type
157 Date:           July 2009
158 Contact:        linux-pm@vger.kernel.org
159 Description:
160                 Represents the type of charging currently being applied to the
161                 battery. "Trickle", "Fast", and "Standard" all mean different
162                 charging speeds. "Adaptive" means that the charger uses some
163                 algorithm to adjust the charge rate dynamically, without
164                 any user configuration required. "Custom" means that the charger
165                 uses the charge_control_* properties as configuration for some
166                 different algorithm.
168                 Access: Read, Write
169                 Valid values: "Unknown", "N/A", "Trickle", "Fast", "Standard",
170                               "Adaptive", "Custom"
172 What:           /sys/class/power_supply/<supply_name>/charge_term_current
173 Date:           July 2014
174 Contact:        linux-pm@vger.kernel.org
175 Description:
176                 Reports the charging current value which is used to determine
177                 when the battery is considered full and charging should end.
179                 Access: Read
180                 Valid values: Represented in microamps
182 What:           /sys/class/power_supply/<supply_name>/health
183 Date:           May 2007
184 Contact:        linux-pm@vger.kernel.org
185 Description:
186                 Reports the health of the battery or battery side of charger
187                 functionality.
189                 Access: Read
190                 Valid values: "Unknown", "Good", "Overheat", "Dead",
191                               "Over voltage", "Unspecified failure", "Cold",
192                               "Watchdog timer expire", "Safety timer expire",
193                               "Over current"
195 What:           /sys/class/power_supply/<supply_name>/precharge_current
196 Date:           June 2017
197 Contact:        linux-pm@vger.kernel.org
198 Description:
199                 Reports the charging current applied during pre-charging phase
200                 for a battery charge cycle.
202                 Access: Read
203                 Valid values: Represented in microamps
205 What:           /sys/class/power_supply/<supply_name>/present
206 Date:           May 2007
207 Contact:        linux-pm@vger.kernel.org
208 Description:
209                 Reports whether a battery is present or not in the system.
211                 Access: Read
212                 Valid values:
213                         0: Absent
214                         1: Present
216 What:           /sys/class/power_supply/<supply_name>/status
217 Date:           May 2007
218 Contact:        linux-pm@vger.kernel.org
219 Description:
220                 Represents the charging status of the battery. Normally this
221                 is read-only reporting although for some supplies this can be
222                 used to enable/disable charging to the battery.
224                 Access: Read, Write
225                 Valid values: "Unknown", "Charging", "Discharging",
226                               "Not charging", "Full"
228 What:           /sys/class/power_supply/<supply_name>/technology
229 Date:           May 2007
230 Contact:        linux-pm@vger.kernel.org
231 Description:
232                 Describes the battery technology supported by the supply.
234                 Access: Read
235                 Valid values: "Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe",
236                               "NiCd", "LiMn"
238 What:           /sys/class/power_supply/<supply_name>/temp
239 Date:           May 2007
240 Contact:        linux-pm@vger.kernel.org
241 Description:
242                 Reports the current TBAT battery temperature reading.
244                 Access: Read
245                 Valid values: Represented in 1/10 Degrees Celsius
247 What:           /sys/class/power_supply/<supply_name>/temp_alert_max
248 Date:           July 2012
249 Contact:        linux-pm@vger.kernel.org
250 Description:
251                 Maximum TBAT temperature trip-wire value where the supply will
252                 notify user-space of the event. This is normally used for the
253                 battery charging scenario where user-space needs to know the
254                 battery temperature has crossed an upper threshold so it can
255                 take appropriate action (e.g. warning user that battery level is
256                 critically high, and charging has stopped).
258                 Access: Read
259                 Valid values: Represented in 1/10 Degrees Celsius
261 What:           /sys/class/power_supply/<supply_name>/temp_alert_min
262 Date:           July 2012
263 Contact:        linux-pm@vger.kernel.org
264 Description:
265                 Minimum TBAT temperature trip-wire value where the supply will
266                 notify user-space of the event. This is normally used for the
267                 battery charging scenario where user-space needs to know the
268                 battery temperature has crossed a lower threshold so it can take
269                 appropriate action (e.g. warning user that battery level is
270                 high, and charging current has been reduced accordingly to
271                 remedy the situation).
273                 Access: Read
274                 Valid values: Represented in 1/10 Degrees Celsius
276 What:           /sys/class/power_supply/<supply_name>/temp_max
277 Date:           July 2014
278 Contact:        linux-pm@vger.kernel.org
279 Description:
280                 Reports the maximum allowed TBAT battery temperature for
281                 charging.
283                 Access: Read
284                 Valid values: Represented in 1/10 Degrees Celsius
286 What:           /sys/class/power_supply/<supply_name>/temp_min
287 Date:           July 2014
288 Contact:        linux-pm@vger.kernel.org
289 Description:
290                 Reports the minimum allowed TBAT battery temperature for
291                 charging.
293                 Access: Read
294                 Valid values: Represented in 1/10 Degrees Celsius
296 What:           /sys/class/power_supply/<supply_name>/voltage_avg,
297 Date:           May 2007
298 Contact:        linux-pm@vger.kernel.org
299 Description:
300                 Reports an average VBAT voltage reading for the battery, over a
301                 fixed period. Normally devices will provide a fixed interval in
302                 which they average readings to smooth out the reported value.
304                 Access: Read
305                 Valid values: Represented in microvolts
307 What:           /sys/class/power_supply/<supply_name>/voltage_max,
308 Date:           January 2008
309 Contact:        linux-pm@vger.kernel.org
310 Description:
311                 Reports the maximum safe VBAT voltage permitted for the battery,
312                 during charging.
314                 Access: Read
315                 Valid values: Represented in microvolts
317 What:           /sys/class/power_supply/<supply_name>/voltage_min,
318 Date:           January 2008
319 Contact:        linux-pm@vger.kernel.org
320 Description:
321                 Reports the minimum safe VBAT voltage permitted for the battery,
322                 during discharging.
324                 Access: Read
325                 Valid values: Represented in microvolts
327 What:           /sys/class/power_supply/<supply_name>/voltage_now,
328 Date:           May 2007
329 Contact:        linux-pm@vger.kernel.org
330 Description:
331                 Reports an instant, single VBAT voltage reading for the battery.
332                 This value is not averaged/smoothed.
334                 Access: Read
335                 Valid values: Represented in microvolts
337 ===== USB Properties =====
339 What:           /sys/class/power_supply/<supply_name>/current_avg
340 Date:           May 2007
341 Contact:        linux-pm@vger.kernel.org
342 Description:
343                 Reports an average IBUS current reading over a fixed period.
344                 Normally devices will provide a fixed interval in which they
345                 average readings to smooth out the reported value.
347                 Access: Read
348                 Valid values: Represented in microamps
351 What:           /sys/class/power_supply/<supply_name>/current_max
352 Date:           October 2010
353 Contact:        linux-pm@vger.kernel.org
354 Description:
355                 Reports the maximum IBUS current the supply can support.
357                 Access: Read
358                 Valid values: Represented in microamps
360 What:           /sys/class/power_supply/<supply_name>/current_now
361 Date:           May 2007
362 Contact:        linux-pm@vger.kernel.org
363 Description:
364                 Reports the IBUS current supplied now. This value is generally
365                 read-only reporting, unless the 'online' state of the supply
366                 is set to be programmable, in which case this value can be set
367                 within the reported min/max range.
369                 Access: Read, Write
370                 Valid values: Represented in microamps
372 What:           /sys/class/power_supply/<supply_name>/input_current_limit
373 Date:           July 2014
374 Contact:        linux-pm@vger.kernel.org
375 Description:
376                 Details the incoming IBUS current limit currently set in the
377                 supply. Normally this is configured based on the type of
378                 connection made (e.g. A configured SDP should output a maximum
379                 of 500mA so the input current limit is set to the same value).
380                 Use preferably input_power_limit, and for problems that can be
381                 solved using power limit use input_current_limit.
383                 Access: Read, Write
384                 Valid values: Represented in microamps
386 What:           /sys/class/power_supply/<supply_name>/input_voltage_limit
387 Date:           May 2019
388 Contact:        linux-pm@vger.kernel.org
389 Description:
390                 This entry configures the incoming VBUS voltage limit currently
391                 set in the supply. Normally this is configured based on
392                 system-level knowledge or user input (e.g. This is part of the
393                 Pixel C's thermal management strategy to effectively limit the
394                 input power to 5V when the screen is on to meet Google's skin
395                 temperature targets). Note that this feature should not be
396                 used for safety critical things.
397                 Use preferably input_power_limit, and for problems that can be
398                 solved using power limit use input_voltage_limit.
400                 Access: Read, Write
401                 Valid values: Represented in microvolts
403 What:           /sys/class/power_supply/<supply_name>/input_power_limit
404 Date:           May 2019
405 Contact:        linux-pm@vger.kernel.org
406 Description:
407                 This entry configures the incoming power limit currently set
408                 in the supply. Normally this is configured based on
409                 system-level knowledge or user input. Use preferably this
410                 feature to limit the incoming power and use current/voltage
411                 limit only for problems that can be solved using power limit.
413                 Access: Read, Write
414                 Valid values: Represented in microwatts
416 What:           /sys/class/power_supply/<supply_name>/online,
417 Date:           May 2007
418 Contact:        linux-pm@vger.kernel.org
419 Description:
420                 Indicates if VBUS is present for the supply. When the supply is
421                 online, and the supply allows it, then it's possible to switch
422                 between online states (e.g. Fixed -> Programmable for a PD_PPS
423                 USB supply so voltage and current can be controlled).
425                 Access: Read, Write
426                 Valid values:
427                         0: Offline
428                         1: Online Fixed - Fixed Voltage Supply
429                         2: Online Programmable - Programmable Voltage Supply
431 What:           /sys/class/power_supply/<supply_name>/temp
432 Date:           May 2007
433 Contact:        linux-pm@vger.kernel.org
434 Description:
435                 Reports the current supply temperature reading. This would
436                 normally be the internal temperature of the device itself (e.g
437                 TJUNC temperature of an IC)
439                 Access: Read
440                 Valid values: Represented in 1/10 Degrees Celsius
442 What:           /sys/class/power_supply/<supply_name>/temp_alert_max
443 Date:           July 2012
444 Contact:        linux-pm@vger.kernel.org
445 Description:
446                 Maximum supply temperature trip-wire value where the supply will
447                 notify user-space of the event. This is normally used for the
448                 charging scenario where user-space needs to know the supply
449                 temperature has crossed an upper threshold so it can take
450                 appropriate action (e.g. warning user that the supply
451                 temperature is critically high, and charging has stopped to
452                 remedy the situation).
454                 Access: Read
455                 Valid values: Represented in 1/10 Degrees Celsius
457 What:           /sys/class/power_supply/<supply_name>/temp_alert_min
458 Date:           July 2012
459 Contact:        linux-pm@vger.kernel.org
460 Description:
461                 Minimum supply temperature trip-wire value where the supply will
462                 notify user-space of the event. This is normally used for the
463                 charging scenario where user-space needs to know the supply
464                 temperature has crossed a lower threshold so it can take
465                 appropriate action (e.g. warning user that the supply
466                 temperature is high, and charging current has been reduced
467                 accordingly to remedy the situation).
469                 Access: Read
470                 Valid values: Represented in 1/10 Degrees Celsius
472 What:           /sys/class/power_supply/<supply_name>/temp_max
473 Date:           July 2014
474 Contact:        linux-pm@vger.kernel.org
475 Description:
476                 Reports the maximum allowed supply temperature for operation.
478                 Access: Read
479                 Valid values: Represented in 1/10 Degrees Celsius
481 What:           /sys/class/power_supply/<supply_name>/temp_min
482 Date:           July 2014
483 Contact:        linux-pm@vger.kernel.org
484 Description:
485                 Reports the mainimum allowed supply temperature for operation.
487                 Access: Read
488                 Valid values: Represented in 1/10 Degrees Celsius
490 What:           /sys/class/power_supply/<supply_name>/usb_type
491 Date:           March 2018
492 Contact:        linux-pm@vger.kernel.org
493 Description:
494                 Reports what type of USB connection is currently active for
495                 the supply, for example it can show if USB-PD capable source
496                 is attached.
498                 Access: Read-Only
499                 Valid values: "Unknown", "SDP", "DCP", "CDP", "ACA", "C", "PD",
500                               "PD_DRP", "PD_PPS", "BrickID"
502 What:           /sys/class/power_supply/<supply_name>/voltage_max
503 Date:           January 2008
504 Contact:        linux-pm@vger.kernel.org
505 Description:
506                 Reports the maximum VBUS voltage the supply can support.
508                 Access: Read
509                 Valid values: Represented in microvolts
511 What:           /sys/class/power_supply/<supply_name>/voltage_min
512 Date:           January 2008
513 Contact:        linux-pm@vger.kernel.org
514 Description:
515                 Reports the minimum VBUS voltage the supply can support.
517                 Access: Read
518                 Valid values: Represented in microvolts
520 What:           /sys/class/power_supply/<supply_name>/voltage_now
521 Date:           May 2007
522 Contact:        linux-pm@vger.kernel.org
523 Description:
524                 Reports the VBUS voltage supplied now. This value is generally
525                 read-only reporting, unless the 'online' state of the supply
526                 is set to be programmable, in which case this value can be set
527                 within the reported min/max range.
529                 Access: Read, Write
530                 Valid values: Represented in microvolts
532 ===== Device Specific Properties =====
534 What:           /sys/class/power/ds2760-battery.*/charge_now
535 Date:           May 2010
536 KernelVersion:  2.6.35
537 Contact:        Daniel Mack <daniel@caiaq.de>
538 Description:
539                 This file is writeable and can be used to set the current
540                 coloumb counter value inside the battery monitor chip. This
541                 is needed for unavoidable corrections of aging batteries.
542                 A userspace daemon can monitor the battery charging logic
543                 and once the counter drops out of considerable bounds, take
544                 appropriate action.
546 What:           /sys/class/power/ds2760-battery.*/charge_full
547 Date:           May 2010
548 KernelVersion:  2.6.35
549 Contact:        Daniel Mack <daniel@caiaq.de>
550 Description:
551                 This file is writeable and can be used to set the assumed
552                 battery 'full level'. As batteries age, this value has to be
553                 amended over time.
555 What:           /sys/class/power_supply/max14577-charger/device/fast_charge_timer
556 Date:           October 2014
557 KernelVersion:  3.18.0
558 Contact:        Krzysztof Kozlowski <krzk@kernel.org>
559 Description:
560                 This entry shows and sets the maximum time the max14577
561                 charger operates in fast-charge mode. When the timer expires
562                 the device will terminate fast-charge mode (charging current
563                 will drop to 0 A) and will trigger interrupt.
565                 Valid values:
566                 - 5, 6 or 7 (hours),
567                 - 0: disabled.
569 What:           /sys/class/power_supply/max77693-charger/device/fast_charge_timer
570 Date:           January 2015
571 KernelVersion:  3.19.0
572 Contact:        Krzysztof Kozlowski <krzk@kernel.org>
573 Description:
574                 This entry shows and sets the maximum time the max77693
575                 charger operates in fast-charge mode. When the timer expires
576                 the device will terminate fast-charge mode (charging current
577                 will drop to 0 A) and will trigger interrupt.
579                 Valid values:
580                 - 4 - 16 (hours), step by 2 (rounded down)
581                 - 0: disabled.
583 What:           /sys/class/power_supply/max77693-charger/device/top_off_threshold_current
584 Date:           January 2015
585 KernelVersion:  3.19.0
586 Contact:        Krzysztof Kozlowski <krzk@kernel.org>
587 Description:
588                 This entry shows and sets the charging current threshold for
589                 entering top-off charging mode. When charging current in fast
590                 charge mode drops below this value, the charger will trigger
591                 interrupt and start top-off charging mode.
593                 Valid values:
594                 - 100000 - 200000 (microamps), step by 25000 (rounded down)
595                 - 200000 - 350000 (microamps), step by 50000 (rounded down)
596                 - 0: disabled.
598 What:           /sys/class/power_supply/max77693-charger/device/top_off_timer
599 Date:           January 2015
600 KernelVersion:  3.19.0
601 Contact:        Krzysztof Kozlowski <krzk@kernel.org>
602 Description:
603                 This entry shows and sets the maximum time the max77693
604                 charger operates in top-off charge mode. When the timer expires
605                 the device will terminate top-off charge mode (charging current
606                 will drop to 0 A) and will trigger interrupt.
608                 Valid values:
609                 - 0 - 70 (minutes), step by 10 (rounded down)
611 What:           /sys/class/power_supply/bq24257-charger/ovp_voltage
612 Date:           October 2015
613 KernelVersion:  4.4.0
614 Contact:        Andreas Dannenberg <dannenberg@ti.com>
615 Description:
616                 This entry configures the overvoltage protection feature of bq24257-
617                 type charger devices. This feature protects the device and other
618                 components against damage from overvoltage on the input supply. See
619                 device datasheet for details.
621                 Valid values:
622                 - 6000000, 6500000, 7000000, 8000000, 9000000, 9500000, 10000000,
623                   10500000 (all uV)
625 What:           /sys/class/power_supply/bq24257-charger/in_dpm_voltage
626 Date:           October 2015
627 KernelVersion:  4.4.0
628 Contact:        Andreas Dannenberg <dannenberg@ti.com>
629 Description:
630                 This entry configures the input dynamic power path management voltage of
631                 bq24257-type charger devices. Once the supply drops to the configured
632                 voltage, the input current limit is reduced down to prevent the further
633                 drop of the supply. When the IC enters this mode, the charge current is
634                 lower than the set value. See device datasheet for details.
636                 Valid values:
637                 - 4200000, 4280000, 4360000, 4440000, 4520000, 4600000, 4680000,
638                   4760000 (all uV)
640 What:           /sys/class/power_supply/bq24257-charger/high_impedance_enable
641 Date:           October 2015
642 KernelVersion:  4.4.0
643 Contact:        Andreas Dannenberg <dannenberg@ti.com>
644 Description:
645                 This entry allows enabling the high-impedance mode of bq24257-type
646                 charger devices. If enabled, it places the charger IC into low power
647                 standby mode with the switch mode controller disabled. When disabled,
648                 the charger operates normally. See device datasheet for details.
650                 Valid values:
651                 - 1: enabled
652                 - 0: disabled
654 What:           /sys/class/power_supply/bq24257-charger/sysoff_enable
655 Date:           October 2015
656 KernelVersion:  4.4.0
657 Contact:        Andreas Dannenberg <dannenberg@ti.com>
658 Description:
659                 This entry allows enabling the sysoff mode of bq24257-type charger
660                 devices. If enabled and the input is removed, the internal battery FET
661                 is turned off in order to reduce the leakage from the BAT pin to less
662                 than 1uA. Note that on some devices/systems this disconnects the battery
663                 from the system. See device datasheet for details.
665                 Valid values:
666                 - 1: enabled
667                 - 0: disabled