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

Commit c750b7d1 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 5c696a03 91037e76
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2944,6 +2944,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,
@@ -2958,6 +2960,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;
}

@@ -3459,6 +3464,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");
@@ -3508,9 +3516,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);