Thread (8 messages) 8 messages, 3 authors, 2021-12-06
STALE1684d

[PATCH 0/2] More AB8500 charging props

From: Linus Walleij <hidden>
Date: 2021-11-22 23:43:59
Also in: linux-hwmon

These two patches begin to put new stuff into the
drivers/power/supply/ab8500_bmdata.c for:

A) battery temperature look-up and interpolation, and
B) maintenance charging

Some design choices can be discussed, so I included some
HWMON etc maintainers.

NTC resistor:

For the battery NTC temperature we should note the existing NTC
driver in drivers/hwmon/ntc_thermistor.c with bindings
in Documentation/devicetree/bindings/hwmon/ntc-thermistor.yaml
which is used for stand-alone NTC resistors.

It is probably possible to try to reuse the hwmon code but I
wanted to see if we have buy-in from the hwmon maintainer first.

If yes, I will try to come up with some way of representing the
NTC resistor in the device tree and use it in-tree from the
charging drivers.

Maintenance charging:

I included an infrastructure for maintenance "charging points"
which constitute of a current, a voltage and a safety timer:

struct power_supply_maintenance_charge_table {
       int charge_current_max_ua;
       int charge_voltage_max_uv;
       int charge_safety_timer_minutes;
};

This is all pretty straight-forward if just adding maintenance
charging.

For the bigger picture, however, a charging point can also
include the existing CC/CV current and voltage and the
precharging current and voltage as two charging points,
possibly without corresponding safety timer. If this is
desired I will rework the patch to refactor the existing
currents and voltages into charging points as well.

Linus Walleij (2):
  power: supply: ab8500: Standardize NTC battery temp
  power: supply: ab8500: Standardize maintenance charging

 drivers/power/supply/ab8500-bm.h         | 30 --------
 drivers/power/supply/ab8500_bmdata.c     | 68 +++++++++-------
 drivers/power/supply/ab8500_btemp.c      | 45 +----------
 drivers/power/supply/ab8500_chargalg.c   | 41 +++++++---
 drivers/power/supply/power_supply_core.c | 63 +++++++++++++++
 include/linux/power_supply.h             | 98 ++++++++++++++++++++++++
 6 files changed, 237 insertions(+), 108 deletions(-)

-- 
2.31.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help