summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorNicholas Troast <ntroast@codeaurora.org>2017-01-27 13:55:49 -0800
committerNicholas Troast <ntroast@codeaurora.org>2017-01-27 14:07:10 -0800
commit635dca1f6ae9ed278357666b8210fcffc348cf29 (patch)
treeddfd60e19e2c334462180beca99de6fd88831107 /drivers/power
parent314869eb56763d34f91d5483b0d510267894fadd (diff)
smb-lib: fix unknown APSD result after CC2 workaround
If APSD is triggered while APSD is disabled the APSD_RESULT_STATUS register will be reset. APSD will trigger whenever both VBUS and CC have been debounced. This includes when VBUS is stable and CC is re-asserted. This is an issue particularly when the CC2 workaround re-asserts CC when PD performs a hard reset since APSD will be disabled. Fix this by configuring APSD to trigger only on VBUS before CC is re-asserted by the CC2 workaround. Change-Id: I507646faaab7aafeedb4104ad0ad5c32970270a6 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/qcom/smb-lib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/power/supply/qcom/smb-lib.c b/drivers/power/supply/qcom/smb-lib.c
index 62d8ae0c5f36..d3d79ec0c071 100644
--- a/drivers/power/supply/qcom/smb-lib.c
+++ b/drivers/power/supply/qcom/smb-lib.c
@@ -2315,6 +2315,12 @@ int smblib_reg_block_restore(struct smb_charger *chg,
static struct reg_info cc2_detach_settings[] = {
{
+ .reg = TYPE_C_CFG_REG,
+ .mask = APSD_START_ON_CC_BIT,
+ .val = 0,
+ .desc = "TYPE_C_CFG_REG",
+ },
+ {
.reg = TYPE_C_CFG_2_REG,
.mask = TYPE_C_UFP_MODE_BIT | EN_TRY_SOURCE_MODE_BIT,
.val = TYPE_C_UFP_MODE_BIT,