Re: [PATCH RESEND v2 3/3] power: supply: Introduce MM8013 fuel gauge driver

From: Sebastian Reichel
Date: Thu Sep 14 2023 - 15:17:26 EST


Hi,

On Thu, Sep 14, 2023 at 08:46:21PM +0200, Konrad Dybcio wrote:
> On 13.09.2023 17:45, Sebastian Reichel wrote:
> > On Wed, Aug 23, 2023 at 04:36:15PM +0200, Konrad Dybcio wrote:
> >> Add a driver for the Mitsumi MM8013 fuel gauge. The driver is a vastly
> >> cleaned up and improved version of the one that shipped in some obscure
> >> Lenovo downstream kernel [1], with some register definitions borrowed from
> >> ChromeOS EC platform code [2].
> >>
> >> [1] https://github.com/adazem009/kernel_lenovo_bengal/commit/b6b346427a871715709bd22aae449b9383f3b66b
> >> [2] https://chromium.googlesource.com/chromiumos/platform/ec/+/master/driver/battery/mm8013.h
> >> Signed-off-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>
> >> ---
> [...]

[...]

> >> + switch (psp) {
> >> + case POWER_SUPPLY_PROP_CAPACITY:
> >
> > this is in %, while the next two are in uAh. So the fuel gauge does
> > not provide the current capacity in uAh
> > (POWER_SUPPLY_PROP_CHARGE_NOW)?
> Yes. Doesn't seem like raw values are supported.

Ok. (It's quite unusual for a chip to provide design and full
capacity separatly, but not providing the current capacity.)

[...]

> > With the next submission please include a dump of the uevent
> > in sysfs in the cover letter or below the fold, so that its
> > easy to validty check if the reported values look sensible.
> State of what-will-be-sent in v(n+1), with additional fixups:
>
> POWER_SUPPLY_NAME=mm8013
> POWER_SUPPLY_TYPE=Battery
> POWER_SUPPLY_CAPACITY=100
> POWER_SUPPLY_CHARGE_FULL=7124
> POWER_SUPPLY_CHARGE_FULL_DESIGN=7500

The unit for the above two are uAh. So that would be 7.5 mAh. With
4.4V I expect you have something bigger than a coin cell, so that's
probably wrong :)

> POWER_SUPPLY_CURRENT_NOW=-122000
> POWER_SUPPLY_CYCLE_COUNT=27
> POWER_SUPPLY_HEALTH=Good
> POWER_SUPPLY_PRESENT=1
> POWER_SUPPLY_STATUS=Full
> POWER_SUPPLY_TEMP=324
> POWER_SUPPLY_VOLTAGE_NOW=4407000

Otherwise looks sensible.

Greetings,

-- Sebastian

Attachment: signature.asc
Description: PGP signature