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

Commit 0af5e3fc authored by Jishnu Prakash's avatar Jishnu Prakash
Browse files

hwmon: qpnp-adc: Remove calibration in vadc_hc_read



Software calibration is not required in hardware calibrated
peripheral. Remove calibration call in voltage read function
for hardware calibrated peripheral.

Change-Id: Icb311db384221b801207b2063c33545e4ba6b27f
Signed-off-by: default avatarJishnu Prakash <jprakash@codeaurora.org>
parent 513494c8
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@
#include <linux/power_supply.h>
#include <linux/thermal.h>

#define QPNP_VADC_HC_VREF_CODE	0x4000

/* QPNP VADC register definition */
#define QPNP_VADC_REVISION1				0x0
#define QPNP_VADC_REVISION2				0x1
@@ -558,6 +560,7 @@ int32_t qpnp_vadc_hc_read(struct qpnp_vadc_chip *vadc,
		goto fail_unlock;
	}

	if (vadc->adc->adc_prop->full_scale_code == QPNP_VADC_HC_VREF_CODE) {
		if (!vadc->vadc_init_calib) {
			rc = qpnp_vadc_calib_device(vadc);
			if (rc) {
@@ -567,6 +570,7 @@ int32_t qpnp_vadc_hc_read(struct qpnp_vadc_chip *vadc,
				vadc->vadc_init_calib = true;
			}
		}
	}

	calib_type = vadc->adc->adc_channels[dt_index].calib_type;
	if (calib_type >= ADC_HC_CAL_SEL_NONE) {