Skip to content

Commit b0206c4

Browse files
committed
Merge tag 'for-v6.19' 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: - documentation fixes power-supply drivers: - add BD71828 charger driver - add Richtek RT9756 driver - max77705: add adaptive input current support - max77705: add support for multiple devices - misc small fixes reset drivers: - add spacemit-p1 poweroff/reboot driver" * tag 'for-v6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: Revert "power: supply: qcom_battmgr: support disabling charge control" Documentation: power: rt9756: Document exported sysfs entries power: supply: rt9756: Add Richtek RT9756 smart cap divider charger dt-bindings: power: supply: Add Richtek RT9756 smart cap divider charger driver: reset: spacemit-p1: add driver for poweroff/reboot power: supply: apm_power: only unset own apm_get_power_status power: supply: use ktime_divns() to avoid 64-bit division docs: power: clean up power_supply_class.rst power: supply: qcom_battmgr: support disabling charge control power: supply: qcom_battmgr: clamp charge control thresholds power: supply: wm831x: Check wm831x_set_bits() return value power: supply: rt9467: Prevent using uninitialized local variable in rt9467_set_value_from_ranges() power: supply: rt9467: Return error on failure in rt9467_set_value_from_ranges() power: supply: max17040: Check iio_read_channel_processed() return code power: supply: cw2015: Check devm_delayed_work_autocancel() return code power: supply: rt5033_charger: Fix device node reference leaks power: supply: max77705: Fix potential IRQ chip conflict when probing two devices power: supply: max77705_charger: implement aicl feature MAINTAINERS: Add entry for BD71828 charger power: supply: Add bd718(15/28/78) charger driver
2 parents 6044a1e + 8e88563 commit b0206c4

20 files changed

Lines changed: 2363 additions & 64 deletions
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
What: /sys/class/power_supply/rt9756-*/watchdog_timer
2+
Date: Dec 2025
3+
KernelVersion: 6.19
4+
Contact: ChiYuan Huang <cy_huang@richtek.com>
5+
Description:
6+
This entry shows and sets the watchdog timer when rt9756 charger
7+
operates in charging mode. When the timer expires, the device
8+
will disable the charging. To prevent the timer expires, any
9+
host communication can make the timer restarted.
10+
11+
Access: Read, Write
12+
13+
Valid values:
14+
- 500, 1000, 5000, 30000, 40000, 80000, 128000 or 255000 (milliseconds),
15+
- 0: disabled
16+
17+
What: /sys/class/power_supply/rt9756-*/operation_mode
18+
Date: Dec 2025
19+
KernelVersion: 6.19
20+
Contact: ChiYuan Huang <cy_huang@richtek.com>
21+
Description:
22+
This entry shows and set the operation mode when rt9756 charger
23+
operates in charging phase. If 'bypass' mode is used, internal
24+
path will connect vbus directly to vbat. Else, default 'div2'
25+
mode for the switch-cap charging.
26+
27+
Access: Read, Write
28+
29+
Valid values:
30+
- 'bypass' or 'div2'
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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/richtek,rt9756.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Richtek RT9756 Smart Cap Divider Charger
8+
9+
maintainers:
10+
- ChiYuan Huang <cy_huang@richtek.com>
11+
12+
description: |
13+
The RT9756/RT9757 is a high efficiency and high charge current charger.
14+
15+
The efficiency is up to 98.2% when VBAT = 4V, IBAT = 2A in DIV2 mode and 99.1%
16+
when VBAT=4V, IBAT=1A in bypass mode. The maximum charger current is up to 8A
17+
in DIV2 mode and 5A in bypass mode. The device integrates smart cap divider
18+
topology, direct charging mode, external over-voltage protection control, an
19+
input reverse blocking NFET and 2-way regulation, a dual phase charge pump
20+
core, 8-Channel high speed ADCs and USB BC 1.2 detection.
21+
22+
RT9770 is almost the same with RT9756/57, only BC 1.2 detection function is
23+
removed to shrink the die size.
24+
25+
allOf:
26+
- $ref: power-supply.yaml#
27+
28+
properties:
29+
compatible:
30+
oneOf:
31+
- enum:
32+
- richtek,rt9756
33+
- richtek,rt9770
34+
- items:
35+
- enum:
36+
- richtek,rt9757
37+
- const: richtek,rt9756
38+
39+
reg:
40+
maxItems: 1
41+
42+
wakeup-source: true
43+
44+
interrupts:
45+
maxItems: 1
46+
47+
shunt-resistor-micro-ohms:
48+
description: Battery current sense resistor mounted.
49+
default: 2000
50+
51+
required:
52+
- compatible
53+
- reg
54+
- interrupts
55+
56+
unevaluatedProperties: false
57+
58+
examples:
59+
- |
60+
#include <dt-bindings/interrupt-controller/irq.h>
61+
i2c {
62+
#address-cells = <1>;
63+
#size-cells = <0>;
64+
65+
charger@6f {
66+
compatible = "richtek,rt9756";
67+
reg = <0x6f>;
68+
wakeup-source;
69+
interrupts-extended = <&gpio_intc 32 IRQ_TYPE_EDGE_FALLING>;
70+
shunt-resistor-micro-ohms = <5000>;
71+
};
72+
};

