lkml.org 
[lkml]   [2016]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/2] power: supply: max17042_battery: use VF SOC register for capacity property
    Date
    The capacity property uses the RepSOC register to report the current state
    of charge. This register did not provide a reliable SOC value during my
    testing with the max17047 variant on a Galaxy S3 (Trats2/GT-I9300). The
    reported value did not change or even stayed zero in some cases.
    However, the VF SOC register provided an accurate SOC value at all times.
    It uses the voltage fuel gauge to determine the SOC.

    Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
    ---
    drivers/power/max17042_battery.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
    index da7a75f..20cb1fd 100644
    --- a/drivers/power/max17042_battery.c
    +++ b/drivers/power/max17042_battery.c
    @@ -246,7 +246,7 @@ static int max17042_get_property(struct power_supply *psy,
    val->intval = data * 625 / 8;
    break;
    case POWER_SUPPLY_PROP_CAPACITY:
    - ret = regmap_read(map, MAX17042_RepSOC, &data);
    + ret = regmap_read(map, MAX17042_VFSOC, &data);
    if (ret < 0)
    return ret;

    --
    Website: https://fossencdi.org
    OpenPGP: 0F30 D1A0 2F73 F70A 6FEE 048E 5816 A24C 1075 7FC4
    Key download: https://wiedmeyer.de/keys/ww.asc
    \
     
     \ /
      Last update: 2016-09-25 23:11    [W:3.980 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site