power: pm8921-bms: Add connector resistance

The current software does not take in to account the resistance
introduced because of the battery connectors and rsense. This
needs to be accounted for when the battery resistance is
calculated.

Change-Id: I0f2b440bae8168868b26f35c8ec59a21d4906f0f
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/drivers/power/pm8921-bms.c b/drivers/power/pm8921-bms.c
index ab1e1c7..8259515 100644
--- a/drivers/power/pm8921-bms.c
+++ b/drivers/power/pm8921-bms.c
@@ -125,6 +125,7 @@
 	int			default_rbatt_mohm;
 	int			amux_2_trim_delta;
 	uint16_t		prev_last_good_ocv_raw;
+	unsigned int		rconn_mohm;
 };
 
 static struct pm8921_bms_chip *the_chip;
@@ -991,6 +992,10 @@
 				scalefactor, batt_temp, soc_rbatt);
 	rbatt = (rbatt * scalefactor) / 100;
 
+	rbatt += the_chip->rconn_mohm;
+	pr_debug("adding rconn_mohm = %d rbatt = %d\n",
+				the_chip->rconn_mohm, rbatt);
+
 	pr_debug("RBATT = %d\n", rbatt);
 	return rbatt;
 }
@@ -2306,6 +2311,7 @@
 	chip->calib_delay_ms = pdata->calib_delay_ms;
 	chip->max_voltage_uv = pdata->max_voltage_uv;
 	chip->batt_type = pdata->battery_type;
+	chip->rconn_mohm = pdata->rconn_mohm;
 	chip->start_percent = -EINVAL;
 	chip->end_percent = -EINVAL;
 	rc = set_battery_data(chip);