Documentation/power/power_supply_class.rst

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@ Synopsis
77
Power supply class used to represent battery, UPS, AC or DC power supply
88
properties to user-space.
99

10-
It defines core set of attributes, which should be applicable to (almost)
10+
It defines a core set of attributes which should be applicable to (almost)
1111
every power supply out there. Attributes are available via sysfs and uevent
1212
interfaces.
1313

14-
Each attribute has well defined meaning, up to unit of measure used. While
14+
Each attribute has a well-defined meaning, up to the unit of measure used. While
1515
the attributes provided are believed to be universally applicable to any
1616
power supply, specific monitoring hardware may not be able to provide them
1717
all, so any of them may be skipped.
1818

19-
Power supply class is extensible, and allows to define drivers own attributes.
20-
The core attribute set is subject to the standard Linux evolution (i.e.
21-
if it will be found that some attribute is applicable to many power supply
22-
types or their drivers, it can be added to the core set).
19+
The power supply class is extensible and allows drivers to define their own
20+
attributes. The core attribute set is subject to the standard Linux evolution
21+
(i.e., if some attribute is found to be applicable to many power
22+
supply types or their drivers, it can be added to the core set).
2323

24-
It also integrates with LED framework, for the purpose of providing
24+
It also integrates with the LED framework, for the purpose of providing
2525
typically expected feedback of battery charging/fully charged status and
2626
AC/USB power supply online status. (Note that specific details of the
2727
indication (including whether to use it at all) are fully controllable by
28-
user and/or specific machine defaults, per design principles of LED
29-
framework).
28+
user and/or specific machine defaults, per design principles of the LED
29+
framework.)
3030

3131

3232
Attributes/properties
3333
~~~~~~~~~~~~~~~~~~~~~
34-
Power supply class has predefined set of attributes, this eliminates code
35-
duplication across drivers. Power supply class insist on reusing its
34+
The power supply class has a predefined set of attributes. This eliminates code
35+
duplication across drivers. The power supply class insists on reusing its
3636
predefined attributes *and* their units.
3737

38-
So, userspace gets predictable set of attributes and their units for any
38+
So, userspace gets a predictable set of attributes and their units for any
3939
kind of power supply, and can process/present them to a user in consistent
4040
manner. Results for different power supplies and machines are also directly
4141
comparable.
@@ -61,7 +61,7 @@ Attributes/properties detailed
6161
| **Charge/Energy/Capacity - how to not confuse** |
6262
+--------------------------------------------------------------------------+
6363
| **Because both "charge" (µAh) and "energy" (µWh) represents "capacity" |
64-
| of battery, this class distinguish these terms. Don't mix them!** |
64+
| of battery, this class distinguishes these terms. Don't mix them!** |
6565
| |
6666
| - `CHARGE_*` |
6767
| attributes represents capacity in µAh only. |
@@ -81,7 +81,7 @@ _NOW
8181

8282
STATUS
8383
this attribute represents operating status (charging, full,
84-
discharging (i.e. powering a load), etc.). This corresponds to
84+
discharging (i.e., powering a load), etc.). This corresponds to
8585
`BATTERY_STATUS_*` values, as defined in battery.h.
8686

8787
CHARGE_TYPE
@@ -92,22 +92,22 @@ CHARGE_TYPE
9292

9393
AUTHENTIC
9494
indicates the power supply (battery or charger) connected
95-
to the platform is authentic(1) or non authentic(0).
95+
to the platform is authentic(1) or non-authentic(0).
9696

9797
HEALTH
98-
represents health of the battery, values corresponds to
98+
represents health of the battery. Values corresponds to
9999
POWER_SUPPLY_HEALTH_*, defined in battery.h.
100100

101101
VOLTAGE_OCV
102102
open circuit voltage of the battery.
103103

104104
VOLTAGE_MAX_DESIGN, VOLTAGE_MIN_DESIGN
105105
design values for maximal and minimal power supply voltages.
106-
Maximal/minimal means values of voltages when battery considered
106+
Maximal/minimal means values of voltages when battery is considered
107107
"full"/"empty" at normal conditions. Yes, there is no direct relation
108108
between voltage and battery capacity, but some dumb
109109
batteries use voltage for very approximated calculation of capacity.
110-
Battery driver also can use this attribute just to inform userspace
110+
A battery driver also can use this attribute just to inform userspace
111111
about maximal and minimal voltage thresholds of a given battery.
112112

113113
VOLTAGE_MAX, VOLTAGE_MIN
@@ -122,16 +122,16 @@ CURRENT_BOOT
122122
Reports the current measured during boot
123123

124124
CHARGE_FULL_DESIGN, CHARGE_EMPTY_DESIGN
125-
design charge values, when battery considered full/empty.
125+
design charge values, when battery is considered full/empty.
126126

127127
ENERGY_FULL_DESIGN, ENERGY_EMPTY_DESIGN
128128
same as above but for energy.
129129

130130
CHARGE_FULL, CHARGE_EMPTY
131-
These attributes means "last remembered value of charge when battery
132-
became full/empty". It also could mean "value of charge when battery
131+
These attributes mean "last remembered value of charge when battery
132+
became full/empty". They also could mean "value of charge when battery is
133133
considered full/empty at given conditions (temperature, age)".
134-
I.e. these attributes represents real thresholds, not design values.
134+
I.e., these attributes represents real thresholds, not design values.
135135

136136
ENERGY_FULL, ENERGY_EMPTY
137137
same as above but for energy.
@@ -153,12 +153,12 @@ CHARGE_TERM_CURRENT
153153
CONSTANT_CHARGE_CURRENT
154154
constant charge current programmed by charger.
155155

156-
157156
CONSTANT_CHARGE_CURRENT_MAX
158157
maximum charge current supported by the power supply object.
159158

160159
CONSTANT_CHARGE_VOLTAGE
161160
constant charge voltage programmed by charger.
161+
162162
CONSTANT_CHARGE_VOLTAGE_MAX
163163
maximum charge voltage supported by the power supply object.
164164

@@ -208,10 +208,10 @@ TEMP_MAX
208208

209209
TIME_TO_EMPTY
210210
seconds left for battery to be considered empty
211-
(i.e. while battery powers a load)
211+
(i.e., while battery powers a load)
212212
TIME_TO_FULL
213213
seconds left for battery to be considered full
214-
(i.e. while battery is charging)
214+
(i.e., while battery is charging)
215215

216216

217217
Battery <-> external power supply interaction
@@ -220,13 +220,13 @@ Often power supplies are acting as supplies and supplicants at the same
220220
time. Batteries are good example. So, batteries usually care if they're
221221
externally powered or not.
222222

223-
For that case, power supply class implements notification mechanism for
223+
For that case, the power supply class implements a notification mechanism for
224224
batteries.
225225

226-
External power supply (AC) lists supplicants (batteries) names in
226+
An external power supply (AC) lists supplicants (batteries) names in
227227
"supplied_to" struct member, and each power_supply_changed() call
228-
issued by external power supply will notify supplicants via
229-
external_power_changed callback.
228+
issued by an external power supply will notify supplicants via
229+
the external_power_changed callback.
230230

231231

232232
Devicetree battery characteristics
@@ -241,14 +241,14 @@ battery node have names corresponding to elements in enum power_supply_property,
241241
for naming consistency between sysfs attributes and battery node properties.
242242

243243

244-
QA
245-
~~
244+
Q&A
245+
~~~
246246

247247
Q:
248248
Where is POWER_SUPPLY_PROP_XYZ attribute?
249249
A:
250-
If you cannot find attribute suitable for your driver needs, feel free
251-
to add it and send patch along with your driver.
250+
If you cannot find an attribute suitable for your driver needs, feel free
251+
to add it and send a patch along with your driver.
252252

