From 8645a77a4676cefbc353aed390becd325dbf9bb5 Mon Sep 17 00:00:00 2001 From: Nicholas Troast Date: Fri, 28 Oct 2016 10:36:45 -0700 Subject: 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 --- drivers/power/qcom-charger/smb-lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- cgit v1.2.3