charger:fix sgm4154x ID detected incorrect issue

After qcom rebase qc/Divar.LA.2.1.1-00014-STD.PROD-1,
sgm4154x was always found even if there is no sgm4154x
hardware IC. Need return if read sgm4154x ID failed.

Change-Id: I08c39cb60de00addc32faee1ae945adb0cfc7053
Signed-off-by: Lei Chen <chenlei18@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2768596
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
This commit is contained in:
Lei Chen 2023-10-16 20:09:33 +08:00 • committed by Lei Chen
commit 1904ea8aeb

View file

@ -3517,6 +3517,10 @@ static int sgm4154x_probe(struct i2c_client *client,
i2c_set_clientdata(client, sgm);
ret = sgm4154x_hw_chipid_detect(sgm);
if (ret < 0) {
pr_info("[%s] device not found, ret = %d!!!\n", __func__, ret);
return ret;
}
#ifdef __SGM41513_CHIP_ID__
if ((ret & SGM4154x_PN_MASK) != SGM4154x_PN_41513_ID){