mbox series

[0/7] Some fixes and improvments for cpcap battery and charger

Message ID 20190407181254.64537-1-tony@atomide.com (mailing list archive)
Headers show
Series Some fixes and improvments for cpcap battery and charger | expand

Message

Tony Lindgren April 7, 2019, 6:12 p.m. UTC
Hi all,

I've been trying to figure out how come the coulomb counter on droid 4 is off
especially for the low power consumption values. Turns out the "coulomb counter"
values correlate better with average power consumption if we divide the value with
number of samples. Otherwise we have a curve instead of flat correlation between
the register values and power consumed. I have some patches coming up eventually to
fix that, but meanwhile I've noticed some minor issues in general that would be
good to have out of the way.

I've only tagged the first one with fixes tag, the other ones can certainly wait
for the merge window considering further changes are needed at least for low power
consumption values.

Regards,

Tony


Tony Lindgren (7):
  power: supply: cpcap-battery: Fix division by zero
  power: supply: cpcap-battery: Fix low battery check
  power: supply: cpcap-battery: Fix signed counter sample register
  power: supply: cpcap-battery: Fix coulomb counter calibration register
    use
  power: supply: cpcap-battery: Use accumulator for current and power
    average
  power: supply: cpcap-battery: Fix pointless EPROBE_DEFER warnings
  power: supply: cpcap-charger: Fix pointless EPROBE_DEFER warnings

 drivers/power/supply/cpcap-battery.c | 45 +++++++++++++++-------------
 drivers/power/supply/cpcap-charger.c |  5 ++--
 2 files changed, 27 insertions(+), 23 deletions(-)

Comments

Sebastian Reichel April 15, 2019, 9:31 p.m. UTC | #1
Hi,

On Sun, Apr 07, 2019 at 11:12:47AM -0700, Tony Lindgren wrote:
> I've been trying to figure out how come the coulomb counter on droid 4 is off
> especially for the low power consumption values. Turns out the "coulomb counter"
> values correlate better with average power consumption if we divide the value with
> number of samples. Otherwise we have a curve instead of flat correlation between
> the register values and power consumed. I have some patches coming up eventually to
> fix that, but meanwhile I've noticed some minor issues in general that would be
> good to have out of the way.
> 
> I've only tagged the first one with fixes tag, the other ones can certainly wait
> for the merge window considering further changes are needed at least for low power
> consumption values.

Thanks, all queued.

-- Sebastian
Tony Lindgren May 18, 2019, 6:33 p.m. UTC | #2
Hi all,

Just to follow-up on the information below.

* Tony Lindgren <tony@atomide.com> [190407 11:13]:
> I've been trying to figure out how come the coulomb counter on droid 4 is off
> especially for the low power consumption values. Turns out the "coulomb counter"
> values correlate better with average power consumption if we divide the value with
> number of samples. Otherwise we have a curve instead of flat correlation between
> the register values and power consumed. I have some patches coming up eventually to
> fix that, but meanwhile I've noticed some minor issues in general that would be
> good to have out of the way.

So I've compared measurements from my power supply to measurements from
Baylibre ACME ina226, custom ina226 setup and ARM Energy Probe, and turns
out it's my power supply that has started wrong values and propably needs
calibration :)

So apologies for bashing the cpcap coulomb counter, it seems it's already
quite accurate showing average few mW less over 3 minute sample period
compared to my other measurements.

Regards,

Tony