Skip to content

Commit 449dc8c

Browse files
committed
Merge tag 'for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply and reset updates from Sebastian Reichel: "Power-supply core: - add COOL/WARM/HOT state from JEITA JISC8712:2015 specification - convert simple-battery DT binding to YAML - add long-life charging mode Battery/charger drivers: - bq25150: new charger driver - bq27xxx: add support for BQ27z561 and BQ28z610 - max17040: support CAPACITY_ALERT_MIN - sbs-battery: add PEC support - wilco-ec: support long-life charging mode - bq25890: fix DT binding - misc. fixes and cleanups Reset drivers: - linkstation: new reset driver" * tag 'for-v5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (32 commits) power: supply: wilco_ec: Add long life charging mode power: supply: bq27xxx_battery: Add the BQ28z610 Battery monitor dt-bindings: power: Add BQ28z610 compatible power: supply: bq27xxx_battery: Add the BQ27Z561 Battery monitor dt-bindings: power: Add BQ27Z561 compatible power: supply: test_power: Fix battery_current initial value power: supply: Fix kerneldoc of power_supply_temp2resist_simple() power: supply: cpcap-battery: Fix kerneldoc of cpcap_battery_read_accumulated() dt-bindings: power: Convert battery.txt to battery.yaml power: supply: rt5033_battery: Fix error code in rt5033_battery_probe() power: supply: max17040: Add POWER_SUPPLY_PROP_CAPACITY_ALERT_MIN power: supply: check if calc_soc succeeded in pm860x_init_battery power: supply: bq2xxxx: Replace HTTP links with HTTPS ones power: reset: add driver for LinkStation power off power: supply: sc27xx: prevent adc * 1000 from overflow math64: New DIV_S64_ROUND_CLOSEST helper power: fix duplicated words in bq2415x_charger.h power: Convert to DEFINE_SHOW_ATTRIBUTE power: reset: keystone-reset: Replace HTTP links with HTTPS ones power: supply: bq25150 introduce the bq25150 ...
2 parents b79675e + 46cbd0b commit 449dc8c

40 files changed

+2044
-219
lines changed

Documentation/ABI/testing/sysfs-class-power

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ Description:
205205
Valid values: "Unknown", "Good", "Overheat", "Dead",
206206
"Over voltage", "Unspecified failure", "Cold",
207207
"Watchdog timer expire", "Safety timer expire",
208-
"Over current", "Calibration required"
208+
"Over current", "Calibration required", "Warm",
209+
"Cool", "Hot"
209210

210211
What: /sys/class/power_supply/<supply_name>/precharge_current
211212
Date: June 2017

Documentation/ABI/testing/sysfs-class-power-wilco

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ Description:
1414
Charging begins when level drops below
1515
charge_control_start_threshold, and ceases when
1616
level is above charge_control_end_threshold.
17+
Long Life: Customized charge rate for last longer battery life.
18+
On Wilco device this mode is pre-configured in the factory
19+
through EC's private PID. Swiching to a different mode will
20+
be denied by Wilco EC when Long Life mode is enabled.
1721

1822
What: /sys/class/power_supply/wilco-charger/charge_control_start_threshold
1923
Date: April 2019
Lines changed: 1 addition & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,3 @@
1-
Battery Characteristics
2-
3-
The devicetree battery node provides static battery characteristics.
4-
In smart batteries, these are typically stored in non-volatile memory
5-
on a fuel gauge chip. The battery node should be used where there is
6-
no appropriate non-volatile memory, or it is unprogrammed/incorrect.
7-
8-
Upstream dts files should not include battery nodes, unless the battery
9-
represented cannot easily be replaced in the system by one of a
10-
different type. This prevents unpredictable, potentially harmful,
11-
behavior should a replacement that changes the battery type occur
12-
without a corresponding update to the dtb.
1+
The contents of this file has been moved to battery.yaml
132

