From f3a28daaf26b3b9b5b7fc2934e85c272a5667dac Mon Sep 17 00:00:00 2001 From: Yonghua Yan Date: Sun, 14 Jul 2019 16:33:13 +0800 Subject: [PATCH] power: Return effective FCC for constant current Return effective FCC for constant current in battery property in PMI632 chip platform as SMB5 QC driver does not support this property. Change-Id: I71e2c1559fad0ff3dd5dcd1eb75b6ccb0f5711a6 Signed-off-by: Yonghua Yan Reviewed-on: https://gerrit.mot.com/1385623 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index cd4565313899..9223f0201628 100644 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -3130,6 +3130,18 @@ static int batt_get_prop(struct power_supply *psy, case POWER_SUPPLY_PROP_CURRENT_MAX: val->intval = get_effective_result(chip->fcc_votable); break; + case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT: + if (chip->smb_version == PMI632_SUBTYPE) { + val->intval = get_effective_result(chip->fcc_votable); + break; + } + rc = power_supply_get_property(chip->qcom_psy, psp, val); + if (rc < 0) { + /* soft fail so uevents are not blocked */ + rc = 0; + val->intval = -EINVAL; + } + break; case POWER_SUPPLY_PROP_TEMP: if (chip->max_main_psy && chip->max_flip_psy) { union power_supply_propval main_psy_val;