summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshay Jaiswal <ashayj@codeaurora.org>2017-03-28 17:19:47 +0530
committerAshay Jaiswal <ashayj@codeaurora.org>2017-04-05 10:19:49 +0530
commiteb367740c8f2db8aec2d55b8be29c3caf2d926ed (patch)
tree41a6e0c58b1640e591044b08152e34611389ed79
parent347cdf228abe816a694204fa15b80dba2436073d (diff)
qcom: smb2: disable parallel in restricted/thermal conditions
Add voting to disable parallel charger in case of restricted charging and when system temperature level changes from normal. Parallel charger gets re-enabled once thermal condition/FCC restrictions are removed. CRs-Fixed: 2014572 Change-Id: Ic26b3d93f2f3d582a2eb3c7b9ea0d27bbad24a50 Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
-rw-r--r--drivers/power/supply/qcom/battery.c4
-rw-r--r--drivers/power/supply/qcom/smb-lib.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/power/supply/qcom/battery.c b/drivers/power/supply/qcom/battery.c
index 53e6a4138f04..914a6e4eae64 100644
--- a/drivers/power/supply/qcom/battery.c
+++ b/drivers/power/supply/qcom/battery.c
@@ -233,6 +233,10 @@ static ssize_t restrict_chg_store(struct class *c, struct class_attribute *attr,
chip->restricted_charging_enabled = !!val;
+ /* disable parallel charger in case of restricted charging */
+ vote(chip->pl_disable_votable, RESTRICT_CHG_VOTER,
+ chip->restricted_charging_enabled, 0);
+
vote(chip->fcc_votable, RESTRICT_CHG_VOTER,
chip->restricted_charging_enabled,
chip->restricted_current);
diff --git a/drivers/power/supply/qcom/smb-lib.c b/drivers/power/supply/qcom/smb-lib.c
index 3d6503c42e2f..c9df25586da9 100644
--- a/drivers/power/supply/qcom/smb-lib.c
+++ b/drivers/power/supply/qcom/smb-lib.c
@@ -1785,6 +1785,10 @@ int smblib_set_prop_system_temp_level(struct smb_charger *chg,
return -EINVAL;
chg->system_temp_level = val->intval;
+ /* disable parallel charge in case of system temp level */
+ vote(chg->pl_disable_votable, THERMAL_DAEMON_VOTER,
+ chg->system_temp_level ? true : false, 0);
+
if (chg->system_temp_level == chg->thermal_levels)
return vote(chg->chg_disable_votable,
THERMAL_DAEMON_VOTER, true, 0);