power: qpnp-smb5: Handle cc_soc jump in the overcharge WA

There may be a jump in cc_soc due to a change in learnt
capacity or a good_ocv update. Fix this by detecting
a cc_soc jump by comparing against its last value.
Reinitialize the cc_soc_reference if a jump is detected.

Change-Id: I7a016cdf89904f4d5ecbfd9b9afbd05fbfe6244c
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
diff --git a/drivers/power/supply/qcom/smb5-lib.h b/drivers/power/supply/qcom/smb5-lib.h
index 64b640f..63061da 100644
--- a/drivers/power/supply/qcom/smb5-lib.h
+++ b/drivers/power/supply/qcom/smb5-lib.h
@@ -413,6 +413,7 @@
 	bool			fcc_stepper_enable;
 	int			charge_full_cc;
 	int			cc_soc_ref;
+	int			last_cc_soc;
 
 	/* workaround flag */
 	u32			wa_flags;