summaryrefslogtreecommitdiff
path: root/drivers/power/qcom-charger/qpnp-qnovo.c
diff options
context:
space:
mode:
authorAbhijeet Dharmapurikar <adharmap@codeaurora.org>2016-07-08 11:39:23 -0700
committerAbhijeet Dharmapurikar <adharmap@codeaurora.org>2016-07-20 17:46:58 -0700
commitcb5b737ccfdaa6deb023fd8865c23c9e6610e284 (patch)
treeffd53fb3df90a2ac0d00e8169b0407520a50f236 /drivers/power/qcom-charger/qpnp-qnovo.c
parent14e3191326bace52dfef6d0fb8702882a55936c7 (diff)
smb-lib: Add support for thermal daemon throttling fcc
Add support to configure the reduced fcc as per thermal mitigation levels. At the max level disable charging and at the lowest level (zero) remove all the mitigation. The intermediate levels would end up configuring a reduced fcc. Note that between the profile and Qnovo, the driver needs to choose the maximum fcc. However, if thermal mitigation is active i.e. it is at any level above zero, this needs to reduced to the fcc at that thermal level. Use cascaded votables for this, where profile and qnovo usecase vote for FCC_MAX and the result of FCC_MAX and thermal levels vote for fcc. Change-Id: I4f72857557222cbd719da7bd177511951ef7f1ff Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Diffstat (limited to 'drivers/power/qcom-charger/qpnp-qnovo.c')
-rw-r--r--drivers/power/qcom-charger/qpnp-qnovo.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/power/qcom-charger/qpnp-qnovo.c b/drivers/power/qcom-charger/qpnp-qnovo.c
index d50188a5efbf..2418b112d670 100644
--- a/drivers/power/qcom-charger/qpnp-qnovo.c
+++ b/drivers/power/qcom-charger/qpnp-qnovo.c
@@ -153,7 +153,7 @@ struct qnovo {
struct work_struct status_change_work;
int fv_uV_request;
int fcc_uA_request;
- struct votable *fcc_votable;
+ struct votable *fcc_max_votable;
struct votable *fv_votable;
};
@@ -243,8 +243,9 @@ static int qnovo_disable_cb(struct votable *votable, void *data, int disable,
vote(chip->fv_votable, QNOVO_VOTER, false, 0);
}
if (chip->fcc_uA_request != -EINVAL) {
- if (chip->fcc_votable)
- vote(chip->fcc_votable, QNOVO_VOTER, false, 0);
+ if (chip->fcc_max_votable)
+ vote(chip->fcc_max_votable, QNOVO_VOTER,
+ false, 0);
}
}
@@ -265,10 +266,10 @@ static int qnovo_disable_cb(struct votable *votable, void *data, int disable,
true, chip->fv_uV_request);
}
if (chip->fcc_uA_request != -EINVAL) {
- if (!chip->fcc_votable)
- chip->fcc_votable = find_votable("FCC");
- if (chip->fcc_votable)
- vote(chip->fcc_votable, QNOVO_VOTER,
+ if (!chip->fcc_max_votable)
+ chip->fcc_max_votable = find_votable("FCC_MAX");
+ if (chip->fcc_max_votable)
+ vote(chip->fcc_max_votable, QNOVO_VOTER,
true, chip->fcc_uA_request);
}
}