mbox series

[0/8] power: supply: Add adc-battery-helper lib and Intel Dollar Cove TI CC battery driver

Message ID 20241215172133.178460-1-hdegoede@redhat.com (mailing list archive)
Headers show
Series power: supply: Add adc-battery-helper lib and Intel Dollar Cove TI CC battery driver | expand

Message

Hans de Goede Dec. 15, 2024, 5:21 p.m. UTC
Hi All,

Here is a patch-series which primary goal is to add support for
using the coulomb-counter in the Intel Dollar Cove TI PMIC as
battery power-supply class device.

This PMIC used on some Intel Bay/Cherry Trail systems has some builtin
fuel-gauge functionality which just like the UG3105 fuel-gauge is not
a full featured autonomous fuel-gauge.

To prepare for adding support for this, this series factors out the UG3105
capacity estimating code, generalized so that it can be re-used in other
drivers.

While working on this I also noticed several other small issues in the now
factored out adc-batter-helper code as well as in the ug3105 driver. These
issues are addressed in separate patches.

This series has been tested on an Asus ME176C tablet with UG3105 fuel-gauge
and on an Acer A1 840 tablet which uses the Intel Dollar Cove TI coulomb-
counter as fuel-gauge.

Regards,

Hans


Hans de Goede (8):
  power: supply: Use power_supply_external_power_changed() in
    __power_supply_changed_work()
  power: supply: Add adc-battery-helper
  power: supply: ug3105_battery: Let the core handle
    POWER_SUPPLY_PROP_TECHNOLOGY
  power: supply: ug3105_battery: Switch to adc-battery-helper
  power: supply: ug3105_battery: Put FG in standby on remove and
    shutdown
  power: supply: adc-battery-helper: Fix reporting capacity > 100%
  power: supply: adc-battery-helper: Add support for optional
    charge_finished GPIO
  power: supply: Add new Intel Dollar Cove TI battery driver

 drivers/power/supply/Kconfig               |  16 +
 drivers/power/supply/Makefile              |   2 +
 drivers/power/supply/adc-battery-helper.c  | 380 ++++++++++++++++++
 drivers/power/supply/adc-battery-helper.h  |  61 +++
 drivers/power/supply/intel_dc_ti_battery.c | 429 +++++++++++++++++++++
 drivers/power/supply/power_supply_core.c   |   6 +-
 drivers/power/supply/ug3105_battery.c      | 397 +++----------------
 7 files changed, 954 insertions(+), 337 deletions(-)
 create mode 100644 drivers/power/supply/adc-battery-helper.c
 create mode 100644 drivers/power/supply/adc-battery-helper.h
 create mode 100644 drivers/power/supply/intel_dc_ti_battery.c