cw2217b: add some logs for soc jumping debug.

In order to debug the problem of fuel gauge soc jumping,
add some debug logs,

Change-Id: I5b6adf50d496126059366a0c322915a0f533acd4
Reviewed-on: https://gerrit.mot.com/2567828
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Tao Sun <suntao2@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 2023-04-06 19:48:09 +08:00 • committed by litong
commit e831fbc96e

View file

@ -707,6 +707,8 @@ static int cw2217_get_state(struct cw_battery *cw_bat)
ret = cw_read(cw_bat->client, REG_MODE_CONFIG, &reg_val);
if (ret < 0)
return ret;
cw_printk("REG_MODE_CONFIG 0x%2x = 0x%2x\n", REG_MODE_CONFIG, reg_val);
if (reg_val != CONFIG_MODE_ACTIVE)
return CW2217_NOT_ACTIVE;
@ -802,6 +804,11 @@ static void cw_hw_init_work(struct work_struct *work)
cw_bat = container_of(work, struct cw_battery, hw_init_work);
ret = cw_init_data(cw_bat);
if (ret) {
printk("%s : cw2217 init data fail!\n", __func__);
}
ret = cw_init(cw_bat);
while ((loop++ < CW_RETRY_COUNT) && (ret != 0)) {
msleep(CW_SLEEP_200MS);