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 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1385623
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Yonghua Yan 2019-07-14 16:33:13 +08:00
commit f3a28daaf2

View file

@ -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;