From e8662c7b5da7e34f4372858fbb9c52830074198d Mon Sep 17 00:00:00 2001 From: Anirudh Ghayal Date: Mon, 27 Mar 2017 16:19:20 +0530 Subject: [PATCH] power: smb-lib: Rerun APSD regardless of charger-type It is observed that the USB_PHY may interfere with APSD when the charger is inserted at PON. This may lead to incorrect charger type detection. Fix this by doing a APSD re-run during driver initialization if USB is present and regardless of the charger type. CRs-Fixed: 2011764 Change-Id: Icc9ee7bacf0eecdb311ca52979758514abca154e Signed-off-by: Anirudh Ghayal --- drivers/power/supply/qcom/smb-lib.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/power/supply/qcom/smb-lib.c b/drivers/power/supply/qcom/smb-lib.c index 50af1087278a..dc6272f461cf 100644 --- a/drivers/power/supply/qcom/smb-lib.c +++ b/drivers/power/supply/qcom/smb-lib.c @@ -725,7 +725,6 @@ void smblib_suspend_on_debug_battery(struct smb_charger *chg) int smblib_rerun_apsd_if_required(struct smb_charger *chg) { - const struct apsd_result *apsd_result; union power_supply_propval val; int rc; @@ -738,12 +737,6 @@ int smblib_rerun_apsd_if_required(struct smb_charger *chg) if (!val.intval) return 0; - apsd_result = smblib_get_apsd_result(chg); - if ((apsd_result->pst != POWER_SUPPLY_TYPE_UNKNOWN) - && (apsd_result->pst != POWER_SUPPLY_TYPE_USB)) - /* if type is not usb or unknown no need to rerun apsd */ - return 0; - /* fetch the DPDM regulator */ if (!chg->dpdm_reg && of_get_property(chg->dev->of_node, "dpdm-supply", NULL)) {