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

Commit ec1a75d9 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-gen3: Handle status change only after SOC is ready"

parents 4c3b9c19 962ffbd9
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -816,7 +816,7 @@ static int fg_get_prop_capacity(struct fg_chip *chip, int *val)
		return 0;
	}

	if (chip->battery_missing) {
	if (chip->battery_missing || !chip->soc_reporting_ready) {
		*val = BATT_MISS_SOC;
		return 0;
	}
@@ -2161,6 +2161,11 @@ static void status_change_work(struct work_struct *work)
		goto out;
	}

	if (!chip->soc_reporting_ready) {
		fg_dbg(chip, FG_STATUS, "Profile load is not complete yet\n");
		goto out;
	}

	rc = power_supply_get_property(chip->batt_psy, POWER_SUPPLY_PROP_STATUS,
			&prop);
	if (rc < 0) {
@@ -2227,7 +2232,7 @@ static void status_change_work(struct work_struct *work)
	fg_batt_avg_update(chip);

out:
	fg_dbg(chip, FG_POWER_SUPPLY, "charge_status:%d charge_type:%d charge_done:%d\n",
	fg_dbg(chip, FG_STATUS, "charge_status:%d charge_type:%d charge_done:%d\n",
		chip->charge_status, chip->charge_type, chip->charge_done);
	pm_relax(chip->dev);
}
@@ -2623,6 +2628,10 @@ done:
out:
	chip->soc_reporting_ready = true;
	vote(chip->awake_votable, PROFILE_LOAD, false, 0);
	if (!work_pending(&chip->status_change_work)) {
		pm_stay_awake(chip->dev);
		schedule_work(&chip->status_change_work);
	}
}

static void sram_dump_work(struct work_struct *work)