Skip to content

Commit 59bd5ae

Browse files
committed
Merge tag 'for-v7.1' 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 drivers: - S2MU005: new battery fuel gauge driver - macsmc-power: new driver for Apple Silicon - qcom_battmgr: Add support for Glymur and Kaanapali - max17042: add support for max77759 - qcom_smbx: allow disabling charging - bd71828: add input current limit support - multiple drivers: use new device managed workqueue allocation function - misc small cleanups and fixes Reset core: - Expose sysfs for registered reboot_modes Reset drivers - misc small cleanups and fixes" * tag 'for-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (36 commits) power: supply: qcom_smbx: allow disabling charging power: reset: drop unneeded dependencies on OF_GPIO power: supply: bd71828: add input current limit property dt-bindings: power: reset: cortina,gemini-power-controller: convert to DT schema power: supply: add support for S2MU005 battery fuel gauge device dt-bindings: power: supply: document Samsung S2MU005 battery fuel gauge power: reset: reboot-mode: fix -Wformat-security warning power: supply: ipaq_micro: Simplify with devm power: supply: mt6370: Simplify with devm_alloc_ordered_workqueue() power: supply: max77705: Free allocated workqueue and fix removal order power: supply: max77705: Drop duplicated IRQ error message power: supply: cw2015: Free allocated workqueue power: reset: keystone: Use register_sys_off_handler(SYS_OFF_MODE_RESTART) power: supply: twl4030_madc: Drop unused header includes power: supply: bq24190: Avoid rescheduling after cancelling work power: supply: axp288_charger: Simplify returns of dev_err_probe() power: supply: axp288_charger: Do not cancel work before initializing it power: supply: cpcap-battery: pass static battery cell data from device tree dt-bindings: power: supply: cpcap-battery: document monitored-battery property power: supply: qcom_battmgr: Add support for Glymur and Kaanapali ...
2 parents e0dcd2b + 98d68b7 commit 59bd5ae

28 files changed

Lines changed: 1785 additions & 181 deletions
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
What: /sys/class/reboot-mode/<driver>/reboot_modes
2+
Date: March 2026(TBD)
3+
KernelVersion: TBD
4+
Contact: linux-pm@vger.kernel.org
5+
Description:
6+
This interface exposes the reboot-mode arguments
7+
registered with the reboot-mode framework. It is
8+
a read-only interface and provides a space
9+
separated list of reboot-mode arguments supported
10+
on the current platform.
11+
Example:
12+
recovery fastboot bootloader
13+
14+
The exact sysfs path may vary depending on the
15+
name of the driver that registers the arguments.
16+
Example:
17+
/sys/class/reboot-mode/nvmem-reboot-mode/reboot_modes
18+
/sys/class/reboot-mode/syscon-reboot-mode/reboot_modes
19+
/sys/class/reboot-mode/qcom-pon/reboot_modes
20+
21+
The supported arguments can be used by userspace to
22+
invoke device reset using the standard reboot() system
23+
call interface, with the "argument" as string to "*arg"
24+
parameter along with LINUX_REBOOT_CMD_RESTART2.
25+
26+
A driver can expose the supported arguments by
27+
registering them with the reboot-mode framework
28+
using the property names that follow the
29+
mode-<argument> format.
30+
Example:
31+
mode-bootloader, mode-recovery.
32+
33+
This attribute is useful for scripts or initramfs
34+
logic that need to programmatically determine
35+
which reboot-mode arguments are valid before
36+
triggering a reboot.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/reset/cortina,gemini-power-controller.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Cortina Systems Gemini Poweroff Controller
8+
9+
maintainers:
10+
- Linus Walleij <linusw@kernel.org>
11+
12+
description: |
13+
The Gemini power controller is a dedicated IP block in the Cortina Gemini SoC that
14+
controls system power-down operations.
15+
16+
properties:
17+
compatible:
18+
const: cortina,gemini-power-controller
19+
20+
reg:
21+
maxItems: 1
22+
23+
interrupts:
24+
maxItems: 1
25+
26+
required:
27+
- compatible
28+
- reg
29+
- interrupts
30+
31+
additionalProperties: false
32+
33+
examples:
34+
- |
35+
#include <dt-bindings/interrupt-controller/irq.h>
36+
37+
poweroff@4b000000 {
38+
compatible = "cortina,gemini-power-controller";
39+
reg = <0x4b000000 0x100>;
40+
interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
41+
};
42+
...

Documentation/devicetree/bindings/power/reset/gemini-poweroff.txt

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

Documentation/devicetree/bindings/power/supply/cpcap-battery.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ properties:
5555
- const: chg_isense
5656
- const: batti
5757

58+
monitored-battery: true
5859
power-supplies: true
5960

6061
required:

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,50 @@ properties:
2020
- maxim,max17050
2121
- maxim,max17055
2222
- maxim,max77705-battery
23+
- maxim,max77759-fg
2324
- maxim,max77849-battery
2425

2526
reg:
2627
maxItems: 1
2728

2829
interrupts:
2930
maxItems: 1
30-
description: |
31-
The ALRT pin, an open-drain interrupt.
31+
description:
32+
The ALRT pin (or FG_INTB pin on MAX77759), an open-drain interrupt.
33+
34+
shunt-resistor-micro-ohms:
35+
description:
36+
Resistance of rsns resistor in micro Ohms (datasheet-recommended value is 10000).
37+
Defining this property enables current-sense functionality.
3238

3339
maxim,rsns-microohm:
40+
deprecated: true
3441
$ref: /schemas/types.yaml#/definitions/uint32
35-
description: |
42+
description:
3643
Resistance of rsns resistor in micro Ohms (datasheet-recommended value is 10000).
3744
Defining this property enables current-sense functionality.
3845

