Skip to content

Commit 3a2a875

Browse files
committed
Merge tag 'for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply and reset updates from Sebastian Reichel: "This time there are lots of changes. Quite a few changes to the core, lots of driver changes and one change to kobject core (with Ack from Greg). Summary: kobject: - Increase number of allowed uevent variables power-supply core: - Add power-supply type in uevent - Cleanup property handling in core - Make property and usb_type pointers const - Convert core power-supply DT binding to YAML - Cleanup HWMON code - Add new health status "calibration required" - Add new properties for manufacture date and capacity error margin battery drivers: - new cw2015 battery driver used by pine64 Pinebook Pro laptop - axp22: blacklist on Meegopad T02 - sc27xx: support current/voltage reading - max17042: support time-to-empty reading - simple-battery: add more battery parameters - bq27xxx: convert DT binding document to YAML - sbs-battery: add TI BQ20Z65 support, fix technology property, convert DT binding to YAML, add option to disable charger broadcasts, add new properties: manufacture date, capacity error margin, average current, charge current and voltage and support calibration required health status - misc fixes charger drivers: - bq25890: cleanup, implement charge type, precharge current and input current limiting properties - bd70528: use new linear range helper library - bd99954: new charger driver - mp2629: new charger driver - misc fixes reboot drivers: - oxnas-restart: introduce new driver - syscon-reboot: convert DT binding to YAML, add parent syscon device support - misc fixes" * tag 'for-v5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (85 commits) power: supply: cw2015: Attach OF ID table to the driver power: reset: gpio-poweroff: add missing '\n' in dev_err() Revert "power: supply: sbs-battery: simplify read_read_string_data" Revert "power: supply: sbs-battery: add PEC support" dt-bindings: power: sbs-battery: Convert to yaml power: supply: sbs-battery: constify power-supply property array power: supply: sbs-battery: switch to i2c's probe_new power: supply: sbs-battery: switch from of_property_* to device_property_* power: supply: sbs-battery: add ability to disable charger broadcasts power: supply: sbs-battery: fix idle battery status power: supply: sbs-battery: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED support power: supply: sbs-battery: add MANUFACTURE_DATE support power: supply: sbs-battery: add POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT/VOLTAGE_MAX support power: supply: sbs-battery: Improve POWER_SUPPLY_PROP_TECHNOLOGY support power: supply: sbs-battery: add POWER_SUPPLY_PROP_CURRENT_AVG support power: supply: sbs-battery: add PEC support power: supply: sbs-battery: simplify read_read_string_data power: supply: sbs-battery: add POWER_SUPPLY_PROP_CAPACITY_ERROR_MARGIN support power: supply: sbs-battery: Add TI BQ20Z65 support power: supply: core: add POWER_SUPPLY_HEALTH_CALIBRATION_REQUIRED ...
2 parents c90e794 + 152204d commit 3a2a875

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4693
-678
lines changed

Documentation/ABI/testing/sysfs-class-power

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,21 @@ Description:
7474
Access: Read, Write
7575
Valid values: 0 - 100 (percent)
7676

77+
What: /sys/class/power_supply/<supply_name>/capacity_error_margin
78+
Date: April 2019
79+
80+
Description:
81+
Battery capacity measurement becomes unreliable without
82+
recalibration. This values provides the maximum error
83+
margin expected to exist by the fuel gauge in percent.
84+
Values close to 0% will be returned after (re-)calibration
85+
has happened. Over time the error margin will increase.
86+
100% means, that the capacity related values are basically
87+
completely useless.
88+
89+
Access: Read
90+
Valid values: 0 - 100 (percent)
91+
7792
What: /sys/class/power_supply/<supply_name>/capacity_level
7893
Date: June 2009
7994
@@ -190,7 +205,7 @@ Description:
190205
Valid values: "Unknown", "Good", "Overheat", "Dead",
191206
"Over voltage", "Unspecified failure", "Cold",
192207
"Watchdog timer expire", "Safety timer expire",
193-
"Over current"
208+
"Over current", "Calibration required"
194209

195210
What: /sys/class/power_supply/<supply_name>/precharge_current
196211
Date: June 2017
@@ -665,3 +680,31 @@ Description:
665680
Valid values:
666681
- 1: enabled
667682
- 0: disabled
683+
684+
What: /sys/class/power_supply/<supply_name>/manufacture_year
685+
Date: January 2020
686+
687+
Description:
688+
Reports the year (following Gregorian calendar) when the device has been
689+
manufactured.
690+
691+
Access: Read
692+
Valid values: Reported as integer
693+
694+
What: /sys/class/power_supply/<supply_name>/manufacture_month
695+
Date: January 2020
696+
697+
Description:
698+
Reports the month when the device has been manufactured.
699+
700+
Access: Read
701+
Valid values: 1-12
702+
703+
What: /sys/class/power_supply/<supply_name>/manufacture_day
704+
Date: January 2020
705+
706+
Description:
707+
Reports the day of month when the device has been manufactured.
708+
709+
Access: Read
710+
Valid values: 1-31

Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.txt

Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/reset/syscon-reboot-mode.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Generic SYSCON reboot mode driver
8+
9+
maintainers:
10+
- Sebastian Reichel <[email protected]>
11+
12+
description: |
13+
This driver gets reboot mode magic value from reboot-mode driver
14+
and stores it in a SYSCON mapped register. Then the bootloader
15+
can read it and take different action according to the magic
16+
value stored. The SYSCON mapped register is retrieved from the
17+
parental dt-node plus the offset. So the SYSCON reboot-mode node
18+
should be represented as a sub-node of a "syscon", "simple-mfd" node.
19+
20+
properties:
21+
compatible:
22+
const: syscon-reboot-mode
23+
24+
mask:
25+
$ref: /schemas/types.yaml#/definitions/uint32
26+
description: Update only the register bits defined by the mask (32 bit)
27+
28+
offset:
29+
$ref: /schemas/types.yaml#/definitions/uint32
30+
description: Offset in the register map for the mode register (in bytes)
31+
32+
patternProperties:
33+
"^mode-.+":
34+
$ref: /schemas/types.yaml#/definitions/uint32
35+
description: Vendor-specific mode value written to the mode register
36+
37+
additionalProperties: false
38+
39+
required:
40+
- compatible
41+
- offset
42+
43+
examples:
44+
- |
45+
#include <dt-bindings/soc/rockchip,boot-mode.h>
46+
47+
reboot-mode {
48+
compatible = "syscon-reboot-mode";
49+
offset = <0x40>;
50+
mode-normal = <BOOT_NORMAL>;
51+
mode-recovery = <BOOT_RECOVERY>;
52+
mode-bootloader = <BOOT_FASTBOOT>;
53+
mode-loader = <BOOT_BL_DOWNLOAD>;
54+
};
55+
...

Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ maintainers:
1212
description: |+
1313
This is a generic reset driver using syscon to map the reset register.
1414
The reset is generally performed with a write to the reset register
15-
defined by the register map pointed by syscon reference plus the offset
16-
with the value and mask defined in the reboot node.
17-
Default will be little endian mode, 32 bit access only.
15+
defined by the SYSCON register map base plus the offset with the value and
16+
mask defined in the reboot node. Default will be little endian mode, 32 bit
17+
access only. The SYSCON registers map is normally retrieved from the
18+
parental dt-node. So the SYSCON reboot node should be represented as a
19+
sub-node of a "syscon", "simple-mfd" node. Though the regmap property
20+
pointing to the system controller node is also supported.
1821
1922
properties:
2023
compatible:
@@ -30,15 +33,17 @@ properties:
3033

3134
regmap:
3235
$ref: /schemas/types.yaml#/definitions/phandle
33-
description: Phandle to the register map node.
36+
deprecated: true
37+
description: |
38+
Phandle to the register map node. This property is deprecated in favor of
39+
the syscon-reboot node been a child of a system controller node.
3440
3541
value:
3642
$ref: /schemas/types.yaml#/definitions/uint32
3743
description: The reset value written to the reboot register (32 bit access).
3844

3945
required:
4046
- compatible
41-
- regmap
4247
- offset
4348

4449
additionalProperties: false

Documentation/devicetree/bindings/power/supply/battery.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,21 @@ different type. This prevents unpredictable, potentially harmful,
1111
behavior should a replacement that changes the battery type occur
1212
without a corresponding update to the dtb.
1313

14+
Please note that not all charger drivers respect all of the properties.
15+
1416
Required Properties:
1517
- compatible: Must be "simple-battery"
1618

1719
Optional Properties:
20+
- over-voltage-threshold-microvolt: battery over-voltage limit
21+
- re-charge-voltage-microvolt: limit to automatically start charging again
1822
- voltage-min-design-microvolt: drained battery voltage
1923
- voltage-max-design-microvolt: fully charged battery voltage
2024
- energy-full-design-microwatt-hours: battery design energy
2125
- charge-full-design-microamp-hours: battery design capacity
26+
- trickle-charge-current-microamp: current for trickle-charge phase
2227
- precharge-current-microamp: current for pre-charge phase
28+
- precharge-upper-limit-microvolt: limit when to change to constant charging
2329
- charge-term-current-microamp: current for charge termination phase
2430
- constant-charge-current-max-microamp: maximum constant input current
2531
- constant-charge-voltage-max-microvolt: maximum constant input voltage

Documentation/devicetree/bindings/power/supply/bq27xxx.txt

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
# Copyright (C) 2020 Texas Instruments Incorporated
3+
%YAML 1.2
4+
---
5+
$id: "http://devicetree.org/schemas/power/supply/bq27xxx.yaml#"
6+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7+
8+
title: TI BQ27XXX fuel gauge family
9+
10+
maintainers:
11+
- Pali Rohár <[email protected]>
12+
- Andrew F. Davis <[email protected]>
13+
- Sebastian Reichel <[email protected]>
14+
15+
description: |
16+
Support various Texas Instruments fuel gauge devices that share similar
17+
register maps and power supply properties
18+
19+
allOf:
20+
- $ref: power-supply.yaml#
21+
22+
properties:
23+
compatible:
24+
enum:
25+
- ti,bq27200
26+
- ti,bq27210
27+
- ti,bq27500 # deprecated, use revision specific property below
28+
- ti,bq27510 # deprecated, use revision specific property below
29+
- ti,bq27520 # deprecated, use revision specific property below
30+
- ti,bq27500-1
31+
- ti,bq27510g1
32+
- ti,bq27510g2
33+
- ti,bq27510g3
34+
- ti,bq27520g1
35+
- ti,bq27520g2
36+
- ti,bq27520g3
37+
- ti,bq27520g4
38+
- ti,bq27521
39+
- ti,bq27530
40+
- ti,bq27531
41+
- ti,bq27541
42+
- ti,bq27542
43+
- ti,bq27546
44+
- ti,bq27742
45+
- ti,bq27545
46+
- ti,bq27411
47+
- ti,bq27421
48+
- ti,bq27425
49+
- ti,bq27426
50+
- ti,bq27441
51+
- ti,bq27621
52+
53+
reg:
54+
maxItems: 1
55+
description: integer, I2C address of the fuel gauge.
56+
57+
monitored-battery:
58+
description: |
59+
phandle of battery characteristics node.
60+
The fuel gauge uses the following battery properties:
61+
- energy-full-design-microwatt-hours
62+
- charge-full-design-microamp-hours
63+
- voltage-min-design-microvolt
64+
Both or neither of the *-full-design-*-hours properties must be set.
65+
See Documentation/devicetree/bindings/power/supply/battery.txt
66+
67+
power-supplies: true
68+
69+
required:
70+
- compatible
71+
- reg
72+
additionalProperties: false
73+
74+
examples:
75+
- |
76+
i2c0 {
77+
#address-cells = <1>;
78+
#size-cells = <0>;
79+
bat: battery {
80+
compatible = "simple-battery";
81+
voltage-min-design-microvolt = <3200000>;
82+
energy-full-design-microwatt-hours = <5290000>;
83+
charge-full-design-microamp-hours = <1430000>;
84+
};
85+
86+
bq27510g3: fuel-gauge@55 {
87+
compatible = "ti,bq27510g3";
88+
reg = <0x55>;
89+
monitored-battery = <&bat>;
90+
};
91+
};

0 commit comments

Comments
 (0)