Skip to content

Commit 3ee22ad

Browse files
committed
Merge tag 'for-v6.18' 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: - introduce adc-battery-helper for capacity estimation based on simple ADC readings of battery voltage and current - add new properties for battery internal resistance and state of health Power-supply drivers: - ug3105_battery: convert to adc-battery-helper - intel_dc_ti_battery: New driver for Intel Dollar Cove TI batteries - rt9467-charger: add voltage and current ADC support - sbs-charger: support multiple instances - qcom_battmgr: - add charge control support - add support for state of health and internal resistance - max77705_charger: - big driver cleanup - add support for setting charge current - misc minor fixes and cleanups" * tag 'for-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (38 commits) power: supply: qcom_battmgr: handle charging state change notifications power: supply: max77705_charger: use REGMAP_IRQ_REG_LINE macro power: supply: max77705_charger: rework interrupts power: supply: max77705_charger: add writable properties power: supply: max77705_charger: return error when config fails power: supply: max77705_charger: use regfields for config registers power: supply: max77705_charger: refactoring: rename charger to chg mfd: max77705: max77705_charger: move active discharge setting to mfd parent power: supply: max77976_charger: fix constant current reporting power: supply: qcom_battmgr: Add charge control support dt-bindings: soc: qcom,pmic-glink: Add charge limit nvmem properties power: supply: qcom_battmgr: update compats for SM8550 and X1E80100 power: supply: qcom_battmgr: Add state_of_health property power: supply: qcom_battmgr: Add resistance power supply property power: supply: core: Add state_of_health power supply property power: supply: core: Add resistance power supply property power: supply: rx51: remove redundant condition checks dt-bindings: power: supply: bq24190: document charge enable pin dt-bindings: power: supply: bq27xxx: document optional interrupt power: supply: intel_dc_ti_battery: Drop no longer relevant comment ...
2 parents dba8acc + 41307ec commit 3ee22ad

32 files changed

Lines changed: 1610 additions & 590 deletions

Documentation/ABI/testing/sysfs-class-power

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,43 @@ Description:
553553
Integer > 0: representing full cycles
554554
Integer = 0: cycle_count info is not available
555555

556+
What: /sys/class/power_supply/<supply_name>/internal_resistance
557+
Date: August 2025
558+
Contact: linux-arm-msm@vger.kernel.org
559+
Description:
560+
Represent the battery's internal resistance, often referred
561+
to as Equivalent Series Resistance (ESR). It is a dynamic
562+
parameter that reflects the opposition to current flow within
563+
the cell. It is not a fixed value but varies significantly
564+
based on several operational conditions, including battery
565+
state of charge (SoC), temperature, and whether the battery
566+
is in a charging or discharging state.
567+
568+
Access: Read
569+
570+
Valid values: Represented in microohms
571+
572+
What: /sys/class/power_supply/<supply_name>/state_of_health
573+
Date: August 2025
574+
Contact: linux-arm-msm@vger.kernel.org
575+
Description:
576+
The state_of_health parameter quantifies the overall condition
577+
of a battery as a percentage, reflecting its ability to deliver
578+
rated performance relative to its original specifications. It is
579+
dynamically computed using a combination of learned capacity
580+
and impedance-based degradation indicators, both of which evolve
581+
over the battery's lifecycle.
582+
Note that the exact algorithms are kept secret by most battery
583+
vendors and the value from different battery vendors cannot be
584+
compared with each other as there is no vendor-agnostic definition
585+
of "performance". Also this usually cannot be used for any
586+
calculations (i.e. this is not the factor between charge_full and
587+
charge_full_design).
588+
589+
Access: Read
590+
591+
Valid values: 0 - 100 (percent)
592+
556593
**USB Properties**
557594

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

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ properties:
3030
interrupts:
3131
maxItems: 1
3232

