Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 851e2168 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: qpnp-fg: check for battery empty status before reloading profile"

parents 2611a27d 4cab28ab
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1063,9 +1063,6 @@ static bool fg_is_batt_empty(struct fg_chip *chip)
		return false;
	}

	if (fg_debug_mask & FG_IRQS)
		pr_info("fg soc sts 0x%x\n", fg_soc_sts);

	return (fg_soc_sts & SOC_EMPTY) != 0;
}

@@ -2673,6 +2670,7 @@ wait:
	if (reg & PROFILE_INTEGRITY_BIT)
		fg_cap_learning_load_data(chip);
	if ((reg & PROFILE_INTEGRITY_BIT) && vbat_in_range
			&& !fg_is_batt_empty(chip)
			&& memcmp(chip->batt_profile, data, len - 4) == 0) {
		if (fg_debug_mask & FG_STATUS)
			pr_info("Battery profiles same, using default\n");
@@ -2680,10 +2678,13 @@ wait:
			schedule_work(&chip->dump_sram);
		goto done;
	}
	dump_sram(&chip->dump_sram);
	if ((fg_debug_mask & FG_STATUS) && !vbat_in_range)
		pr_info("Vbat out of range: v_current_pred: %d, v:%d\n",
				fg_data[FG_DATA_CPRED_VOLTAGE].value,
				fg_data[FG_DATA_VOLTAGE].value);
	if ((fg_debug_mask & FG_STATUS) && fg_is_batt_empty(chip))
		pr_info("battery empty\n");
	if (fg_debug_mask & FG_STATUS) {
		pr_info("Using new profile\n");
		print_hex_dump(KERN_INFO, "FG: loaded profile: ",