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

Commit 66e48b42 authored by Rama Krishna Phani A's avatar Rama Krishna Phani A
Browse files

thermal: qpnp-adc-tm: Keep VADC_TM peripheral always enabled



After a client issues a threshold monitoring request and
once the thresholds are enabled on the ADC_TM there are
cases where the client can request to disable the ADC_TM
requests. If there are other conversions taking place
on other VADC peripherals this may cause the data from the
ADC_TM peripheral to be latched to the next request from
other VADC peripheral leading to incorrect results. Therefore
keep the ADC_TM peripheral enabled.

Change-Id: I4415e5bf5430667057588694f3146c4355968428
Signed-off-by: default avatarRama Krishna Phani A <rphani@codeaurora.org>
parent 463d8c28
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -469,19 +469,13 @@ static int32_t qpnp_adc_tm_disable(struct qpnp_adc_tm_chip *chip)
	u8 data = 0;
	int rc = 0;

	if (chip->adc_tm_hc) {
		rc = qpnp_adc_tm_write_reg(chip, QPNP_BTM_CONV_REQ, data, 1);
		if (rc < 0) {
			pr_err("adc-tm enable failed\n");
			return rc;
		}
	}

	if (!chip->adc_tm_hc) {
		rc = qpnp_adc_tm_write_reg(chip, QPNP_EN_CTL1, data, 1);
		if (rc < 0) {
			pr_err("adc-tm disable failed\n");
			return rc;
		}
	}

	return rc;
}