mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
power: read the usbin suspend state from 0x110B
The usbin suspend may be triggered by sw command, AICL or light flashing. So it may cause auto power off for factory kill when test the camera flash LED. The bit6 of register 0x110B can indicate usbin suspend state in all above cases. Change-Id: I91d0412cc7bfcbb64e65711869e519a32740964a Signed-off-by: Yonghua Yan <yanyh2@motorola.com> Reviewed-on: https://gerrit.mot.com/1368541 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Haijian Ma <mahj8@motorola.com> Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
4254d42b21
commit
101f05d8b6
1 changed files with 6 additions and 3 deletions
|
|
@ -85,6 +85,9 @@ static struct smb_mmi_charger *this_chip = NULL;
|
|||
#define BATTERY_CHARGER_STATUS_MASK (GENMASK(2, 0))
|
||||
#define PM8150B_JEITA_EN_CFG_REG (CHGR_BASE + 0x90)
|
||||
|
||||
#define POWER_PATH_STATUS_REG (DCDC_BASE + 0x0B)
|
||||
#define USBIN_SUSPEND_STS_BIT BIT(6)
|
||||
|
||||
#define DCDC_CFG_REF_MAX_PSNS_REG (DCDC_BASE + 0x8C)
|
||||
|
||||
#define USBIN_INT_RT_STS (USBIN_BASE + 0x10)
|
||||
|
|
@ -659,12 +662,12 @@ int smblib_get_usb_suspend(struct smb_mmi_charger *chg, int *suspend)
|
|||
int rc = 0;
|
||||
u8 temp;
|
||||
|
||||
rc = smblib_read_mmi(chg, USBIN_CMD_IL_REG, &temp);
|
||||
rc = smblib_read_mmi(chg, POWER_PATH_STATUS_REG, &temp);
|
||||
if (rc < 0) {
|
||||
mmi_err(chg, "Couldn't read USBIN_CMD_IL rc=%d\n", rc);
|
||||
mmi_err(chg, "Couldn't read POWER_PATH_STATUS_REG rc=%d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
*suspend = temp & USBIN_SUSPEND_BIT;
|
||||
*suspend = temp & USBIN_SUSPEND_STS_BIT;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue