Skip to content

Commit 72e65f7

Browse files
committed
Merge tag 'for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply and reset updates from Sebastian Reichel: "Miscellaneous small fixes and improvements all over the place. Nothing stands out in particular" * tag 'for-v5.16' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (30 commits) power: supply: bq25890: Fix initial setting of the F_CONV_RATE field power: supply: bq25890: Fix race causing oops at boot power: supply: bq27xxx: Fix kernel crash on IRQ handler register error power: bq25890: add return values to error messages power: supply: axp288-charger: Simplify axp288_get_charger_health() power: supply: axp288-charger: Remove unnecessary is_present and is_online helpers power: supply: axp288-charger: Add depends on IOSF_MBIO to Kconfig power: supply: ab8500_bmdata: Use standard phandle dt-bindings: power: supply: ab8500: Standard monitored-battery power: supply: axp288_charger: Fix missing mutex_init() power: supply: max17042_battery: Prevent int underflow in set_soc_threshold power: supply: max17042_battery: Clear status bits in interrupt handler MAINTAINERS: power: supply: max17040: add entry with reviewers MAINTAINERS: power: supply: max17042: add entry with reviewers power: supply: max17040: fix null-ptr-deref in max17040_probe() power: supply: rt5033_battery: Change voltage values to µV power: supply: axp288-charger: Optimize register reading method dt-bindings: power: Bindings for Samsung batteries power: supply: cpcap-battery: use device_get_match_data() to simplify code power: supply: max17042_battery: fix typo in MAX17042_IAvg_empty ...
2 parents c1e2e03 + 22ad4f9 commit 72e65f7

22 files changed

+335
-191
lines changed

Documentation/ABI/testing/sysfs-class-power

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,19 @@ Description:
480480

481481
Valid values: Represented in microvolts
482482

483+
What: /sys/class/power_supply/<supply_name>/cycle_count
484+
Date: January 2010
485+
486+
Description:
487+
Reports the number of full charge + discharge cycles the
488+
battery has undergone.
489+
490+
Access: Read
491+
492+
Valid values:
493+
Integer > 0: representing full cycles
494+
Integer = 0: cycle_count info is not available
495+
483496
**USB Properties**
484497

485498
What: /sys/class/power_supply/<supply_name>/input_current_limit

Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ required:
6262
- compatible
6363
- reg
6464

65-
additionalProperties: false
65+
unevaluatedProperties: false
6666

6767
examples:
6868
- |
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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/samsung,battery.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Samsung SDI Batteries
8+
9+
maintainers:
10+
- Linus Walleij <[email protected]>
11+
12+
description: |
13+
Samsung SDI (Samsung Digital Interface) batteries are all different versions
14+
of lithium ion chemistry devices used for mobile phones, laptops and other
15+
portable electronics. The batteries are adapted to a specific product and
16+
the physical restrictions make it impossible to use another battery with the
17+
product, so product device trees can specify these batteries. Operating
18+
systems should determine hardware characteristics of the batteries from the
19+
compatible string.
20+
21+
properties:
22+
compatible:
23+
oneOf:
24+
- const: samsung,eb-l1m7flu
25+
description: 3.8V 1500 mAh battery used in Samsung GT-I8190
26+
- const: samsung,eb425161la
27+
description: 3.8V 1500 mAh battery used in Samsung SGH-T599 and SGH-I407
28+
- const: samsung,eb425161lu
29+
description: 3.8V 1500 mAh battery used in Samsung GT-I8160
30+
- const: samsung,eb485159lu
31+
description: 3.8V 1700 mAh battery used in Samsung GT-S7710
32+
- const: samsung,eb535151vu
33+
description: 3.8V 1500 mAh battery used in Samsung GT-I9070
34+
- const: samsung,eb585157lu
35+
description: 3.8V 2000 mAh battery used in Samsung GT-I8530
36+
37+
required:
38+
- compatible
39+
40+
additionalProperties: false
41+
42+
examples:
43+
- |
44+
power {
45+
#address-cells = <1>;
46+
#size-cells = <0>;
47+
48+
battery: battery {
49+
compatible = "samsung,eb425161la";
50+
};
51+
52+
charger@11 {
53+
reg = <0x11>;
54+
monitored-battery = <&battery>;
55+
};
56+
};

