power: smb5: Implement charge termination WA

Currently post charge termination, if the charger switches to BSM mode,
then there exist a possibility of battery being overcharged. This is
due to finite delay in opening of BATFET post its requirement to stay
in BSM mode, allowing charge current to leak into the battery, resulting
in over charge.

Add a SW WA to suspend input, once cc_soc increases beyond a certain
threshold post termination.

Change-Id: I6c1966bb69445c89bc29b099ab9adf2d5f3e2334
Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
diff --git a/drivers/power/supply/qcom/qpnp-smb5.c b/drivers/power/supply/qcom/qpnp-smb5.c
index 0a677ec..7994741 100644
--- a/drivers/power/supply/qcom/qpnp-smb5.c
+++ b/drivers/power/supply/qcom/qpnp-smb5.c
@@ -282,7 +282,8 @@
 		break;
 	case PMI632_SUBTYPE:
 		chip->chg.smb_version = PMI632_SUBTYPE;
-		chg->wa_flags |= WEAK_ADAPTER_WA | USBIN_OV_WA;
+		chg->wa_flags |= WEAK_ADAPTER_WA | USBIN_OV_WA |
+					CHG_TERMINATION_WA;
 		if (pmic_rev_id->rev4 >= 2)
 			chg->wa_flags |= MOISTURE_PROTECTION_WA;
 		chg->param = smb5_pmi632_params;