max1720x_battery: read battery serial number
Read battery serial number feature from EEPROM
for manufactory and Suez.
Bug: 149541536
Bug: 172400866
Signed-off-by: Jenny Ho <[email protected]>
Change-Id: I1f1a4b92898235f2256e23b03cdb62544cf8fcc1
diff --git a/max1720x_battery.c b/max1720x_battery.c
index 1a9abd0..708c28f 100644
--- a/max1720x_battery.c
+++ b/max1720x_battery.c
@@ -170,7 +170,7 @@
int previous_qh;
int current_capacity;
int prev_charge_status;
- char serial_number[25];
+ char serial_number[30];
bool offmode_charger;
s32 convgcfg_hysteresis;
int nb_convgcfg;
@@ -3833,6 +3833,12 @@
char buff[32] = {0};
int ret;
+ ret = gbms_storage_read(GBMS_TAG_MINF, buff, GBMS_MINF_LEN);
+ if (ret >= 0) {
+ strncpy(chip->serial_number, buff, ret);
+ return;
+ }
+
ret = gbms_storage_read(GBMS_TAG_SNUM, buff, sizeof(buff));
if (ret < 0) {
/* do nothing */