33+
ce-gpios:
34+
description:
35+
Active low Charge Enable pin. Battery charging is enabled when
36+
REG01[5:4] = 01 and CE pin is Low. CE pin must be pulled high or low.
37+
maxItems: 1
38+
3339
usb-otg-vbus:
3440
$ref: /schemas/regulator/regulator.yaml#
3541
description: |

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

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ description: |
1616
Support various Texas Instruments fuel gauge devices that share similar
1717
register maps and power supply properties
1818
19-
allOf:
20-
- $ref: power-supply.yaml#
21-
2219
properties:
2320
compatible:
2421
enum:
@@ -58,6 +55,10 @@ properties:
5855
maxItems: 1
5956
description: integer, I2C address of the fuel gauge.
6057

58+
interrupts:
59+
maxItems: 1
60+
description: the SOC_INT or GPOUT pin
61+
6162
monitored-battery:
6263
description: |
6364
The fuel gauge uses the following battery properties:
@@ -68,6 +69,36 @@ properties:
6869
6970
power-supplies: true
7071

72+
allOf:
73+
- $ref: power-supply.yaml#
74+
- if:
75+
properties:
76+
compatible:
77+
contains:
78+
enum:
79+
- ti,bq27200
80+
- ti,bq27210
81+
- ti,bq27500 # deprecated, use revision specific property below
82+
- ti,bq27510 # deprecated, use revision specific property below
83+
- ti,bq27520 # deprecated, use revision specific property below
84+
- ti,bq27500-1
85+
- ti,bq27510g1
86+
- ti,bq27510g2
87+
- ti,bq27521
88+
- ti,bq27541
89+
- ti,bq27542
90+
- ti,bq27546
91+
- ti,bq27742
92+
- ti,bq27545
93+
- ti,bq27411
94+
- ti,bq27z561
95+
- ti,bq28z610
96+
- ti,bq34z100
97+
- ti,bq78z100
98+
then:
99+
properties:
100+
interrupts: false
101+
71102
required:
72103
- compatible
73104
- reg

Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ properties:
5656
The array should contain a gpio entry for each PMIC Glink connector, in reg order.
5757
It is defined that GPIO active level means "CC2" or Reversed/Flipped orientation.
5858

59+
nvmem-cells:
60+
minItems: 3
61+
maxItems: 3
62+
description:
63+
The nvmem cells contain the charge control settings, including the charge control
64+
enable status, the battery state of charge (SoC) threshold for stopping charging,
65+
and the battery SoC delta required to restart charging.
66+
67+
nvmem-cell-names:
68+
items:
69+
- const: charge_limit_en
70+
- const: charge_limit_end
71+
- const: charge_limit_delta
72+
5973
patternProperties:
6074
'^connector@\d$':
6175
$ref: /schemas/connector/usb-connector.yaml#

drivers/mfd/max77705.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ static int max77705_i2c_probe(struct i2c_client *i2c)
108108
if (pmic_rev != MAX77705_PASS3)
109109
return dev_err_probe(dev, -ENODEV, "Rev.0x%x is not tested\n", pmic_rev);
110110

