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

Commit b73ea2a0 authored by Chunmei Cai's avatar Chunmei Cai Committed by Gerrit - the friendly Code Review server
Browse files

power: qpnp-charger: Make system awake in btc_hot_irq_debounce_work



There are two seconds sleep in qpnp_chg_btc_hot_irq_debounce_work
function to wait for charging back. System may going to suspend in this
two seconds sleep. Make system stay awake in this function.

Change-Id: Ifa8d616f7b4efe3b6013ade67114aecf13730e04
Signed-off-by: default avatarChunmei Cai <ccai@codeaurora.org>
parent 2a0e8b68
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -3883,12 +3883,14 @@ qpnp_chg_btc_hot_irq_debounce_work(struct work_struct *work)
	int rc, bat_therm_volt;
	u8 reg;

	pm_stay_awake(chip->dev);

	/* Get current BTC HOT_THD settings */
	rc = qpnp_chg_read(chip, &reg,
			chip->bat_if_base + BAT_IF_BTC_CTRL, 1);
	if (rc) {
		pr_err("failed to read BTC_CTRL rc=%d\n", rc);
		return;
		goto relax;
	}

	hot_thd_35_pct = (reg & BTC_HOT) ? true : false;
@@ -3899,7 +3901,7 @@ qpnp_chg_btc_hot_irq_debounce_work(struct work_struct *work)
	if (rc) {
		pr_err("Unable to read batt temperature rc=%d\n",
				rc);
		return;
		goto relax;
	}

	bat_therm_volt = results.measurement;
@@ -3914,7 +3916,7 @@ qpnp_chg_btc_hot_irq_debounce_work(struct work_struct *work)
		if (rc) {
			pr_err("failed to change HOT_THD to 25%% rc=%d\n",
					rc);
			return;
			goto relax;
		}
		bypass_btc_hot_comparator(chip, 1);

@@ -3931,9 +3933,16 @@ qpnp_chg_btc_hot_irq_debounce_work(struct work_struct *work)
		if (rc) {
			pr_err("failed to change HOT_THD to 35%% rc=%d\n",
					rc);
			return;
			goto relax;
		}
	} else {
		pr_debug("BAT temp status is not HOT\n");
		goto relax;
	}

relax:
	pm_relax(chip->dev);
	return;
}

static void