143
Please note that not all charger drivers respect all of the properties.
15-
16-
Required Properties:
17-
- compatible: Must be "simple-battery"
18-
19-
Optional Properties:
20-
- over-voltage-threshold-microvolt: battery over-voltage limit
21-
- re-charge-voltage-microvolt: limit to automatically start charging again
22-
- voltage-min-design-microvolt: drained battery voltage
23-
- voltage-max-design-microvolt: fully charged battery voltage
24-
- energy-full-design-microwatt-hours: battery design energy
25-
- charge-full-design-microamp-hours: battery design capacity
26-
- trickle-charge-current-microamp: current for trickle-charge phase
27-
- precharge-current-microamp: current for pre-charge phase
28-
- precharge-upper-limit-microvolt: limit when to change to constant charging
29-
- charge-term-current-microamp: current for charge termination phase
30-
- constant-charge-current-max-microamp: maximum constant input current
31-
- constant-charge-voltage-max-microvolt: maximum constant input voltage
32-
- factory-internal-resistance-micro-ohms: battery factory internal resistance
33-
- ocv-capacity-table-0: An array providing the open circuit voltage (OCV)
34-
of the battery and corresponding battery capacity percent, which is used
35-
to look up battery capacity according to current OCV value. And the open
36-
circuit voltage unit is microvolt.
37-
- ocv-capacity-table-1: Same as ocv-capacity-table-0
38-
......
39-
- ocv-capacity-table-n: Same as ocv-capacity-table-0
40-
- ocv-capacity-celsius: An array containing the temperature in degree Celsius,
41-
for each of the battery capacity lookup table. The first temperature value
42-
specifies the OCV table 0, and the second temperature value specifies the
43-
OCV table 1, and so on.
44-
- resistance-temp-table: An array providing the temperature in degree Celsius
45-
and corresponding battery internal resistance percent, which is used to look
46-
up the resistance percent according to current temperature to get a accurate
47-
batterty internal resistance in different temperatures.
48-
49-
Battery properties are named, where possible, for the corresponding
50-
elements in enum power_supply_property, defined in
51-
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/linux/power_supply.h
52-
53-
Batteries must be referenced by chargers and/or fuel-gauges
54-
using a phandle. The phandle's property should be named
55-
"monitored-battery".
56-
57-
Example:
58-
59-
bat: battery {
60-
compatible = "simple-battery";
61-
voltage-min-design-microvolt = <3200000>;
62-
voltage-max-design-microvolt = <4200000>;
63-
energy-full-design-microwatt-hours = <5290000>;
64-
charge-full-design-microamp-hours = <1430000>;
65-
precharge-current-microamp = <256000>;
66-
charge-term-current-microamp = <128000>;
67-
constant-charge-current-max-microamp = <900000>;
68-
constant-charge-voltage-max-microvolt = <4200000>;
69-
factory-internal-resistance-micro-ohms = <250000>;
70-
ocv-capacity-celsius = <(-10) 0 10>;
71-
ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>, ...;
72-
ocv-capacity-table-1 = <4200000 100>, <4185000 95>, <4113000 90>, ...;
73-
ocv-capacity-table-2 = <4250000 100>, <4200000 95>, <4185000 90>, ...;
74-
resistance-temp-table = <20 100>, <10 90>, <0 80>, <(-10) 60>;
75-
};
76-
77-
charger: charger@11 {
78-
....
79-
monitored-battery = <&bat>;
80-
...
81-
};
82-
83-
fuel_gauge: fuel-gauge@22 {
84-
....
85-
monitored-battery = <&bat>;
86-
...
87-
};
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/supply/battery.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Battery Characteristics
8+
9+
maintainers:
10+
- Sebastian Reichel <[email protected]>
11+
12+
description: |
13+
The devicetree battery node provides static battery characteristics.
14+
In smart batteries, these are typically stored in non-volatile memory
15+
on a fuel gauge chip. The battery node should be used where there is
16+
no appropriate non-volatile memory, or it is unprogrammed/incorrect.
17+
18+
Upstream dts files should not include battery nodes, unless the battery
19+
represented cannot easily be replaced in the system by one of a
20+
different type. This prevents unpredictable, potentially harmful,
21+
behavior should a replacement that changes the battery type occur
22+
without a corresponding update to the dtb.
23+
24+
Battery properties are named, where possible, for the corresponding elements
25+
in enum power_supply_property, defined in include/linux/power_supply.h
26+
27+
Batteries must be referenced by chargers and/or fuel-gauges using a phandle.
28+
The phandle's property should be named "monitored-battery".
29+
30+
properties:
31+
compatible:
32+
const: simple-battery
33+
34+
over-voltage-threshold-microvolt:
35+
description: battery over-voltage limit
36+
37+
re-charge-voltage-microvolt:
38+
description: limit to automatically start charging again
39+
40+
voltage-min-design-microvolt:
41+
description: drained battery voltage
42+
43+
voltage-max-design-microvolt:
44+
description: fully charged battery voltage
45+
46+
energy-full-design-microwatt-hours:
47+
description: battery design energy
48+
49+
charge-full-design-microamp-hours:
50+
description: battery design capacity
51+
52+
trickle-charge-current-microamp:
53+
description: current for trickle-charge phase
54+
55+
precharge-current-microamp:
56+
description: current for pre-charge phase
57+
58+
precharge-upper-limit-microvolt:
59+
description: limit when to change to constant charging
60+
61+
charge-term-current-microamp:
62+
description: current for charge termination phase
63+
64+
constant-charge-current-max-microamp:
65+
description: maximum constant input current
66+
67+
constant-charge-voltage-max-microvolt:
68+
description: maximum constant input voltage
69+
70+
factory-internal-resistance-micro-ohms:
71+
description: battery factory internal resistance
72+
73+
resistance-temp-table:
74+
description: |
75+
An array providing the temperature in degree Celsius
76+
and corresponding battery internal resistance percent, which is used to
77+
look up the resistance percent according to current temperature to get an
78+
accurate batterty internal resistance in different temperatures.
79+
80+
ocv-capacity-celsius:
81+
description: |
82+
An array containing the temperature in degree Celsius,
83+
for each of the battery capacity lookup table.
84+
85+
required:
86+
- compatible
87+
88+
patternProperties:
89+
'^ocv-capacity-table-[0-9]+$':
90+
$ref: /schemas/types.yaml#/definitions/uint32-matrix
91+
description: |
92+
An array providing the open circuit voltage (OCV)
93+
of the battery and corresponding battery capacity percent, which is used
94+
to look up battery capacity according to current OCV value. And the open
95+
circuit voltage unit is microvolt.
96+
maxItems: 100
97+
items:
98+
items:
99+
- description: open circuit voltage (OCV) in microvolts
100+
- description: battery capacity percent
101+
maximum: 100
102+
103+
additionalProperties: false
104+
105+
examples:
106+
- |
107+
power {
108+
#address-cells = <1>;
109+
#size-cells = <0>;
110+
111+
battery: battery {
112+
compatible = "simple-battery";
113+
over-voltage-threshold-microvolt = <4500000>;
114+
re-charge-voltage-microvolt = <250000>;
115+
voltage-min-design-microvolt = <3200000>;
116+
voltage-max-design-microvolt = <4200000>;
117+
energy-full-design-microwatt-hours = <5290000>;
118+
charge-full-design-microamp-hours = <1430000>;
119+
precharge-current-microamp = <256000>;
120+
precharge-upper-limit-microvolt = <2500000>;
121+
charge-term-current-microamp = <128000>;
122+
constant-charge-current-max-microamp = <900000>;
123+
constant-charge-voltage-max-microvolt = <4200000>;
124+
factory-internal-resistance-micro-ohms = <250000>;
125+
ocv-capacity-celsius = <(-10) 0 10>;
126+
/* table for -10 degree Celsius */
127+
ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>;
128+
/* table for 0 degree Celsius */
129+
ocv-capacity-table-1 = <4200000 100>, <4185000 95>, <4113000 90>;
130+
/* table for 10 degree Celsius */
131+
ocv-capacity-table-2 = <4250000 100>, <4200000 95>, <4185000 90>;
132+
resistance-temp-table = <20 100>, <10 90>, <0 80>, <(-10) 60>;
133+
};
134+
135+
charger@11 {
136+
reg = <0x11>;
137+
monitored-battery = <&battery>;
138+
};
139+
140+
fuel-gauge@22 {
141+
reg = <0x22>;
142+
monitored-battery = <&battery>;
143+
};
144+
};
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+
# Copyright (C) 2020 Texas Instruments Incorporated
3+
%YAML 1.2
4+
---
5+
$id: "http://devicetree.org/schemas/power/supply/bq2515x.yaml#"
6+
$schema: "http://devicetree.org/meta-schemas/core.yaml#"
7+
8+
title: TI bq2515x 500-mA Linear charger family
9+
10+
maintainers:
11+
- Dan Murphy <[email protected]>
12+
- Ricardo Rivera-Matos <[email protected]>
13+
14+
description: |
15+
The BQ2515x family is a highly integrated battery charge management IC that
16+
integrates the most common functions for wearable devices, namely a charger,
17+
an output voltage rail, ADC for battery and system monitoring, and
18+
push-button controller.
19+
20+
Specifications about the charger can be found at:
21+
http://www.ti.com/lit/ds/symlink/bq25150.pdf
22+
http://www.ti.com/lit/ds/symlink/bq25155.pdf
23+
24+
properties:
25+
compatible:
26+
enum:
27+
- ti,bq25150
28+
- ti,bq25155
29+
30+
reg:
31+
maxItems: 1
32+
description: I2C address of the charger.
33+
34+
ac-detect-gpios:
35+
description: |
36+
GPIO used for connecting the bq2515x device PG (AC Detect)
37+
pin.
38+
maxItems: 1
39+
40+
reset-gpios:
41+
description: GPIO used for hardware reset.
42+
maxItems: 1
43+
44+
powerdown-gpios:
45+
description: GPIO used for low power mode of IC.
46+
maxItems: 1
47+
48+
charge-enable-gpios:
49+
description: GPIO used to turn on and off charging.
50+
maxItems: 1
51+
52+
input-current-limit-microamp:
53+
$ref: /schemas/types.yaml#/definitions/uint32
54+
description: Maximum input current in micro Amps.
55+
minimum: 50000
56+
maximum: 500000
57+
58+
monitored-battery:
59+
$ref: /schemas/types.yaml#/definitions/phandle
60+
description: phandle to the battery node being monitored
61+
62+
required:
63+
- compatible
64+
- reg
65+
- monitored-battery
66+
67+
additionalProperties: false
68+
69+
examples:
70+
- |
71+
bat: battery {
72+
compatible = "simple-battery";
73+
constant-charge-current-max-microamp = <50000>;
74+
precharge-current-microamp = <2500>;
75+
constant-charge-voltage-max-microvolt = <4000000>;
76+
};
77+
#include <dt-bindings/gpio/gpio.h>
78+
i2c0 {
79+
#address-cells = <1>;
80+
#size-cells = <0>;
81+
82+
bq25150: charger@6b {
83+
compatible = "ti,bq25150";
84+
reg = <0x6b>;
85+
monitored-battery = <&bat>;
86+
input-current-limit-microamp = <100000>;
87+
88+
ac-detect-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
89+
reset-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
90+
powerdown-gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
91+
charge-enable-gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
92+
};
93+
};

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

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Required properties:
1010
* "ti,bq25895"
1111
* "ti,bq25896"
1212
- reg: integer, i2c address of the device.
13+
- interrupts: interrupt line;
1314
- ti,battery-regulation-voltage: integer, maximum charging voltage (in uV);
1415
- ti,charge-current: integer, maximum charging current (in uA);
1516
- ti,termination-current: integer, charge will be terminated when current in
@@ -36,17 +37,20 @@ Optional properties:
3637
Example:
3738

