power: use force voter in factory FCC and ICL config

Use force voter for factory FCC and ICL configuration during
factory test in case the configuration is overridden by SMB5
charger driver.

Mot-CRs-fixed: (CR)

Change-Id: I8647b42b6ca420a02312198fb56c7ee09edfbde3
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1345281
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Reviewed-by: Haijian Ma <mahj8@motorola.com>
Reviewed-by: Kenneth Kessler <kennykessler@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1355881
This commit is contained in:
Yonghua Yan 2019-04-29 11:41:05 +08:00
commit 93e9068acf

View file

@ -843,11 +843,9 @@ static ssize_t force_chg_ibatt_store(struct device *dev,
}
chg_current *= 1000; /* Convert to uA */
r = smblib_set_charge_param(mmi_chip, &mmi_chip->param.fcc, chg_current);
if (r < 0) {
pr_err("Factory Couldn't set masterfcc = %d rc=%d\n",
(int)chg_current, (int)r);
return r;
if(mmi_chip->fcc_votable) {
pmic_vote_force_val_set(mmi_chip->fcc_votable, chg_current);
pmic_vote_force_active_set(mmi_chip->fcc_votable, 1);
}
return r ? r : count;
@ -904,11 +902,9 @@ static ssize_t force_chg_iusb_store(struct device *dev,
}
usb_curr *= 1000; /* Convert to uA */
r = smblib_set_charge_param(mmi_chip, &mmi_chip->param.usb_icl, usb_curr);
if (r < 0) {
pr_err("Factory Couldn't set usb icl = %d rc=%d\n",
(int)usb_curr, (int)r);
return r;
if (mmi_chip->usb_icl_votable) {
pmic_vote_force_val_set(mmi_chip->usb_icl_votable, usb_curr);
pmic_vote_force_active_set(mmi_chip->usb_icl_votable, 1);
}
r = smblib_masked_write_mmi(mmi_chip, USBIN_ICL_OPTIONS_REG,