[PATCH 00/11] power: supply: max17042: support Maxim MAX77759 fuel gauge
From: André Draszik
Date: Thu Feb 26 2026 - 08:13:06 EST
Hi,
This series adds support for the fuel gauge integrated into the Maxim
MAX77759, which is a companion PMIC intended for use in mobile phones
and tablets and is used on Google Pixel 6 and 6 Pro (oriole and raven).
Amongst others, the PMIC contains a fuel gauge employing the Maxim
ModelGauge m5 algorithm, that is similar to the ones supported by the
max17042 driver and binding.
The Maxim ModelGauge m5 algorithm, as well as previous generations like
m3 on max17047/max17050, requires the host to save/restore some
register values across power cycles to maintain full accuracy.
Extending the driver for such support is out of scope in this initial
series.
The series starts with binding updates, followed by driver updates and
improvements in preparation for finally adding max77759 support.
A DT update for Pixel 6 will be posted separately.
Note: While there was a previous attempt to add support for this fuel
gauge via a new driver [1], development seems to have come to a halt,
and extending this driver here seems more appropriate. The patches here
are unrelated to that other attempt, other than supporting the same
device.
Test results:
$ ./test_power_supply_properties.sh max170xx_battery
TAP version 13
1..33
# Testing device max170xx_battery
ok 1 max170xx_battery.exists
ok 2 max170xx_battery.uevent.NAME
ok 3 max170xx_battery.sysfs.type
ok 4 max170xx_battery.uevent.TYPE
ok 5 max170xx_battery.sysfs.usb_type # SKIP
ok 6 max170xx_battery.sysfs.online # SKIP
# Reported: '1' ()
ok 7 max170xx_battery.sysfs.present
# Reported: 'Unknown'
ok 8 max170xx_battery.sysfs.status
# Reported: '92' % ()
ok 9 max170xx_battery.sysfs.capacity
ok 10 max170xx_battery.sysfs.capacity_level # SKIP
ok 11 max170xx_battery.sysfs.model_name # SKIP
ok 12 max170xx_battery.sysfs.manufacturer # SKIP
ok 13 max170xx_battery.sysfs.serial_number # SKIP
# Reported: 'Li-ion'
ok 14 max170xx_battery.sysfs.technology
# Reported: '36032' ()
ok 15 max170xx_battery.sysfs.cycle_count
# Reported: 'System'
ok 16 max170xx_battery.sysfs.scope
ok 17 max170xx_battery.sysfs.input_current_limit # SKIP
ok 18 max170xx_battery.sysfs.input_voltage_limit # SKIP
# Reported: '4323906' uV (4.32391 V)
ok 19 max170xx_battery.sysfs.voltage_now
# Reported: '3660000' uV (3.66 V)
ok 20 max170xx_battery.sysfs.voltage_min
# Reported: '4320000' uV (4.32 V)
ok 21 max170xx_battery.sysfs.voltage_max
# Reported: '3300000' uV (3.3 V)
ok 22 max170xx_battery.sysfs.voltage_min_design
ok 23 max170xx_battery.sysfs.voltage_max_design # SKIP
# Reported: '289687' uA (289.687 mA)
ok 24 max170xx_battery.sysfs.current_now
ok 25 max170xx_battery.sysfs.current_max # SKIP
# Reported: '3942000' uAh (3.942 Ah)
ok 26 max170xx_battery.sysfs.charge_now
# Reported: '4330000' uAh (4.33 Ah)
ok 27 max170xx_battery.sysfs.charge_full
# Reported: '4524000' uAh (4.524 Ah)
ok 28 max170xx_battery.sysfs.charge_full_design
ok 29 max170xx_battery.sysfs.power_now # SKIP
ok 30 max170xx_battery.sysfs.energy_now # SKIP
ok 31 max170xx_battery.sysfs.energy_full # SKIP
ok 32 max170xx_battery.sysfs.energy_full_design # SKIP
ok 33 max170xx_battery.sysfs.energy_full_design # SKIP
# 15 skipped test(s) detected. Consider enabling relevant config options to improve coverage.
# Totals: pass:18 fail:0 xfail:0 xpass:0 skip:15 error:0
Cheers,
Andre'
Link: https://lore.kernel.org/all/20250915-b4-gs101_max77759_fg-v6-0-31d08581500f@xxxxxxxxxxxx/ [1]
Signed-off-by: André Draszik <andre.draszik@xxxxxxxxxx>
---
André Draszik (11):
dt-bindings: power: supply: max17042: add support for max77759
dt-bindings: power: supply: max17042: support shunt-resistor-micro-ohms
dt-bindings: power: supply: max17042: drop formatting specifier |
power: supply: max17042: fix a comment typo (then -> than)
power: supply: max17042: use dev_err_probe() where appropriate
power: supply: max17042: avoid overflow when determining health
power: supply: max17042: time to empty is meaningless when charging
power: supply: max17042: support standard shunt-resistor-micro-ohms DT property
power: supply: max17042: initial support for Maxim MAX77759
power: supply: max17042: max17042: consider task period (max77759)
power: supply: max17042: report time to full
.../bindings/power/supply/maxim,max17042.yaml | 21 ++--
drivers/power/supply/max17042_battery.c | 136 ++++++++++++++++++---
include/linux/power/max17042_battery.h | 25 +++-
3 files changed, 154 insertions(+), 28 deletions(-)
---
base-commit: 877552aa875839314afad7154b5a561889e87ea9
change-id: 20260226-max77759-fg-0f4bf0816ced
Best regards,
--
André Draszik <andre.draszik@xxxxxxxxxx>