Revert "(CR): qpnp-smbchrgr-mmi: Optimize charger current over Temp"

This reverts commit 8ccd0ad9716abe8c567fd05700e3936ab1f8f5fc.

Revert Type : Compile
Reverted by : ECSCM (a16821)
Root Cause : To resolve compilation issue by this fix.

Change-Id: Ia7c30d3e164735744d8e8e834db919ecf4936c29
Reviewed-on: https://gerrit.mot.com/1711831
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Raja Phani K <a16821@motorola.com>
Submit-Approved: Raja Phani K <a16821@motorola.com>
Tested-by: Raja Phani K <a16821@motorola.com>
This commit is contained in:
Raja Phani K 2020-08-02 23:42:53 -05:00
commit 72fd26a744

View file

@ -177,7 +177,6 @@ enum {
#define HEARTBEAT_DELAY_MS 5000
#define HEARTBEAT_DUAL_DELAY_MS 10000
#define HEARTBEAT_DUAL_DELAY_OCP_MS 750
#define HEARTBEAT_OCP_SETTLE_CNT 10
#define MAX_ALLOWED_OCP 10
#define HEARTBEAT_FACTORY_MS 1000
#define HEARTBEAT_DISCHARGE_MS 60000
@ -397,7 +396,6 @@ struct smb_mmi_charger {
int hvdcp_power_max;
int inc_hvdcp_cnt;
int hb_startup_cnt;
};
#define CHGR_FAST_CHARGE_CURRENT_CFG_REG (CHGR_BASE + 0x61)
@ -2512,7 +2510,6 @@ static int mmi_dual_charge_control(struct smb_mmi_charger *chg,
int target_fv;
int effective_fv;
int effective_fcc;
int scaled_fcc;
int ocp;
int sm_update;
bool voltage_full;
@ -2600,17 +2597,9 @@ static int mmi_dual_charge_control(struct smb_mmi_charger *chg,
effective_fv = get_effective_result(chg->fv_votable) / 1000;
effective_fcc = get_effective_result(chg->fcc_votable);
if (chg->hb_startup_cnt) {
chg->hb_startup_cnt--;
if (effective_fcc >= (main_p->target_fcc + flip_p->target_fcc) *1000 ) { // Safety check
sched_time = HEARTBEAT_DUAL_DELAY_OCP_MS;
}
else if (effective_fcc >= (main_p->target_fcc + flip_p->target_fcc) *1000 ) {
sched_time = HEARTBEAT_DUAL_DELAY_OCP_MS;
scaled_fcc = effective_fcc * 40/100; //scale chrg curr to avoid overshoot
effective_fcc -= scaled_fcc;
mmi_dbg(chg, "fccScaled: %d, NewFCC: %d\n", scaled_fcc, effective_fcc);
chg->hb_startup_cnt = HEARTBEAT_OCP_SETTLE_CNT;
effective_fcc = effective_fcc *7/10; // Scale down fcc if too high for init set
}
/* Check for Charge None */
@ -2729,13 +2718,12 @@ static int mmi_dual_charge_control(struct smb_mmi_charger *chg,
}
target_fcc = main_p->target_fcc + flip_p->target_fcc;
target_fcc -= scaled_fcc/1000; // subtract out scaled fcc correction
target_fcc -= main_p->ocp[main_p->pres_temp_zone];
target_fcc -= flip_p->ocp[flip_p->pres_temp_zone];
if ( (target_fcc < main_p->target_fcc) &&
(chg_stat_flip.batt_ma < flip_p->target_fcc) ) {
mmi_info(chg, "Target FCC adjust too much\n");
target_fcc = main_p->target_fcc;
//target_fcc = main_p->target_fcc; // temp hack for cold chrg test
}
if (((main_p->pres_chrg_step == STEP_MAX) ||
@ -4190,7 +4178,6 @@ static int smb_mmi_probe(struct platform_device *pdev)
chip->awake = false;
this_chip = chip;
device_init_wakeup(chip->dev, true);
chip->hb_startup_cnt = HEARTBEAT_OCP_SETTLE_CNT;
smb_mmi_chg_config_init(chip);