mbox series

[v3,0/4] Add optional properties to MAX17040

Message ID 20230731073613.10394-1-clamor95@gmail.com
Headers show
Series Add optional properties to MAX17040 | expand

Message

Svyatoslav Ryhel July 31, 2023, 7:36 a.m. UTC
Extend properties supported by max17040 fuel gauge if it is accompanied
by different devices.

If max17040 is coupled with a charger, pass charger status since it should
match and max17040 has no dedicated status detection ability.

max17040_get_online can be reused for PRESENT property since if it is
online it must be present.

Finally, max17040 may be coupled with a dedicated thermal sensor which
monitors battery temperature so lets add support for iio channel to match
hw setup. With that said, the driver got dependency on CONFIG_IIO which
was added to Kconfig. All defconfigs apart s5pv210_defconfig have IIO
already enabled so only s5pv210_defconfig needed adjustment.

---
Changes from v2:
- documentation: fixed typo i2c0 > i2c
- added dependency on CONFIG_IIO
- enabled CONFIG_IIO for s5pv210_defconfig to avoid regressions (all other
  defconfigs which include max17040 already have IIO enabled)

Changes from v1:
- documentation: dropped monitored-battery and power-supplies (inherited
  from inclusion)
- dropped passing charger health as battery health
- dropped patch for simple battery cell support
- switched iio_read_channel_raw to iio_read_channel_processed_scale
- switched iio_channel_get to devm_iio_channel_get
- re-organized implementation of temp channel (implemented in way 
  *_get_optional functions usually act)
---

Svyatoslav Ryhel (4):
  dt-bindings: power: supply: maxim,max17040: update properties
  power: max17040: pass status property from supplier
  power: max17040: get thermal data from adc if available
  ARM: configs: s5pv210_defconfig: enable IIO required by MAX17040

 .../bindings/power/supply/maxim,max17040.yaml | 31 +++++++++++++++++++
 arch/arm/configs/s5pv210_defconfig            |  1 +
 drivers/power/supply/Kconfig                  |  2 +-
 drivers/power/supply/max17040_battery.c       | 27 ++++++++++++++++
 4 files changed, 60 insertions(+), 1 deletion(-)

Comments

Iskren Chernev July 31, 2023, 3:49 p.m. UTC | #1
On 7/31/23 10:36, Svyatoslav Ryhel wrote:
> Extend properties supported by max17040 fuel gauge if it is accompanied
> by different devices.
> 
> If max17040 is coupled with a charger, pass charger status since it should
> match and max17040 has no dedicated status detection ability.
> 
> max17040_get_online can be reused for PRESENT property since if it is
> online it must be present.
> 
> Finally, max17040 may be coupled with a dedicated thermal sensor which
> monitors battery temperature so lets add support for iio channel to match
> hw setup. With that said, the driver got dependency on CONFIG_IIO which
> was added to Kconfig. All defconfigs apart s5pv210_defconfig have IIO
> already enabled so only s5pv210_defconfig needed adjustment.

[whole series]
Reviewed-by: Iskren Chernev <me@iskren.info>

> ---
> Changes from v2:
> - documentation: fixed typo i2c0 > i2c
> - added dependency on CONFIG_IIO
> - enabled CONFIG_IIO for s5pv210_defconfig to avoid regressions (all other
>   defconfigs which include max17040 already have IIO enabled)
> 
> Changes from v1:
> - documentation: dropped monitored-battery and power-supplies (inherited
>   from inclusion)
> - dropped passing charger health as battery health
> - dropped patch for simple battery cell support
> - switched iio_read_channel_raw to iio_read_channel_processed_scale
> - switched iio_channel_get to devm_iio_channel_get
> - re-organized implementation of temp channel (implemented in way 
>   *_get_optional functions usually act)
> ---
> 
> Svyatoslav Ryhel (4):
>   dt-bindings: power: supply: maxim,max17040: update properties
>   power: max17040: pass status property from supplier
>   power: max17040: get thermal data from adc if available
>   ARM: configs: s5pv210_defconfig: enable IIO required by MAX17040
> 
>  .../bindings/power/supply/maxim,max17040.yaml | 31 +++++++++++++++++++
>  arch/arm/configs/s5pv210_defconfig            |  1 +
>  drivers/power/supply/Kconfig                  |  2 +-
>  drivers/power/supply/max17040_battery.c       | 27 ++++++++++++++++
>  4 files changed, 60 insertions(+), 1 deletion(-)
>
Sebastian Reichel Sept. 14, 2023, 3:42 p.m. UTC | #2
On Mon, 31 Jul 2023 10:36:09 +0300, Svyatoslav Ryhel wrote:
> Extend properties supported by max17040 fuel gauge if it is accompanied
> by different devices.
> 
> If max17040 is coupled with a charger, pass charger status since it should
> match and max17040 has no dedicated status detection ability.
> 
> max17040_get_online can be reused for PRESENT property since if it is
> online it must be present.
> 
> [...]

Applied, thanks!

[3/4] power: max17040: get thermal data from adc if available
      commit: 814755c48f8b2c3e83b3c11535c48ab416128978

Best regards,