[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250804-b4-gs101_max77759_fg-v5-0-03a40e6c0e3d@uclouvain.be>
Date: Mon, 04 Aug 2025 16:26:37 +0200
From: Thomas Antoine via B4 Relay <devnull+t.antoine.uclouvain.be@...nel.org>
To: Sebastian Reichel <sre@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Dimitri Fedrau <dima.fedrau@...il.com>,
Catalin Marinas <catalin.marinas@....com>, Will Deacon <will@...nel.org>,
Peter Griffin <peter.griffin@...aro.org>,
André Draszik <andre.draszik@...aro.org>,
Tudor Ambarus <tudor.ambarus@...aro.org>,
Alim Akhtar <alim.akhtar@...sung.com>
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, Thomas Antoine <t.antoine@...ouvain.be>
Subject: [PATCH v5 0/4] gs101: MAX77759 Fuel Gauge driver support and
enablement
The gs101-oriole (Google Pixel 6) and gs101-raven (Google Pixel 6 Pro)
have a Maxim MAX77759 which provides a fuel gauge functionnality based
on the MAX M5 fuel gauge.
Add a driver for fuel gauge of the the Maxim MAX77759 based on the
one for the Maxim MAX1720x which also uses the MAX M5 fuel gauge.
Enable it for the gs101-oriole and gs101-raven boards.
Signed-off-by: Thomas Antoine <t.antoine@...ouvain.be>
---
Hi everyone,
I decided to completely separate the MAX77759 and the MAX1720x. The
reason I had just modified the MAX1720x initially was because I
thought at the time that their difference were much less important
than they ended up being.
Their common parts could be put in a common MAX M5 files which could
prove useful if more chips using the MAX M5 are to be added.
Changes in v5:
- Separate MAX77759 from MAX1720x for clarity
- Remove voltage reporting
- Add initialization of the chip
- Add device dependent initialization data
- Add access to eeprom for access to non-volatile backup data.
- Link to v4: https://lore.kernel.org/r/20250523-b4-gs101_max77759_fg-v4-0-b49904e35a34@uclouvain.be
Changes in v4:
- Make first patch standalone
- Separate MAX77759 defines from MAX1720x defines (Dimitri Fedrau)
- Inline device name property (Dimitri Fedrau)
- Separate MAX77759 capacity lsb logic from the MAX1720x capacity
computation (Dimitri Fedrau)
- Use device_property_read_u32 instead of of_property_read_u32
(Sebastian Reichel)
- Removed leftover debugs
- Move shunt-resistor-micro-ohms to out of allOf:if: (Krzysztof Kozlowski)
- Fix reg-names constraints
- Fix style errors
- Link to v3: https://lore.kernel.org/r/20250421-b4-gs101_max77759_fg-v3-0-50cd8caf9017@uclouvain.be
Changes in v3:
- Update base tree to avoid conflicts
- Fix capacity computation for max1720x
- Add separate properties for the max7759 to disable non-functional ones
- Take TASKPERIOD into account for voltage computation of max77759
- Simplify vcell computation (Dimitri Fedrau)
- Switch has_nvmem to bool and keep it only in chip_data (Dimitri Fedrau)
- Drop the yes_range from the write table (Sebastian Reichel)
- Add test_power_supply_properties.sh to cover letter (Sebastian Reichel)
- Switch back some changes to binding and actually use allOf:if: to
restrict constraints (Krzysztof Kozlowski)
- Fix style errors
- Link to v2: https://lore.kernel.org/r/20250102-b4-gs101_max77759_fg-v2-0-87959abeb7ff@uclouvain.be
Changes in v2:
- Add fallback for voltage measurement (André Draszik)
- Add regmap for the max77759 (André Draszik)
- Add chip identification for the max77759 (André Draszik, Peter Griffin)
- Move RSense value to a devicetree property shunt-resistor-micro-ohms
(Dimitri Fedrau, André Draszik)
- Use allOf:if to narrow binding per variant (Krzysztof Kozlowski)
- Remove binding example (Krzysztof Kozlowski)
- Change defconfig order to follow savedefconfig (Krzysztof Kozlowski)
- Fix style errors
- Link to v1: https://lore.kernel.org/r/20241202-b4-gs101_max77759_fg-v1-0-98d2fa7bfe30@uclouvain.be
tools/testing/selftests/power_supply/test_power_supply_properties.sh:
gs101-oriole:
# Testing device max77759-fg
ok 1 max77759-fg.exists
ok 2 max77759-fg.uevent.NAME
ok 3 max77759-fg.sysfs.type
ok 4 max77759-fg.uevent.TYPE
ok 5 max77759-fg.sysfs.usb_type # SKIP
ok 6 max77759-fg.sysfs.online # SKIP
# Reported: '1' ()
ok 7 max77759-fg.sysfs.present
ok 8 max77759-fg.sysfs.status # SKIP
# Reported: '19' % ()
ok 9 max77759-fg.sysfs.capacity
ok 10 max77759-fg.sysfs.capacity_level # SKIP
# Reported: 'MAX77759' ()
ok 11 max77759-fg.sysfs.model_name
# Reported: 'Maxim Integrated' ()
ok 12 max77759-fg.sysfs.manufacturer
ok 13 max77759-fg.sysfs.serial_number # SKIP
ok 14 max77759-fg.sysfs.technology # SKIP
ok 15 max77759-fg.sysfs.cycle_count # SKIP
ok 16 max77759-fg.sysfs.scope # SKIP
ok 17 max77759-fg.sysfs.input_current_limit # SKIP
ok 18 max77759-fg.sysfs.input_voltage_limit # SKIP
ok 19 max77759-fg.sysfs.voltage_now # SKIP
ok 20 max77759-fg.sysfs.voltage_min # SKIP
ok 21 max77759-fg.sysfs.voltage_max # SKIP
ok 22 max77759-fg.sysfs.voltage_min_design # SKIP
ok 23 max77759-fg.sysfs.voltage_max_design # SKIP
# Reported: '-234690' uA ()
ok 24 max77759-fg.sysfs.current_now
ok 25 max77759-fg.sysfs.current_max # SKIP
ok 26 max77759-fg.sysfs.charge_now # SKIP
# Reported: '4572000' uAh (4.572 Ah)
ok 27 max77759-fg.sysfs.charge_full
# Reported: '4524000' uAh (4.524 Ah)
ok 28 max77759-fg.sysfs.charge_full_design
ok 29 max77759-fg.sysfs.power_now # SKIP
ok 30 max77759-fg.sysfs.energy_now # SKIP
ok 31 max77759-fg.sysfs.energy_full # SKIP
ok 32 max77759-fg.sysfs.energy_full_design # SKIP
ok 33 max77759-fg.sysfs.energy_full_design # SKIP
gs101-raven:
# Testing device max77759-fg
ok 1 max77759-fg.exists
ok 2 max77759-fg.uevent.NAME
ok 3 max77759-fg.sysfs.type
ok 4 max77759-fg.uevent.TYPE
ok 5 max77759-fg.sysfs.usb_type # SKIP
ok 6 max77759-fg.sysfs.online # SKIP
# Reported: '1' ()
ok 7 max77759-fg.sysfs.present
ok 8 max77759-fg.sysfs.status # SKIP
# Reported: '96' % ()
ok 9 max77759-fg.sysfs.capacity
ok 10 max77759-fg.sysfs.capacity_level # SKIP
# Reported: 'MAX77759' ()
ok 11 max77759-fg.sysfs.model_name
# Reported: 'Maxim Integrated' ()
ok 12 max77759-fg.sysfs.manufacturer
ok 13 max77759-fg.sysfs.serial_number # SKIP
ok 14 max77759-fg.sysfs.technology # SKIP
ok 15 max77759-fg.sysfs.cycle_count # SKIP
ok 16 max77759-fg.sysfs.scope # SKIP
ok 17 max77759-fg.sysfs.input_current_limit # SKIP
ok 18 max77759-fg.sysfs.input_voltage_limit # SKIP
ok 19 max77759-fg.sysfs.voltage_now # SKIP
ok 20 max77759-fg.sysfs.voltage_min # SKIP
ok 21 max77759-fg.sysfs.voltage_max # SKIP
ok 22 max77759-fg.sysfs.voltage_min_design # SKIP
ok 23 max77759-fg.sysfs.voltage_max_design # SKIP
# Reported: '-224377' uA ()
ok 24 max77759-fg.sysfs.current_now
ok 25 max77759-fg.sysfs.current_max # SKIP
ok 26 max77759-fg.sysfs.charge_now # SKIP
# Reported: '4622000' uAh (4.622 Ah)
ok 27 max77759-fg.sysfs.charge_full
# Reported: '4904000' uAh (4.904 Ah)
ok 28 max77759-fg.sysfs.charge_full_design
ok 29 max77759-fg.sysfs.power_now # SKIP
ok 30 max77759-fg.sysfs.energy_now # SKIP
ok 31 max77759-fg.sysfs.energy_full # SKIP
ok 32 max77759-fg.sysfs.energy_full_design # SKIP
ok 33 max77759-fg.sysfs.energy_full_design # SKIP
---
Thomas Antoine (4):
power: supply: add support for MAX77759 fuel gauge
dt-bindings: power: supply: add support for MAX77759 fuel gauge
arm64: defconfig: enable Maxim MAX77759 fuel-gauge driver
arm64: dts: exynos: google: add Maxim MAX77759 Fuel-gauge
.../bindings/power/supply/maxim,max77759.yaml | 76 +++
arch/arm64/boot/dts/exynos/google/gs101-oriole.dts | 10 +
.../boot/dts/exynos/google/gs101-pixel-common.dtsi | 30 +
arch/arm64/boot/dts/exynos/google/gs101-raven.dts | 11 +
arch/arm64/configs/defconfig | 1 +
drivers/power/supply/Kconfig | 14 +
drivers/power/supply/Makefile | 1 +
drivers/power/supply/max77759_battery.c | 649 +++++++++++++++++++++
8 files changed, 792 insertions(+)
---
base-commit: bc9ff192a6c940d9a26e21a0a82f2667067aaf5f
change-id: 20241202-b4-gs101_max77759_fg-402e231a4b33
Best regards,
--
Thomas Antoine <t.antoine@...ouvain.be>
Powered by blists - more mailing lists