[PATCH v1 0/9] power: supply: max17042_battery: improve MAX17055 support

Vincent Cloutier posted 9 patches 2 months, 2 weeks ago
drivers/power/supply/max17042_battery.c  | 428 ++++++++++++++---------
drivers/power/supply/power_supply_core.c | 188 ++++++----
include/linux/power/max17042_battery.h   |  33 +-
include/linux/power_supply.h             |  10 +
4 files changed, 393 insertions(+), 266 deletions(-)
[PATCH v1 0/9] power: supply: max17042_battery: improve MAX17055 support
Posted by Vincent Cloutier 2 months, 2 weeks ago
From: Vincent Cloutier <vincent@cloutier.co>

Hi,

This series refreshes the Librem 5 MAX17055 fuel-gauge work for upstream
on top of current `mainline/master`.

Original series:
https://lore.kernel.org/lkml/20220318001048.20922-1-sebastian.krzyszkowiak@puri.sm/

Compared to the earlier posted version, the main follow-up changes are:

- keep the original arithmetic form of the fractional `MAX17042_*_LSB`
  expressions while still moving the unit conversions into shared defines
- remove the unused board-file style platform-data wrapper from the driver
- factor the `monitored-battery` parser behind a generic
  `devm_power_supply_get_battery_info()` helper so MAX17042 can read DT
  battery data before registration
- keep `voltage-max-design-microvolt` as an explicit MAX17055
  `ModelCfg.VChg` setting so batteries at or below 4.25 V clear the
  default bit

The attribution split is intentional:

- patches 1, 2, and 7 preserve the original signed Purism downstream work
  from Sebastian Krzyszkowiak
- the remaining patches are cleanups and follow-ups on top of current
  mainline code

Tested on Librem 5.

Sebastian Krzyszkowiak (3):
  power: supply: max17042_battery: Put LSB units into defines
  power: supply: max17042_battery: Use Current register in get_status
  power: supply: max17042_battery: use ModelCfg refresh on max17055

Vincent Cloutier (6):
  power: supply: max17042_battery: Use dev_err_probe for power supply
    registration
  power: supply: max17042_battery: Route MAX17055 SOC alerts through
    dSOCi
  power: supply: max17042_battery: Keep only critical alerts during
    suspend
  power: supply: max17042_battery: Remove unused platform-data plumbing
  power: supply: Read MAX17042 battery info before registration
  power: supply: max17042_battery: Treat MAX17055 VChg as explicit DT
    setting

 drivers/power/supply/max17042_battery.c  | 428 ++++++++++++++---------
 drivers/power/supply/power_supply_core.c | 188 ++++++----
 include/linux/power/max17042_battery.h   |  33 +-
 include/linux/power_supply.h             |  10 +
 4 files changed, 393 insertions(+), 266 deletions(-)


base-commit: 46b513250491a7bfc97d98791dbe6a10bcc8129d
-- 
2.53.0
Re: [PATCH v1 0/9] power: supply: max17042_battery: improve MAX17055 support
Posted by Sebastian Reichel 2 weeks, 2 days ago
Hi,

On Mon, Apr 06, 2026 at 04:57:48PM -0400, Vincent Cloutier wrote:
> From: Vincent Cloutier <vincent@cloutier.co>
> 
> This series refreshes the Librem 5 MAX17055 fuel-gauge work for upstream
> on top of current `mainline/master`.
> 
> Original series:
> https://lore.kernel.org/lkml/20220318001048.20922-1-sebastian.krzyszkowiak@puri.sm/
> 
> Compared to the earlier posted version, the main follow-up changes are:
> 
> - keep the original arithmetic form of the fractional `MAX17042_*_LSB`
>   expressions while still moving the unit conversions into shared defines
> - remove the unused board-file style platform-data wrapper from the driver
> - factor the `monitored-battery` parser behind a generic
>   `devm_power_supply_get_battery_info()` helper so MAX17042 can read DT
>   battery data before registration
> - keep `voltage-max-design-microvolt` as an explicit MAX17055
>   `ModelCfg.VChg` setting so batteries at or below 4.25 V clear the
>   default bit
> 
> The attribution split is intentional:
> 
> - patches 1, 2, and 7 preserve the original signed Purism downstream work
>   from Sebastian Krzyszkowiak
> - the remaining patches are cleanups and follow-ups on top of current
>   mainline code
> 
> Tested on Librem 5.
> 
> Sebastian Krzyszkowiak (3):
>   power: supply: max17042_battery: Put LSB units into defines
>   power: supply: max17042_battery: Use Current register in get_status
>   power: supply: max17042_battery: use ModelCfg refresh on max17055
> 
> Vincent Cloutier (6):
>   power: supply: max17042_battery: Use dev_err_probe for power supply
>     registration
>   power: supply: max17042_battery: Route MAX17055 SOC alerts through
>     dSOCi
>   power: supply: max17042_battery: Keep only critical alerts during
>     suspend
>   power: supply: max17042_battery: Remove unused platform-data plumbing
>   power: supply: Read MAX17042 battery info before registration
>   power: supply: max17042_battery: Treat MAX17055 VChg as explicit DT
>     setting
> 
>  drivers/power/supply/max17042_battery.c  | 428 ++++++++++++++---------
>  drivers/power/supply/power_supply_core.c | 188 ++++++----
>  include/linux/power/max17042_battery.h   |  33 +-
>  include/linux/power_supply.h             |  10 +
>  4 files changed, 393 insertions(+), 266 deletions(-)

I merged patches 1-7.

Greetings,

-- Sebastian