kernel:fuelgauge change
authorxuwei9 <xuwei9@lenovo.com>
Wed, 9 Jan 2019 09:00:25 +0000 (17:00 +0800)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:36:52 +0000 (17:36 +0800)
Change-Id: I220cb485941b70c2e53e22fb2123ca82dcc17009

drivers/power/supply/s2mu106_fuelgauge.c

index 013b168eae0a1b8ac5c7d393c52ce71755b2a903..455a89d939e250bd1b67b688ebfa64ea133a06c1 100755 (executable)
@@ -235,16 +235,6 @@ static void s2mu106_reset_fg(struct s2mu106_fuelgauge_data *fuelgauge)
        s2mu106_write_and_verify_reg_byte(fuelgauge->i2c, S2MU106_REG_FG_ID, temp);
        s2mu106_read_reg_byte(fuelgauge->i2c, S2MU106_REG_FG_ID, &temp);
 
-       pr_info("%s: S2MU106_REG_FG_ID = 0x%02x, data ver. = 0x%x\n", __func__,
-                       temp, fuelgauge->info.battery_param_ver);
-
-       /* Update battery parameter version */
-       s2mu106_read_reg_byte(fuelgauge->i2c, S2MU106_REG_FG_ID, &temp);
-       temp &= 0xF0;
-       temp |= (fuelgauge->info.battery_param_ver & 0x0F);
-       s2mu106_write_and_verify_reg_byte(fuelgauge->i2c, S2MU106_REG_FG_ID, temp);
-       s2mu106_read_reg_byte(fuelgauge->i2c, S2MU106_REG_FG_ID, &temp);
-
        pr_info("%s: S2MU106_REG_FG_ID = 0x%02x, data ver. = 0x%x\n", __func__,
                        temp, fuelgauge->info.battery_param_ver);
 
@@ -1706,6 +1696,11 @@ static int s2mu106_fuelgauge_parse_dt(struct s2mu106_fuelgauge_data *fuelgauge)
                        if (ret < 0)
                                pr_err("%s There is no cell2 battery parameter version\n", __func__);
 
+                       ret = of_property_read_u32(np, "battery,battery_param_ver_cell1",
+                                        &fuelgauge->info.battery_param_ver_cell1);
+                        if (ret < 0)
+                                pr_err("%s There is no cell1 battery parameter version\n", __func__);
+
                        ret = of_property_read_u32(np, "battery,low_temp_limit",
                                        &fuelgauge->low_temp_limit);
                        if (ret < 0) {
@@ -1879,10 +1874,6 @@ static int s2mu106_fuelgauge_probe(struct i2c_client *client,
 #endif
        fuelgauge->probe_done = true;
 
-       s2mu106_read_reg_byte(fuelgauge->i2c, S2MU106_REG_FG_ID, &temp);
-       pr_info("%s: parameter ver. in IC: 0x%02x, in kernel: 0x%02x\n", __func__,
-                       temp & 0x0F, fuelgauge->info.battery_param_ver);
-
        pr_info("%s: S2MU106 Fuelgauge Driver Loaded\n", __func__);
        return 0;