3839
bq25890 {
39-
compatible = "ti,bq25890";
40-
reg = <0x6a>;
41-
42-
ti,battery-regulation-voltage = <4200000>;
43-
ti,charge-current = <1000000>;
44-
ti,termination-current = <50000>;
45-
ti,precharge-current = <128000>;
46-
ti,minimum-sys-voltage = <3600000>;
47-
ti,boost-voltage = <5000000>;
48-
ti,boost-max-current = <1000000>;
49-
50-
ti,use-ilim-pin;
51-
ti,thermal-regulation-threshold = <120>;
40+
compatible = "ti,bq25890";
41+
reg = <0x6a>;
42+
43+
interrupt-parent = <&gpio1>;
44+
interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
45+
46+
ti,battery-regulation-voltage = <4200000>;
47+
ti,charge-current = <1000000>;
48+
ti,termination-current = <50000>;
49+
ti,precharge-current = <128000>;
50+
ti,minimum-sys-voltage = <3600000>;
51+
ti,boost-voltage = <5000000>;
52+
ti,boost-max-current = <1000000>;
53+
54+
ti,use-ilim-pin;
55+
ti,thermal-regulation-threshold = <120>;
5256
};

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ properties:
4949
- ti,bq27426
5050
- ti,bq27441
5151
- ti,bq27621
52+
- ti,bq27z561
53+
- ti,bq28z610
5254

5355
reg:
5456
maxItems: 1

0 commit comments

Comments
 (0)