3946
maxim,cold-temp:
4047
$ref: /schemas/types.yaml#/definitions/uint32
41-
description: |
48+
description:
4249
Temperature threshold to report battery as cold (in tenths of degree Celsius).
4350
Default is not to report cold events.
4451

4552
maxim,over-heat-temp:
4653
$ref: /schemas/types.yaml#/definitions/uint32
47-
description: |
54+
description:
4855
Temperature threshold to report battery as over heated (in tenths of degree Celsius).
4956
Default is not to report over heating events.
5057

5158
maxim,dead-volt:
5259
$ref: /schemas/types.yaml#/definitions/uint32
53-
description: |
60+
description:
5461
Voltage threshold to report battery as dead (in mV).
5562
Default is not to report dead battery events.
5663

5764
maxim,over-volt:
5865
$ref: /schemas/types.yaml#/definitions/uint32
59-
description: |
66+
description:
6067
Voltage threshold to report battery as over voltage (in mV).
6168
Default is not to report over-voltage events.
6269

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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,s2mu005-fuel-gauge.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Battery Fuel Gauge for Samsung S2M series PMICs
8+
9+
maintainers:
10+
- Kaustabh Chakraborty <kauschluss@disroot.org>
11+
12+
allOf:
13+
- $ref: power-supply.yaml#
14+
15+
properties:
16+
compatible:
17+
enum:
18+
- samsung,s2mu005-fuel-gauge
19+
20+
reg:
21+
maxItems: 1
22+
23+
interrupts:
24+
maxItems: 1
25+
26+
required:
27+
- compatible
28+
- reg
29+
30+
unevaluatedProperties: false
31+
32+
examples:
33+
- |
34+
#include <dt-bindings/interrupt-controller/irq.h>
35+
36+
i2c {
37+
#address-cells = <1>;
38+
#size-cells = <0>;
39+
40+
fuel-gauge@3b {
41+
compatible = "samsung,s2mu005-fuel-gauge";
42+
reg = <0x3b>;
43+
44+
interrupt-parent = <&gpa0>;
45+
interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
46+
47+
monitored-battery = <&battery>;
48+
};
49+
};

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2547,6 +2547,7 @@ F: drivers/nvmem/apple-spmi-nvmem.c
25472547
F: drivers/phy/apple/
25482548
F: drivers/pinctrl/pinctrl-apple-gpio.c
25492549
F: drivers/power/reset/macsmc-reboot.c
2550+
F: drivers/power/supply/macsmc-power.c
25502551
F: drivers/pwm/pwm-apple.c
25512552
F: drivers/rtc/rtc-macsmc.c
25522553
F: drivers/soc/apple/*

drivers/power/reset/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ config POWER_RESET_GEMINI_POWEROFF
9797

9898
config POWER_RESET_GPIO
9999
bool "GPIO power-off driver"
100-
depends on OF_GPIO
100+
depends on OF
101101
help
102102
This driver supports turning off your board via a GPIO line.
103103
If your board needs a GPIO high/low to power down, say Y and
104104
create a binding in your devicetree.
105105

106106
config POWER_RESET_GPIO_RESTART
107107
bool "GPIO restart driver"
108-
depends on OF_GPIO
108+
depends on OF
109109
help
110110
This driver supports restarting your board via a GPIO line.
111111
If your board needs a GPIO high/low to restart, say Y and
@@ -181,7 +181,7 @@ config POWER_RESET_PIIX4_POWEROFF
181181

182182
config POWER_RESET_LTC2952
183183
bool "LTC2952 PowerPath power-off driver"
184-
depends on OF_GPIO
184+
depends on OF
185185
help
186186
This driver supports an external powerdown trigger and board power
187187
down via the LTC2952. Bindings are made in the device tree.
@@ -198,7 +198,7 @@ config POWER_RESET_MT6323
198198

199199
config POWER_RESET_QNAP
200200
bool "QNAP power-off driver"
201-
depends on OF_GPIO && PLAT_ORION
201+
depends on PLAT_ORION
202202
help
203203
This driver supports turning off QNAP NAS devices by sending
204204
commands to the microcontroller which controls the main power.

drivers/power/reset/keystone-reset.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ static inline int rsctrl_enable_rspll_write(void)
4848
RSCTRL_KEY_MASK, RSCTRL_KEY);
4949
}
5050

51-
static int rsctrl_restart_handler(struct notifier_block *this,
52-
unsigned long mode, void *cmd)
51+
static int rsctrl_restart_handler(struct sys_off_data *data)
5352
{
5453
/* enable write access to RSTCTRL */
5554
rsctrl_enable_rspll_write();
@@ -61,11 +60,6 @@ static int rsctrl_restart_handler(struct notifier_block *this,
6160
return NOTIFY_DONE;
6261
}
6362

64-
static struct notifier_block rsctrl_restart_nb = {
65-
.notifier_call = rsctrl_restart_handler,
66-
.priority = 128,
67-
};
68-
6963
static const struct of_device_id rsctrl_of_match[] = {
7064
{.compatible = "ti,keystone-reset", },
7165
{},
@@ -140,7 +134,8 @@ static int rsctrl_probe(struct platform_device *pdev)
140134
return ret;
141135
}
142136

143-
ret = register_restart_handler(&rsctrl_restart_nb);
137+
ret = devm_register_sys_off_handler(dev, SYS_OFF_MODE_RESTART, 128,
138+
rsctrl_restart_handler, NULL);
144139
if (ret)
145140
dev_err(dev, "cannot register restart handler (err=%d)\n", ret);
146141

0 commit comments

Comments
 (0)