mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 06:09:23 -04:00
fg/sm5602: Early detection device chipID
it should add device id detect before parse dtsi, otherwise it will effect other fgauge boot time Change-Id: If5d6e2de0a8783c40b4b60097baff1ffe3fa97e5 Reviewed-on: https://gerrit.mot.com/2144787 Reviewed-by: Huosheng Liao <liaohs@motorola.com> SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Submit-Approved: Jira Key
This commit is contained in:
parent
1963090b48
commit
bc1f9b3b7d
1 changed files with 8 additions and 5 deletions
|
|
@ -2173,11 +2173,6 @@ static bool fg_init(struct i2c_client *client)
|
|||
struct sm_fg_chip *sm = i2c_get_clientdata(client);
|
||||
|
||||
/*sm5602 i2c read check*/
|
||||
ret = fg_get_device_id(client);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: fail to do i2c read(%d)\n", __func__, ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fg_check_reg_init_need(client)) {
|
||||
ret = fg_reset(sm);
|
||||
|
|
@ -2631,8 +2626,16 @@ static int fg_battery_parse_dt(struct sm_fg_chip *sm)
|
|||
bool hal_fg_init(struct i2c_client *client)
|
||||
{
|
||||
struct sm_fg_chip *sm = i2c_get_clientdata(client);
|
||||
int ret = 0;
|
||||
|
||||
pr_info("sm5602 hal_fg_init...\n");
|
||||
|
||||
ret = fg_get_device_id(client);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: fail to do i2c read(%d)\n", __func__, ret);
|
||||
return false;
|
||||
}
|
||||
|
||||
mutex_lock(&sm->data_lock);
|
||||
if (client->dev.of_node) {
|
||||
/* Load common data from DTS*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue