Skip to content

Commit f9ae180

Browse files
committed
Merge tag 'for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply and reset updates from Sebastian Reichel: "Core changes: - propagate of_node to child device - change from atomic to blocking notifier_call_chain New drivers: - pm8916 battery management system - mm8013 fuel gauge New features: - maxim max17040: add temperature support - gpio-poweroff: make priority configurable Cleanups: - simplify reset drivers using builtin_platform_driver() - convert all platform drivers to remove_new callback - replace all strncpy occurrences with strscpy - started converting drivers to i2c_get_match_data() - misc fixes and cleanups" * tag 'for-v6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (91 commits) power: reset: vexpress: Use device_get_match_data() power: supply: surface-charger: replace deprecated strncpy with strscpy power: supply: surface_battery: replace deprecated strncpy with strscpy power: supply: charger-manager: replace deprecated strncpy with strscpy power: supply: bq25980: replace deprecated strncpy with strscpy power: supply: bq256xx: replace deprecated strncpy with strscpy power: supply: bq2515x: replace deprecated strncpy with strscpy power: supply: bq24190_charger: replace deprecated strncpy with strscpy power: supply: cpcap: Drop non-DT driver matching power: reset: brcmstb: Depend on actual SoC dependencies power: reset: gpio-poweroff: make sys handler priority configurable dt-bindings: power: reset: gpio-poweroff: Add priority property power: reset: gpio-poweroff: use sys-off handler API power: reset: gpio-poweroff: use a struct to store the module variables power: supply: rt5033_charger: Replace "&pdev->dev" by "charger->dev" in probe power: supply: rt5033_charger: Simplify initialization of rt5033_charger_data power: supply: rt5033_charger: Add cable detection and USB OTG supply power: supply: core: remove opencoded string_lower() dt-bindings: power: supply: sbs-manager: Add missing unevaluatedProperties on child node schemas power: supply: mm8013: Fix an error checking issue in mm8013_checkdevice() ...
2 parents fe4ae2f + 469d317 commit f9ae180

Some content is hidden

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

76 files changed

+1946
-418
lines changed

Documentation/devicetree/bindings/power/reset/gpio-poweroff.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ description: >
1818
Finally the operating system assumes the power off failed if
1919
the system is still running after waiting some time (timeout-ms).
2020
21+
allOf:
22+
- $ref: restart-handler.yaml#
23+
2124
properties:
2225
compatible:
2326
const: gpio-poweroff
@@ -40,6 +43,9 @@ properties:
4043
default: 100
4144
description: Delay to wait after driving gpio inactive
4245

46+
priority:
47+
default: 0
48+
4349
timeout-ms:
4450
default: 3000
4551
description: Time to wait before assuming the power off sequence failed.

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ description: |+
1515
defined by the register map pointed by syscon reference plus the offset
1616
with the value and mask defined in the poweroff node.
1717
Default will be little endian mode, 32 bit access only.
18+
The SYSCON register map is normally retrieved from the parental dt-node. So
19+
the SYSCON poweroff node should be represented as a sub-node of a "syscon",
20+
"simple-mfd" node.
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-poweroff node being a child of a system controller node.
3440

3541
value:
3642
$ref: /schemas/types.yaml#/definitions/uint32
3743
description: The poweroff value written to the poweroff register (32 bit access).
3844

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

4449
additionalProperties: false
@@ -56,7 +61,6 @@ examples:
5661
- |
5762
poweroff {
5863
compatible = "syscon-poweroff";
59-
regmap = <&regmapnode>;
6064
offset = <0x0>;
6165
mask = <0x7a>;
6266
};

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ properties:
5555
interrupts:
5656
maxItems: 1
5757

