summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Troast <ntroast@codeaurora.org>2016-10-28 10:36:45 -0700
committerNicholas Troast <ntroast@codeaurora.org>2016-10-28 14:31:45 -0700
commit8645a77a4676cefbc353aed390becd325dbf9bb5 (patch)
tree95a3afeca2a9506db1de99009299c5320de8bf75
parentce610f2fc934e89c706a8030b25ce48accced28a (diff)
smb-lib: rerun APSD when any HVDCP adapter is detected
If HVDCP authentication starts before it is disabled then HVDCP 2.0 adapters will be detected as HVDCP 3.0. When PD fails, HVDCP authentication and HVDCP autonomous mode are re-enabled, but APSD is currently only rerun if a HVDCP 2.0 adapter was detected. Fix this by re-running APSD when any HVDCP adapter is detected so the HVDCP authentication and HVDCP autonomous mode take effect. Change-Id: I5cc37fc09145f31116efd5104144b32c791e0e27 Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
-rw-r--r--drivers/power/qcom-charger/smb-lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/qcom-charger/smb-lib.c b/drivers/power/qcom-charger/smb-lib.c
index 198e77469bbe..ce54f365b308 100644
--- a/drivers/power/qcom-charger/smb-lib.c
+++ b/drivers/power/qcom-charger/smb-lib.c
@@ -490,7 +490,7 @@ static int try_rerun_apsd_for_hvdcp(struct smb_charger *chg)
/* ensure hvdcp is enabled */
if (!get_effective_result(chg->hvdcp_disable_votable)) {
apsd_result = smblib_get_apsd_result(chg);
- if (apsd_result->pst == POWER_SUPPLY_TYPE_USB_HVDCP) {
+ if (apsd_result->bit & (QC_2P0_BIT | QC_3P0_BIT)) {
/* rerun APSD */
smblib_dbg(chg, PR_MISC, "rerun APSD\n");
smblib_masked_write(chg, CMD_APSD_REG,