111+
/* Active Discharge Enable */
112+
regmap_update_bits(max77705->regmap, MAX77705_PMIC_REG_MAINCTRL1, 1, 1);
113+
111114
ret = devm_regmap_add_irq_chip(dev, max77705->regmap,
112115
i2c->irq,
113116
IRQF_ONESHOT, 0,

drivers/power/supply/88pm860x_charger.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ static int set_charging_fsm(struct pm860x_charger_info *info)
284284
{
285285
struct power_supply *psy;
286286
union power_supply_propval data;
287-
unsigned char fsm_state[][16] = { "init", "discharge", "precharge",
288-
"fastcharge",
287+
static const unsigned char fsm_state[][16] = {
288+
"init", "discharge", "precharge", "fastcharge",
289289
};
290290
int ret;
291291
int vbatt;
@@ -313,7 +313,7 @@ static int set_charging_fsm(struct pm860x_charger_info *info)
313313

314314
dev_dbg(info->dev, "Entering FSM:%s, Charger:%s, Battery:%s, "
315315
"Allowed:%d\n",
316-
&fsm_state[info->state][0],
316+
fsm_state[info->state],
317317
(info->online) ? "online" : "N/A",
318318
(info->present) ? "present" : "N/A", info->allowed);
319319
dev_dbg(info->dev, "set_charging_fsm:vbatt:%d(mV)\n", vbatt);
@@ -385,7 +385,7 @@ static int set_charging_fsm(struct pm860x_charger_info *info)
385385
}
386386
dev_dbg(info->dev,
387387
"Out FSM:%s, Charger:%s, Battery:%s, Allowed:%d\n",
388-
&fsm_state[info->state][0],
388+
fsm_state[info->state],
389389
(info->online) ? "online" : "N/A",
390390
(info->present) ? "present" : "N/A", info->allowed);
391391
mutex_unlock(&info->lock);

drivers/power/supply/Kconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ config APM_POWER
3535
Say Y here to enable support APM status emulation using
3636
battery class devices.
3737

38+
config ADC_BATTERY_HELPER
39+
tristate
40+
3841
config GENERIC_ADC_BATTERY
3942
tristate "Generic battery support using IIO"
4043
depends on IIO
@@ -244,6 +247,18 @@ config BATTERY_INGENIC
244247
This driver can also be built as a module. If so, the module will be
245248
called ingenic-battery.
246249

250+
config BATTERY_INTEL_DC_TI
251+
tristate "Intel Bay / Cherry Trail Dollar Cove TI battery driver"
252+
depends on INTEL_SOC_PMIC_CHTDC_TI && INTEL_DC_TI_ADC && IIO && ACPI
253+
select ADC_BATTERY_HELPER
254+
help
255+
Choose this option if you want to monitor battery status on Intel
256+
Bay Trail / Cherry Trail tablets using the Dollar Cove TI PMIC's
257+
coulomb-counter as fuel-gauge.
258+
259+
To compile this driver as a module, choose M here: the module will be
260+
called intel_dc_ti_battery.
261+
247262
config BATTERY_IPAQ_MICRO
248263
tristate "iPAQ Atmel Micro ASIC battery driver"
249264
depends on MFD_IPAQ_MICRO
@@ -1050,6 +1065,7 @@ config CHARGER_SURFACE
10501065
config BATTERY_UG3105
10511066
tristate "uPI uG3105 battery monitor driver"
10521067
depends on I2C
1068+
select ADC_BATTERY_HELPER
10531069
help
10541070
Battery monitor driver for the uPI uG3105 battery monitor.
10551071

drivers/power/supply/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ power_supply-$(CONFIG_LEDS_TRIGGERS) += power_supply_leds.o
77

88
obj-$(CONFIG_POWER_SUPPLY) += power_supply.o
99
obj-$(CONFIG_POWER_SUPPLY_HWMON) += power_supply_hwmon.o
10+
obj-$(CONFIG_ADC_BATTERY_HELPER) += adc-battery-helper.o
1011
obj-$(CONFIG_GENERIC_ADC_BATTERY) += generic-adc-battery.o
1112

1213
obj-$(CONFIG_APM_POWER) += apm_power.o
@@ -41,6 +42,7 @@ obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o
4142
obj-$(CONFIG_BATTERY_SAMSUNG_SDI) += samsung-sdi-battery.o
4243
obj-$(CONFIG_BATTERY_COLLIE) += collie_battery.o
4344
obj-$(CONFIG_BATTERY_INGENIC) += ingenic-battery.o
45+
obj-$(CONFIG_BATTERY_INTEL_DC_TI) += intel_dc_ti_battery.o
4446
obj-$(CONFIG_BATTERY_IPAQ_MICRO) += ipaq_micro_battery.o
4547
obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o
4648
obj-$(CONFIG_BATTERY_SBS) += sbs-battery.o

drivers/power/supply/ab8500_btemp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,8 @@ static int ab8500_btemp_bind(struct device *dev, struct device *master,
667667

668668
/* Create a work queue for the btemp */
669669
di->btemp_wq =
670-
alloc_workqueue("ab8500_btemp_wq", WQ_MEM_RECLAIM, 0);
670+
alloc_workqueue("ab8500_btemp_wq", WQ_MEM_RECLAIM | WQ_PERCPU,
671+
0);
671672
if (di->btemp_wq == NULL) {
672673
dev_err(dev, "failed to create work queue\n");
673674
return -ENOMEM;

0 commit comments

Comments
 (0)