mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
power: qpnp-smbcharger-mmi: Handle DCIN presence
The heartbeat_work breaks and output error log when accesses the DCIN status register for presence detection. As the DCIN is not supported in PMI632 chip and the address at 0x14XX is undefined, so it return -ENODEV when access it. So for PMI632 chip, just consider it as successful with data 0 returned for DCIN presence check. Mot-CRs-fixed: (CR) Change-Id: Id459296ec20bb679e1803b820be1bd288a1cdc75 Signed-off-by: Yonghua Yan <yanyh2@motorola.com> Reviewed-on: https://gerrit.mot.com/1342040 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Kenneth Kessler <kennykessler@motorola.com> Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1355879
This commit is contained in:
parent
aed5336114
commit
ed1e4e9416
1 changed files with 11 additions and 1 deletions
|
|
@ -1438,9 +1438,19 @@ static int get_prop_dc_present(struct smb_mmi_charger *chg,
|
|||
int rc;
|
||||
u8 stat;
|
||||
|
||||
/*
|
||||
* PMI632 has no DCIN support and address at 0x14XX is undefined,
|
||||
* so just return 0 to avoid too much err log and heatbeat_work
|
||||
* break
|
||||
*/
|
||||
if (chg->smb_version == PMI632_SUBTYPE) {
|
||||
val->intval = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
rc = smblib_read_mmi(chg, DCIN_INT_RT_STS, &stat);
|
||||
if (rc < 0) {
|
||||
pr_err("Couldn't read USBIN_RT_STS rc=%d\n", rc);
|
||||
pr_err("Couldn't read DCIN_RT_STS rc=%d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue