From a0c5ae4cec6590b9ead2cced25b96d78d69005bb Mon Sep 17 00:00:00 2001 From: huaqin85 Date: Tue, 11 Jan 2022 15:58:07 +0800 Subject: [PATCH] 2snd Fuelgauge SM5602 current direct set and coefficient 2Snd Fuelgauge SM5602 current direct set and coefficient need multiply 1000 Change-Id: I6e72dab8a7bc6d68f045908171f2a6656dcaa5c4 Signed-off-by: huaqin85 Reviewed-on: https://gerrit.mot.com/2167032 Reviewed-by: Yuecai Liu SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- drivers/power/sm5602_fg_mmi/sm5602_fg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/power/sm5602_fg_mmi/sm5602_fg.c b/drivers/power/sm5602_fg_mmi/sm5602_fg.c index 810162b325d1..ced112d476f5 100644 --- a/drivers/power/sm5602_fg_mmi/sm5602_fg.c +++ b/drivers/power/sm5602_fg_mmi/sm5602_fg.c @@ -46,6 +46,7 @@ #define RET_ERR -1 #define queue_delayed_work_time 8000//8000 #define queue_start_work_time 50 +#define SM_CUR_UNIT 1000 enum sm_fg_reg_idx { SM_FG_REG_DEVICE_ID = 0, @@ -615,6 +616,8 @@ static int fg_read_current(struct sm_fg_chip *sm) if (data & 0x8000) curr *= -1; } + + curr *= SM_CUR_UNIT * (-1); pr_err("curr = %d,data=%d\n",curr,data); return curr;