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

Commit cb813fd5 authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
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: I6179e653e366676045fd4ce071013f41abd30d50
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 96350e81
Loading
Loading
Loading
Loading
+2 −17
Original line number Diff line number Diff line
/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -256,22 +256,7 @@ static int32_t qpnp_adc_tm_enable(struct qpnp_adc_tm_chip *chip)

static int32_t qpnp_adc_tm_disable(struct qpnp_adc_tm_chip *chip)
{
	u8 data = 0;
	int rc = 0;

	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;
	}

	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;
	return 0;
}

static int qpnp_adc_tm_is_valid(struct qpnp_adc_tm_chip *chip)