Re: [PATCH v2 1/8] power: supply: core: Add resistance power supply property
From: Fenglin Wu
Date: Fri Jul 25 2025 - 04:33:48 EST
On 7/7/2025 8:15 AM, Sebastian Reichel wrote:
Hi,
On Mon, Jun 30, 2025 at 04:28:14PM +0800, Fenglin Wu wrote:
On 6/22/2025 9:26 AM, Sebastian Reichel wrote:
On Fri, May 30, 2025 at 03:35:06PM +0800, Fenglin Wu via B4 Relay wrote:
From: Fenglin Wu <fenglin.wu@xxxxxxxxxxxxxxxx>
Some battery drivers provide the ability to export resistance as a
parameter. Add resistance power supply property for that purpose.
This is missing some information and the naming is bad.
Which resistance (I suppose battery internal resistance)?
That is heavily dependent on the battery temperature. So this needs
to document if this is for the current temperature or for some
specific one.
-- Sebastian
This is battery internal resistance calculated by battery management system,
using the real-time temperature measured by the thermistor inside the
battery pack.
I can update the name to something like "rt_internal_resistance" and update
the description accordingly.
Your message is kind of mixed signal to me.
If the BMS needs the thermistor to calculate the internal
resistance, it means the data is either not real-time, but
just adopting some fixed value to the current temperature,
or the internal resistance is adopted from the current
temperature to some fixed temperature.
My expectation would be, that the BMS instead actually measures the
internal resistance via ohm's and law and Kirchhoff's voltage law.
So please make sure to understand what data is actually provided by
the BMS for a proper ABI description.
Depending on the description I think 'internal_resistance' is a good
name.
Greetings,
-- Sebastian
Hi Sebastian,
Sorry for causing the confusion. I will try to clear it by explaining
how the battery resistance is calculated in Qcom BMS.
In Qcom BMS, it uses the Equivalent Series Resistance (ESR) parameter to
represent the battery’s real-time internal resistance. ESR changes
dynamically depending on factors like the battery’s state of charge
(SoC), temperature, charging or discharging status. To estimate ESR
accurately under different conditions, the BMS uses data obtained from
characterizing representative battery samples, mapping ESR values across
various temperatures and SoC levels under charging or discharging
status. The characterization process with those battery samples on test
bench would use ohm's law to calculate the battery resistance I think.
These data points serve as a reference for real-time resistance
estimation. During operation, the BMS software refers to this data and
adjusts ESR values according to real-time inputs, especially
temperature, which is typically measured by a thermistor inside the
battery pack.
I can use 'internal_resistance' if you think this is good to represent
this ESR parameter.
Thanks
Fenglin