From 068ba044e95d8c212e2b21a72e0d89914834649b Mon Sep 17 00:00:00 2001 From: Lei Chen Date: Sat, 2 Apr 2022 14:09:30 +0800 Subject: [PATCH] bq2597x:retry to read nu2105 id Read nu2015 id failed in poweroff charing. Retry to read the nu2105 id again. Change-Id: I57637e2f666d6142a9563dbb59cea40f6f86542a Signed-off-by: Lei Chen Reviewed-on: https://gerrit.mot.com/2232735 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Haijian Ma Reviewed-by: Wei Xu Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- drivers/power/bq2597x_mmi_iio/bq2597x_mmi_iio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/power/bq2597x_mmi_iio/bq2597x_mmi_iio.c b/drivers/power/bq2597x_mmi_iio/bq2597x_mmi_iio.c index 4b6800be3e5f..51df178465ac 100644 --- a/drivers/power/bq2597x_mmi_iio/bq2597x_mmi_iio.c +++ b/drivers/power/bq2597x_mmi_iio/bq2597x_mmi_iio.c @@ -1355,6 +1355,9 @@ static int bq2597x_detect_device(struct bq2597x *bq) u8 data; ret = bq2597x_read_byte(bq, BQ2597X_REG_13, &data); + if (ret < 0) { + ret = bq2597x_read_byte(bq, BQ2597X_REG_13, &data); //Try again for NU2105 in poweroff charging + } if (ret == 0) { bq->part_no = data; bq->device_id = (data & BQ2597X_DEV_ID_MASK);