Samsung patch:
Add CHARGE_FULL function.
From
6273ea9a561ac14306d2cd7c90d2dda6494f75dd Mon Sep 17 00:00:00 2001
From: Keunho Hwang <keunho.hwang@samsung.com>
Date: Fri, 1 Mar 2019 15:47:10 +0900
Subject: [PATCH] [Only-For-Test] driver: power: fix
POWER_SUPPLY_PROP_CHARGE_FULL property
Signed-off-by: Keunho Hwang <keunho.hwang@samsung.com>
Change-Id: I8fa3c449faf95d2cd0560732f49190e215f216cb
Signed-off-by: Wen Xie <xiewen3@motorola.com>
Reviewed-on: https://gerrit.mot.com/
1316280
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Wei Xu <xuwei9@lenovo.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
val->intval = value.intval;
break;
case POWER_SUPPLY_PROP_CHARGE_FULL:
- val->intval = 3500;
+ /*Get fuelgauge psy*/
+ psy = power_supply_get_by_name(battery->pdata->fuelgauge_name);
+ if (!psy)
+ return -EINVAL;
+ ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_CHARGE_FULL, &value);
+ if (ret < 0)
+ pr_err("%s: Fail to execute property\n", __func__);
+
+ val->intval = value.intval;
break;
case POWER_SUPPLY_PROP_CALIBRATE:
val->intval = battery->is_factory;
val->intval = fuelgauge->rmc * 1000;
break;
case POWER_SUPPLY_PROP_CHARGE_FULL:
- val->intval = fuelgauge->fcc;
+ /* Full charged capacity unit is uAh */
+ val->intval = fuelgauge->fcc * 1000;
break;
case POWER_SUPPLY_PROP_ENERGY_NOW:
break;