power: supply: ltc4162-l-charger: Add support for ltc4162-f/s and ltc4015
authorKim Seer Paller <kimseer.paller@analog.com>
Fri, 13 Dec 2024 02:37:46 +0000 (10:37 +0800)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Fri, 13 Dec 2024 18:42:55 +0000 (19:42 +0100)
commit57e5a9a85bd03d8cc4992cb2e15ca23450e016c4
tree19d86edbcdbc9cbc7455b81875d189533a865fb5
parent649399c5dad9cd7a42fe7eb8a32c31627d35492d
power: supply: ltc4162-l-charger: Add support for ltc4162-f/s and ltc4015

LTC4162-L 35V/3.2A Multi-Cell Lithium-Ion Step-Down Battery Charger
LTC4162-F 35V/3.2A Multi-Cell LiFePO4 Step-Down Battery Charger
LTC4162-S 35V/3.2A Lead-Acid Step-Down Battery Charger
LTC4015 35V/3.2A Multichemistry Buck Battery Charger Controller

The LTC4162-L/F/S variants and LTC4015 share a common set of registers.
The difference lies in the resolution value of the scaling factor for
battery voltage and battery current measurement, input voltage, and
input current for different battery chemistries. The difference also
includes the calculation of setting and getting the actual voltage
setting applied to the charge voltage, as well as getting the die
temperature. Adding chip info structure to encapsulates these
differences by defining function pointers and parameters specific to
each device. This structure includes:
  - function pointers for getting and setting various parameters such as
    battery voltage, charge voltage, and die temperature
  - resolution parameters for battery current and input voltage
  - telemetry mask to specify which bits in the register are used for
    telemetry features

Signed-off-by: Kim Seer Paller <kimseer.paller@analog.com>
Link: https://lore.kernel.org/r/20241213023746.34168-3-kimseer.paller@analog.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ltc4162-l-charger.c