Documentation/devicetree/bindings/power/supply/stericsson,ab8500-btemp.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ properties:
1717
compatible:
1818
const: stericsson,ab8500-btemp
1919

20-
battery:
20+
monitored-battery:
2121
$ref: /schemas/types.yaml#/definitions/phandle
2222
description: phandle to battery node
2323

24+
battery:
25+
$ref: /schemas/types.yaml#/definitions/phandle
26+
deprecated: true
27+
2428
interrupts:
2529
maxItems: 5
2630

@@ -42,7 +46,7 @@ properties:
4246

4347
required:
4448
- compatible
45-
- battery
49+
- monitored-battery
4650
- interrupts
4751
- interrupt-names
4852
- io-channels
@@ -56,7 +60,7 @@ examples:
5660
pmic {
5761
battery-temperature {
5862
compatible = "stericsson,ab8500-btemp";
59-
battery = <&ab8500_battery>;
63+
monitored-battery = <&battery>;
6064
interrupts = <20 IRQ_TYPE_LEVEL_HIGH>,
6165
<80 IRQ_TYPE_LEVEL_HIGH>,
6266
<83 IRQ_TYPE_LEVEL_HIGH>,

Documentation/devicetree/bindings/power/supply/stericsson,ab8500-chargalg.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ properties:
1717
compatible:
1818
const: stericsson,ab8500-chargalg
1919

20-
battery:
20+
monitored-battery:
2121
$ref: /schemas/types.yaml#/definitions/phandle
2222
description: phandle to battery node
2323

24+
battery:
25+
$ref: /schemas/types.yaml#/definitions/phandle
26+
deprecated: true
27+
2428
required:
2529
- compatible
26-
- battery
30+
- monitored-battery
2731

2832
additionalProperties: false
2933

@@ -32,6 +36,6 @@ examples:
3236
pmic {
3337
charging-algorithm {
3438
compatible = "stericsson,ab8500-chargalg";
35-
battery = <&ab8500_battery>;
39+
monitored-battery = <&ab8500_battery>;
3640
};
3741
};

Documentation/devicetree/bindings/power/supply/stericsson,ab8500-charger.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ properties:
1717
compatible:
1818
const: stericsson,ab8500-charger
1919

20-
battery:
20+
monitored-battery:
2121
$ref: /schemas/types.yaml#/definitions/phandle
2222
description: phandle to battery node
2323

24+
battery:
25+
$ref: /schemas/types.yaml#/definitions/phandle
26+
deprecated: true
27+
2428
vddadc-supply:
2529
description: Supply for USB and Main charger
2630

@@ -66,7 +70,7 @@ properties:
6670

6771
required:
6872
- compatible
69-
- battery
73+
- monitored-battery
7074
- vddadc-supply
7175
- interrupts
7276
- interrupt-names
@@ -81,7 +85,7 @@ examples:
8185
pmic {
8286
charger {
8387
compatible = "stericsson,ab8500-charger";
84-
battery = <&ab8500_battery>;
88+
monitored-battery = <&battery>;
8589
vddadc-supply = <&ab8500_ldo_tvout_reg>;
8690
interrupts = <10 IRQ_TYPE_LEVEL_HIGH>,
8791
<11 IRQ_TYPE_LEVEL_HIGH>,

Documentation/devicetree/bindings/power/supply/stericsson,ab8500-fg.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ properties:
1717
compatible:
1818
const: stericsson,ab8500-fg
1919

20-
battery:
20+
monitored-battery:
2121
$ref: /schemas/types.yaml#/definitions/phandle
2222
description: phandle to battery node
2323

24+
battery:
25+
$ref: /schemas/types.yaml#/definitions/phandle
26+
deprecated: true
27+
2428
interrupts:
2529
maxItems: 5
2630

@@ -41,7 +45,7 @@ properties:
4145

4246
required:
4347
- compatible
44-
- battery
48+
- monitored-battery
4549
- interrupts
4650
- interrupt-names
4751
- io-channels
@@ -55,7 +59,7 @@ examples:
5559
pmic {
5660
fuel-gauge {
5761
compatible = "stericsson,ab8500-fg";
58-
battery = <&ab8500_battery>;
62+
monitored-battery = <&battery>;
5963
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
6064
<8 IRQ_TYPE_LEVEL_HIGH>,
6165
<28 IRQ_TYPE_LEVEL_HIGH>,

MAINTAINERS

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11508,6 +11508,27 @@ S: Maintained
1150811508
F: Documentation/devicetree/bindings/iio/proximity/maxbotix,mb1232.yaml
1150911509
F: drivers/iio/proximity/mb1232.c
1151011510

11511+
MAXIM MAX17040 FAMILY FUEL GAUGE DRIVERS
11512+
R: Iskren Chernev <[email protected]>
11513+
R: Krzysztof Kozlowski <[email protected]>
11514+
R: Marek Szyprowski <[email protected]>
11515+
R: Matheus Castello <[email protected]>
11516+
11517+
S: Maintained
11518+
F: Documentation/devicetree/bindings/power/supply/maxim,max17040.yaml
11519+
F: drivers/power/supply/max17040_battery.c
11520+
11521+
MAXIM MAX17042 FAMILY FUEL GAUGE DRIVERS
11522+
R: Hans de Goede <[email protected]>
11523+
R: Krzysztof Kozlowski <[email protected]>
11524+
R: Marek Szyprowski <[email protected]>
11525+
R: Sebastian Krzyszkowiak <[email protected]>
11526+
R: Purism Kernel Team <[email protected]>
11527+
11528+
S: Maintained
11529+
F: Documentation/devicetree/bindings/power/supply/maxim,max17042.yaml
11530+
F: drivers/power/supply/max17042_battery.c
11531+
1151111532
MAXIM MAX77650 PMIC MFD DRIVER
1151211533
M: Bartosz Golaszewski <[email protected]>
1151311534

drivers/power/reset/at91-reset.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
193193
return -ENOMEM;
194194

195195
reset->rstc_base = devm_of_iomap(&pdev->dev, pdev->dev.of_node, 0, NULL);
196-
if (!reset->rstc_base) {
196+
if (IS_ERR(reset->rstc_base)) {
197197
dev_err(&pdev->dev, "Could not map reset controller address\n");
198198
return -ENODEV;
199199
}
@@ -203,7 +203,7 @@ static int __init at91_reset_probe(struct platform_device *pdev)
203203
for_each_matching_node_and_match(np, at91_ramc_of_match, &match) {
204204
reset->ramc_lpr = (u32)match->data;
205205
reset->ramc_base[idx] = devm_of_iomap(&pdev->dev, np, 0, NULL);
206-
if (!reset->ramc_base[idx]) {
206+
if (IS_ERR(reset->ramc_base[idx])) {
207207
dev_err(&pdev->dev, "Could not map ram controller address\n");
208208
of_node_put(np);
209209
return -ENODEV;

drivers/power/reset/ltc2952-poweroff.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ static struct ltc2952_poweroff *ltc2952_data;
9494
*/
9595
static enum hrtimer_restart ltc2952_poweroff_timer_wde(struct hrtimer *timer)
9696
{
97-
ktime_t now;
9897
int state;
9998
struct ltc2952_poweroff *data = to_ltc2952(timer, timer_wde);
10099

@@ -104,8 +103,7 @@ static enum hrtimer_restart ltc2952_poweroff_timer_wde(struct hrtimer *timer)
104103
state = gpiod_get_value(data->gpio_watchdog);
105104
gpiod_set_value(data->gpio_watchdog, !state);
106105

107-
now = hrtimer_cb_get_time(timer);
108-
hrtimer_forward(timer, now, data->wde_interval);
106+
hrtimer_forward_now(timer, data->wde_interval);
109107

110108
return HRTIMER_RESTART;
111109
}

0 commit comments

Comments
 (0)