253253
The attributes available currently are the ones currently provided by the
254254
drivers written.
@@ -258,18 +258,18 @@ A:
258258

259259

260260
Q:
261-
I have some very specific attribute (e.g. battery color), should I add
261+
I have some very specific attribute (e.g., battery color). Should I add
262262
this attribute to standard ones?
263263
A:
264264
Most likely, no. Such attribute can be placed in the driver itself, if
265-
it is useful. Of course, if the attribute in question applicable to
266-
large set of batteries, provided by many drivers, and/or comes from
265+
it is useful. Of course, if the attribute in question is applicable to
266+
a large set of batteries, provided by many drivers, and/or comes from
267267
some general battery specification/standard, it may be a candidate to
268268
be added to the core attribute set.
269269

270270

271271
Q:
272-
Suppose, my battery monitoring chip/firmware does not provides capacity
272+
Suppose my battery monitoring chip/firmware does not provide capacity
273273
in percents, but provides charge_{now,full,empty}. Should I calculate
274274
percentage capacity manually, inside the driver, and register CAPACITY
275275
attribute? The same question about time_to_empty/time_to_full.
@@ -278,11 +278,11 @@ A:
278278
directly measurable by the specific hardware available.
279279

280280
Inferring not available properties using some heuristics or mathematical
281-
model is not subject of work for a battery driver. Such functionality
281+
model is not a subject of work for a battery driver. Such functionality
282282
should be factored out, and in fact, apm_power, the driver to serve
283-
legacy APM API on top of power supply class, uses a simple heuristic of
283+
legacy APM API on top of the power supply class, uses a simple heuristic of
284284
approximating remaining battery capacity based on its charge, current,
285-
voltage and so on. But full-fledged battery model is likely not subject
286-
for kernel at all, as it would require floating point calculation to deal
287-
with things like differential equations and Kalman filters. This is
285+
voltage and so on. But a full-fledged battery model is likely not a subject
286+
for the kernel at all, as it would require floating point calculations to
287+
deal with things like differential equations and Kalman filters. This is
288288
better be handled by batteryd/libbattery, yet to be written.

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22479,6 +22479,12 @@ L: linux-serial@vger.kernel.org
2247922479
S: Odd Fixes
2248022480
F: drivers/tty/serial/rp2.*
2248122481

22482+
ROHM BD71828 CHARGER
22483+
M: Andreas Kemnade <andreas@kemnade.info>
22484+
M: Matti Vaittinen <mazziesaccount@gmail.com>
22485+
S: Maintained
22486+
F: drivers/power/supply/bd71828-charger.c
22487+
2248222488
ROHM BD79703 DAC
2248322489
M: Matti Vaittinen <mazziesaccount@gmail.com>
2248422490
S: Supported

drivers/power/reset/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,15 @@ config POWER_RESET_KEYSTONE
283283
help
284284
Reboot support for the KEYSTONE SoCs.
285285

286+
config POWER_RESET_SPACEMIT_P1
287+
tristate "SpacemiT P1 poweroff and reset driver"
288+
depends on ARCH_SPACEMIT || COMPILE_TEST
289+
depends on MFD_SPACEMIT_P1
290+
default MFD_SPACEMIT_P1
291+
help
292+
This driver supports power-off and reset operations for the SpacemiT
293+
P1 PMIC.
294+
286295
config POWER_RESET_SYSCON
287296
bool "Generic SYSCON regmap reset driver"
288297
depends on OF

drivers/power/reset/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ obj-$(CONFIG_POWER_RESET_LTC2952) += ltc2952-poweroff.o
2424
obj-$(CONFIG_POWER_RESET_QNAP) += qnap-poweroff.o
2525
obj-$(CONFIG_POWER_RESET_REGULATOR) += regulator-poweroff.o
2626
obj-$(CONFIG_POWER_RESET_RESTART) += restart-poweroff.o
27+
obj-$(CONFIG_POWER_RESET_SPACEMIT_P1) += spacemit-p1-reboot.o
2728
obj-$(CONFIG_POWER_RESET_ST) += st-poweroff.o
2829
obj-$(CONFIG_POWER_RESET_TH1520_AON) += th1520-aon-reboot.o
2930
obj-$(CONFIG_POWER_RESET_TORADEX_EC) += tdx-ec-poweroff.o

0 commit comments

Comments
 (0)