mbox series

[0/6,v3] AB8500 charging, the final steps

Message ID 20220225001314.1881549-1-linus.walleij@linaro.org (mailing list archive)
Headers show
Series AB8500 charging, the final steps | expand

Message

Linus Walleij Feb. 25, 2022, 12:13 a.m. UTC
This makes AB8500 charge the Samsung batteries on the following
mobile phones:

Samsung Galaxy Ace 2
Samsung Galaxy S Advance
Samsung Galaxy S III mini
Samsung Galaxy Xcover 2
Samsung Galaxy Beam
Samsung Galaxy Exhibit
Samsung Galaxy Amp

The steps are as follows:

- Add charging setting for maintenance charging in two steps.
  After this we fall back to discharging to the restart threshold.

- Add optional alert mode charging when the battery is alert warm
  or cold, so as to mitigate the condition. I suspect mostly the
  battery gets alert warm and then this will pull down the charging
  current a bit.

- Add BTI (Battery Type Indicator) resistance fields.

- Add VBAT-to-Ri internal resistance look-up and interpolation.
  Samsung seem to use this on all the Samsung SDI battery
  charging code I have seen.

- Add the static data for all the Samsung batteries and detect
  them from compatible property.

All of this is enabled in the AB8500 simultaneously so for each
new feature a user is introduced.

ChangeLog v2->v3:
- Collect Matti's review tags
- Fix up Samsung battery data tables

ChangeLog v1->v2:
- Address review comments
- Split alert charging mode in one for low resp high temp
- Fix build errors with Samsung static data


Linus Walleij (6):
  power: supply: ab8500: Standardize maintenance charging
  power: supply: ab8500: Standardize alert mode charging
  power: supply: ab8500: Standardize BTI resistance
  power: supply: Support VBAT-to-Ri lookup tables
  power: supply: ab8500_fg: Use VBAT-to-Ri if possible
  power: supply: Static data for Samsung batteries

 drivers/power/supply/Kconfig               |   6 +
 drivers/power/supply/Makefile              |   1 +
 drivers/power/supply/ab8500-bm.h           |  30 -
 drivers/power/supply/ab8500_bmdata.c       |  52 +-
 drivers/power/supply/ab8500_btemp.c        |  14 +-
 drivers/power/supply/ab8500_chargalg.c     |  89 +-
 drivers/power/supply/ab8500_fg.c           |  35 +-
 drivers/power/supply/power_supply_core.c   | 136 ++-
 drivers/power/supply/samsung-sdi-battery.c | 919 +++++++++++++++++++++
 drivers/power/supply/samsung-sdi-battery.h |  13 +
 include/linux/power_supply.h               | 207 ++++-
 11 files changed, 1396 insertions(+), 106 deletions(-)
 create mode 100644 drivers/power/supply/samsung-sdi-battery.c
 create mode 100644 drivers/power/supply/samsung-sdi-battery.h

Comments

Sebastian Reichel Feb. 25, 2022, 6:37 p.m. UTC | #1
Hi Linus,

On Fri, Feb 25, 2022 at 01:13:08AM +0100, Linus Walleij wrote:
> This makes AB8500 charge the Samsung batteries on the following
> mobile phones:
> 
> Samsung Galaxy Ace 2
> Samsung Galaxy S Advance
> Samsung Galaxy S III mini
> Samsung Galaxy Xcover 2
> Samsung Galaxy Beam
> Samsung Galaxy Exhibit
> Samsung Galaxy Amp
> 
> The steps are as follows:
> 
> - Add charging setting for maintenance charging in two steps.
>   After this we fall back to discharging to the restart threshold.
> 
> - Add optional alert mode charging when the battery is alert warm
>   or cold, so as to mitigate the condition. I suspect mostly the
>   battery gets alert warm and then this will pull down the charging
>   current a bit.
> 
> - Add BTI (Battery Type Indicator) resistance fields.
> 
> - Add VBAT-to-Ri internal resistance look-up and interpolation.
>   Samsung seem to use this on all the Samsung SDI battery
>   charging code I have seen.
> 
> - Add the static data for all the Samsung batteries and detect
>   them from compatible property.
> 
> All of this is enabled in the AB8500 simultaneously so for each
> new feature a user is introduced.
> 
> ChangeLog v2->v3:
> - Collect Matti's review tags
> - Fix up Samsung battery data tables
> 
> ChangeLog v1->v2:
> - Address review comments
> - Split alert charging mode in one for low resp high temp
> - Fix build errors with Samsung static data
> 
> 
> Linus Walleij (6):
>   power: supply: ab8500: Standardize maintenance charging
>   power: supply: ab8500: Standardize alert mode charging
>   power: supply: ab8500: Standardize BTI resistance
>   power: supply: Support VBAT-to-Ri lookup tables
>   power: supply: ab8500_fg: Use VBAT-to-Ri if possible
>   power: supply: Static data for Samsung batteries
> 
>  drivers/power/supply/Kconfig               |   6 +
>  drivers/power/supply/Makefile              |   1 +
>  drivers/power/supply/ab8500-bm.h           |  30 -
>  drivers/power/supply/ab8500_bmdata.c       |  52 +-
>  drivers/power/supply/ab8500_btemp.c        |  14 +-
>  drivers/power/supply/ab8500_chargalg.c     |  89 +-
>  drivers/power/supply/ab8500_fg.c           |  35 +-
>  drivers/power/supply/power_supply_core.c   | 136 ++-
>  drivers/power/supply/samsung-sdi-battery.c | 919 +++++++++++++++++++++
>  drivers/power/supply/samsung-sdi-battery.h |  13 +
>  include/linux/power_supply.h               | 207 ++++-
>  11 files changed, 1396 insertions(+), 106 deletions(-)
>  create mode 100644 drivers/power/supply/samsung-sdi-battery.c
>  create mode 100644 drivers/power/supply/samsung-sdi-battery.h

The patchset looks good to me, but does not apply. Please rebase.

Thanks,

-- Sebastian