58+
io-channels:
59+
items:
60+
- description: battery temperature
61+
62+
io-channel-names:
63+
items:
64+
- const: temp
65+
5866
wakeup-source:
5967
type: boolean
6068
description: |
@@ -95,3 +103,26 @@ examples:
95103
wakeup-source;
96104
};
97105
};
106+
- |
107+
#include <dt-bindings/interrupt-controller/irq.h>
108+
i2c {
109+
#address-cells = <1>;
110+
#size-cells = <0>;
111+
112+
fuel-gauge@36 {
113+
compatible = "maxim,max17043";
114+
reg = <0x36>;
115+
116+
interrupt-parent = <&gpio>;
117+
interrupts = <144 IRQ_TYPE_EDGE_FALLING>;
118+
119+
monitored-battery = <&battery>;
120+
power-supplies = <&charger>;
121+
122+
io-channels = <&adc 8>;
123+
io-channel-names = "temp";
124+
125+
maxim,alert-low-soc-level = <10>;
126+
wakeup-source;
127+
};
128+
};
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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/mitsumi,mm8013.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Mitsumi MM8013 fuel gauge
8+
9+
maintainers:
10+
- Konrad Dybcio <konradybcio@kernel.org>
11+
12+
allOf:
13+
- $ref: power-supply.yaml#
14+
15+
properties:
16+
compatible:
17+
const: mitsumi,mm8013
18+
19+
reg:
20+
maxItems: 1
21+
22+
required:
23+
- compatible
24+
- reg
25+
26+
additionalProperties: false
27+
28+
examples:
29+
- |
30+
i2c {
31+
#address-cells = <1>;
32+
#size-cells = <0>;
33+
34+
fuel-gauge@55 {
35+
compatible = "mitsumi,mm8013";
36+
reg = <0x55>;
37+
};
38+
};
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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/qcom,pm8916-bms-vm.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm Voltage Mode BMS
8+
9+
maintainers:
10+
- Nikita Travkin <nikita@trvn.ru>
11+
12+
description:
13+
Voltage Mode BMS is a hardware block found in some Qualcomm PMICs
14+
such as pm8916. This block performs battery voltage monitoring.
15+
16+
allOf:
17+
- $ref: power-supply.yaml#
18+
19+
properties:
20+
compatible:
21+
const: qcom,pm8916-bms-vm
22+
23+
reg:
24+
maxItems: 1
25+
26+
interrupts:
27+
items:
28+
- description: BMS FSM left S3 mode
29+
- description: BMS FSM entered S2 mode
30+
- description: OCV measured in S3 mode
31+
- description: OCV below threshold
32+
- description: FIFO update done
33+
- description: BMS FSM switched state
34+
35+
interrupt-names:
36+
items:
37+
- const: cv_leave
38+
- const: cv_enter
39+
- const: ocv_good
40+
- const: ocv_thr
41+
- const: fifo
42+
- const: state_chg
43+
44+
monitored-battery: true
45+
46+
power-supplies: true
47+
48+
required:
49+
- compatible
50+
- reg
51+
- interrupts
52+
- interrupt-names
53+
- monitored-battery
54+
55+
additionalProperties: false
56+
57+
examples:
58+
- |
59+
#include <dt-bindings/interrupt-controller/irq.h>
60+
pmic {
61+
#address-cells = <1>;
62+
#size-cells = <0>;
63+
64+
battery@4000 {
65+
compatible = "qcom,pm8916-bms-vm";
66+
reg = <0x4000>;
67+
interrupts = <0x0 0x40 0 IRQ_TYPE_EDGE_RISING>,
68+
<0x0 0x40 1 IRQ_TYPE_EDGE_RISING>,
69+
<0x0 0x40 2 IRQ_TYPE_EDGE_RISING>,
70+
<0x0 0x40 3 IRQ_TYPE_EDGE_RISING>,
71+
<0x0 0x40 4 IRQ_TYPE_EDGE_RISING>,
72+
<0x0 0x40 5 IRQ_TYPE_EDGE_RISING>;
73+
interrupt-names = "cv_leave",
74+
"cv_enter",
75+
"ocv_good",
76+
"ocv_thr",
77+
"fifo",
78+
"state_chg";
79+
80+
monitored-battery = <&battery>;
81+
power-supplies = <&pm8916_charger>;
82+
};
83+
};
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
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/qcom,pm8916-lbc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm Linear Battery Charger
8+
9+
maintainers:
10+
- Nikita Travkin <nikita@trvn.ru>
11+
12+
description:
13+
Linear Battery Charger hardware block, found in some Qualcomm PMICs
14+
such as pm8916. Implements a simple, autonomous CC/CV charger.
15+
16+
allOf:
17+
- $ref: power-supply.yaml#
18+
19+
properties:
20+
compatible:
21+
const: qcom,pm8916-lbc
22+
23+
reg:
24+
items:
25+
- description: Charger
26+
- description: Battery
27+
- description: USB
28+
- description: MISC
29+
30+
reg-names:
31+
items:
32+
- const: chgr
33+
- const: bat_if
34+
- const: usb
35+
- const: misc
36+
37+
interrupts:
38+
items:
39+
- description: Battery detection
40+
- description: Fast charging
41+
- description: Charging failed
42+
- description: Charging done
43+
- description: Battery present
44+
- description: Battery temperature OK
45+
- description: USB coarse detection
46+
- description: USB IN valid
47+
- description: Charger gone
48+
- description: Overtemperature
49+
50+
interrupt-names:
51+
items:
52+
- const: vbat_det
53+
- const: fast_chg
54+
- const: chg_fail
55+
- const: chg_done
56+
- const: bat_pres
57+
- const: temp_ok
58+
- const: coarse_det
59+
- const: usb_vbus
60+
- const: chg_gone
61+
- const: overtemp
62+
63+
qcom,fast-charge-safe-voltage:
64+
$ref: /schemas/types.yaml#/definitions/uint32
65+
minimum: 4000000
66+
maximum: 4775000
67+
description:
68+
Maximum safe battery voltage in uV; May be pre-set by bootloader,
69+
in which case, setting this will harmlessly fail.
70+
71+
qcom,fast-charge-safe-current:
72+
$ref: /schemas/types.yaml#/definitions/uint32
73+
minimum: 90000
74+
maximum: 1440000
75+
description:
76+
Maximum safe battery charge current in uA; May be pre-set by
77+
bootloader, in which case setting this will harmlessly fail.
78+
79+
monitored-battery: true
80+
81+
required:
82+
- compatible
83+
- reg
84+
- interrupts
85+
- interrupt-names
86+
- qcom,fast-charge-safe-voltage
87+
- qcom,fast-charge-safe-current
88+
89+
additionalProperties: false
90+
91+
examples:
92+
- |
93+
#include <dt-bindings/interrupt-controller/irq.h>
94+
pmic {
95+
#address-cells = <1>;
96+
#size-cells = <0>;
97+
98+
charger@1000 {
99+
compatible = "qcom,pm8916-lbc";
100+
reg = <0x1000>, <0x1200>, <0x1300>, <0x1600>;
101+
reg-names = "chgr", "bat_if", "usb", "misc";
102+
103+
interrupts = <0x0 0x10 0 IRQ_TYPE_EDGE_BOTH>,
104+
<0x0 0x10 5 IRQ_TYPE_EDGE_BOTH>,
105+
<0x0 0x10 6 IRQ_TYPE_EDGE_BOTH>,
106+
<0x0 0x10 7 IRQ_TYPE_EDGE_BOTH>,
107+
<0x0 0x12 0 IRQ_TYPE_EDGE_BOTH>,
108+
<0x0 0x12 1 IRQ_TYPE_EDGE_BOTH>,
109+
<0x0 0x13 0 IRQ_TYPE_EDGE_BOTH>,
110+
<0x0 0x13 1 IRQ_TYPE_EDGE_BOTH>,
111+
<0x0 0x13 2 IRQ_TYPE_EDGE_BOTH>,
112+
<0x0 0x13 4 IRQ_TYPE_EDGE_BOTH>;
113+
interrupt-names = "vbat_det",
114+
"fast_chg",
115+
"chg_fail",
116+
"chg_done",
117+
"bat_pres",
118+
"temp_ok",
119+
"coarse_det",
120+
"usb_vbus",
121+
"chg_gone",
122+
"overtemp";
123+
monitored-battery = <&battery>;
124+
125+
qcom,fast-charge-safe-current = <900000>;
126+
qcom,fast-charge-safe-voltage = <4300000>;
127+
};
128+
};

Documentation/devicetree/bindings/power/supply/sbs,sbs-manager.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ patternProperties:
4747
"^i2c@[1-4]$":
4848
type: object
4949
$ref: /schemas/i2c/i2c-controller.yaml#
50+
unevaluatedProperties: false
51+
52+
properties:
53+
reg:
54+
minimum: 1
55+
maximum: 4
5056

5157
examples:
5258
- |

Documentation/devicetree/bindings/power/supply/stericsson,ab8500-battery.txt

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)