power:fet_control Balance ckt Fet Close Batt2 over 200mV

Initial driver implementation considered main batt would always be
higher potential than secondary neck batt, either through balance R
or flex resistive paths. To be complete, be sure to take absolute
deltaV between the two batteries. This will ensure proper batt switch
control for either battery being higher potential.

Change-Id: Ia6f64dcb5da4dcff6e8207570e1972ad43b99f5b
Signed-off-by: Bernie Moreno-BERNIEM <berniem@motorola.com>
Reviewed-on: https://gerrit.mot.com/2141538
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Bernie Moreno-BERNIEM 2021-12-10 11:13:20 -06:00 • committed by Bernie Moreno
commit 804ffe4f5c

View file

@ -367,13 +367,14 @@ static void update_work(struct work_struct *work)
/* FET BattFET paths */
/* Leave Balance dflt-en & toggle in/out parallel low-Z battplus fet */
balance_state = 0;
if ((main_mv - flip_mv) < RBALANCE_VDIFF_MV) {
if ( abs(main_mv - flip_mv) < RBALANCE_VDIFF_MV) {
battplus_state = 1;
pr_info("battplus-EN: %d\n", battplus_state);
} else {
battplus_state = 0;
pr_info("battplus-DIS: %d\n", battplus_state);
}
if (main_chg == 1)
hb_sched_time = HBDLY_CHARGE_SEC;