Loading drivers/power/qpnp-fg.c +4 −2 Original line number Diff line number Diff line Loading @@ -2926,7 +2926,7 @@ static void fg_cap_learning_load_data(struct fg_chip *chip) static void fg_cap_learning_save_data(struct fg_chip *chip) { int16_t cc_mah; int64_t cc_to_soc_coeff; int64_t cc_to_soc_coeff, mah_to_soc; int rc; u8 data[2]; Loading @@ -2951,7 +2951,9 @@ static void fg_cap_learning_save_data(struct fg_chip *chip) if (rc) { pr_err("Failed to read mah_to_soc_conv_cs: %d\n", rc); } else { cc_to_soc_coeff = div64_s64(half_float(data), cc_mah); mah_to_soc = data[1] << 8 | data[0]; mah_to_soc *= MICRO_UNIT; cc_to_soc_coeff = div64_s64(mah_to_soc, cc_mah); half_float_to_buffer(cc_to_soc_coeff, data); rc = fg_mem_write(chip, (u8 *)data, ACTUAL_CAPACITY_REG, 2, Loading Loading
drivers/power/qpnp-fg.c +4 −2 Original line number Diff line number Diff line Loading @@ -2926,7 +2926,7 @@ static void fg_cap_learning_load_data(struct fg_chip *chip) static void fg_cap_learning_save_data(struct fg_chip *chip) { int16_t cc_mah; int64_t cc_to_soc_coeff; int64_t cc_to_soc_coeff, mah_to_soc; int rc; u8 data[2]; Loading @@ -2951,7 +2951,9 @@ static void fg_cap_learning_save_data(struct fg_chip *chip) if (rc) { pr_err("Failed to read mah_to_soc_conv_cs: %d\n", rc); } else { cc_to_soc_coeff = div64_s64(half_float(data), cc_mah); mah_to_soc = data[1] << 8 | data[0]; mah_to_soc *= MICRO_UNIT; cc_to_soc_coeff = div64_s64(mah_to_soc, cc_mah); half_float_to_buffer(cc_to_soc_coeff, data); rc = fg_mem_write(chip, (u8 *)data, ACTUAL_CAPACITY_REG, 2, Loading