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

Commit 7537f4ca 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-qg: Clear the STATUS2 register during init"

parents d28d105e 269b2dcf
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2877,6 +2877,8 @@ static int qg_hw_init(struct qpnp_qg *chip)

static int qg_post_init(struct qpnp_qg *chip)
{
	u8 status = 0;

	/* disable all IRQs if profile is not loaded */
	if (!chip->profile_loaded) {
		vote(chip->vbatt_irq_disable_votable,
@@ -2891,6 +2893,9 @@ static int qg_post_init(struct qpnp_qg *chip)
	if (!chip->dt.esr_disable)
		qg_retrieve_esr_params(chip);

	/* read STATUS2 register to clear its last state */
	qg_read(chip, chip->qg_base + QG_STATUS2_REG, &status, 1);

	return 0;
}

@@ -3379,6 +3384,9 @@ static int process_suspend(struct qpnp_qg *chip)

	chip->suspend_data = false;

	/* read STATUS2 register to clear its last state */
	qg_read(chip, chip->qg_base + QG_STATUS2_REG, &status, 1);

	/* ignore any suspend processing if we are charging */
	if (chip->charge_status == POWER_SUPPLY_STATUS_CHARGING) {
		qg_dbg(chip, QG_DEBUG_PM, "Charging @ suspend - ignore processing\n");
@@ -3428,9 +3436,6 @@ static int process_suspend(struct qpnp_qg *chip)
		chip->suspend_data = true;
	}

	/* read STATUS2 register to clear its last state */
	qg_read(chip, chip->qg_base + QG_STATUS2_REG, &status, 1);

	qg_dbg(chip, QG_DEBUG_PM, "FIFO rt_length=%d sleep_fifo_length=%d default_s2_count=%d suspend_data=%d\n",
			fifo_rt_length, sleep_fifo_length,
			chip->dt.s2_fifo_length, chip->suspend_data);