summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Yang <harryy@codeaurora.org>2017-02-14 15:56:21 -0800
committerHarry Yang <harryy@codeaurora.org>2017-02-14 16:24:11 -0800
commit367d29c80ee30136e8a65cb952a43d2ab3ed1525 (patch)
tree903e96b0cbbe3736707050ddc2a8af36134cb375
parent3a7e752617514960c5cecdf84e12b13dc63c04c7 (diff)
qcom: smb-lib: expose fcc value change in batt psy
Add CONSTANT_CHARGE_CURRENT_MAX, to set and get fcc. CRs-Fixed: 2004173 Change-Id: I3dfed0ca7b2a477e1c106955fa112ba5206e3fa4 Signed-off-by: Harry Yang <harryy@codeaurora.org>
-rw-r--r--drivers/power/supply/qcom/qpnp-smb2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/power/supply/qcom/qpnp-smb2.c b/drivers/power/supply/qcom/qpnp-smb2.c
index 244ed77c4318..c185496dee44 100644
--- a/drivers/power/supply/qcom/qpnp-smb2.c
+++ b/drivers/power/supply/qcom/qpnp-smb2.c
@@ -839,6 +839,7 @@ static enum power_supply_property smb2_batt_props[] = {
POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_VOLTAGE_MAX,
POWER_SUPPLY_PROP_CURRENT_NOW,
+ POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
POWER_SUPPLY_PROP_TEMP,
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_STEP_CHARGING_ENABLED,
@@ -908,6 +909,10 @@ static int smb2_batt_get_prop(struct power_supply *psy,
case POWER_SUPPLY_PROP_CURRENT_QNOVO:
val->intval = chg->qnovo_fcc_ua;
break;
+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
+ val->intval = get_client_vote(chg->fcc_votable,
+ DEFAULT_VOTER);
+ break;
case POWER_SUPPLY_PROP_TEMP:
rc = smblib_get_prop_batt_temp(chg, val);
break;
@@ -972,6 +977,9 @@ static int smb2_batt_set_prop(struct power_supply *psy,
chg->qnovo_fcc_ua = val->intval;
rc = rerun_election(chg->fcc_votable);
break;
+ case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX:
+ vote(chg->fcc_votable, DEFAULT_VOTER, true, val->intval);
+ break;
case POWER_SUPPLY_PROP_SET_SHIP_MODE:
/* Not in ship mode as long as the device is active */
if (!val->intval)