mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
power: qpnp-smb5: Do not set BC1P2_START_ON_CC on DAM
Do not set BC1P2_START_ON_CC on detecting a DAM cable to avoid a device brown-out. Change-Id: I9192c6d2e89170585b98cbbaa8762aeffe66949e Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
This commit is contained in:
parent
fa7a9cba6e
commit
2dbb68e04e
2 changed files with 14 additions and 3 deletions
|
|
@ -1503,15 +1503,25 @@ static int smb5_configure_typec(struct smb_charger *chg)
|
|||
|
||||
smblib_apsd_enable(chg, true);
|
||||
|
||||
rc = smblib_masked_write(chg, TYPE_C_CFG_REG,
|
||||
BC1P2_START_ON_CC_BIT, 0);
|
||||
rc = smblib_read(chg, TYPE_C_SNK_STATUS_REG, &value);
|
||||
if (rc < 0) {
|
||||
dev_err(chg->dev, "failed to write TYPE_C_CFG_REG rc=%d\n",
|
||||
dev_err(chg->dev, "failed to read TYPE_C_SNK_STATUS_REG rc=%d\n",
|
||||
rc);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (!(value & SNK_DAM_MASK)) {
|
||||
rc = smblib_masked_write(chg, TYPE_C_CFG_REG,
|
||||
BC1P2_START_ON_CC_BIT, 0);
|
||||
if (rc < 0) {
|
||||
dev_err(chg->dev, "failed to write TYPE_C_CFG_REG rc=%d\n",
|
||||
rc);
|
||||
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* Use simple write to clear interrupts */
|
||||
rc = smblib_write(chg, TYPE_C_INTERRUPT_EN_CFG_1_REG, 0);
|
||||
if (rc < 0) {
|
||||
|
|
|
|||
|
|
@ -335,6 +335,7 @@ enum {
|
|||
********************************/
|
||||
#define TYPE_C_SNK_STATUS_REG (TYPEC_BASE + 0x06)
|
||||
#define DETECTED_SRC_TYPE_MASK GENMASK(6, 0)
|
||||
#define SNK_DAM_MASK GENMASK(6, 4)
|
||||
#define SNK_DAM_500MA_BIT BIT(6)
|
||||
#define SNK_DAM_1500MA_BIT BIT(5)
|
||||
#define SNK_DAM_3000MA_BIT BIT(4)
|
||||
|
|
|
|||
Loading…
Reference in a new issue