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

Commit 26132e37 authored by Jishnu Prakash's avatar Jishnu Prakash
Browse files

iio: adc: qcom-vadc-common: Change ADC7 die_temp output unit to mC



Change ADC7 die_temp output unit from C to mC, as thermal
framework expects temperatures to be reported in mC.

Change-Id: Ie14b745f7db625f399ac5f79b3467a1654ea4a21
Signed-off-by: default avatarJishnu Prakash <jprakash@codeaurora.org>
parent d76cd6ca
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1142,7 +1142,8 @@ static int qcom_vadc7_scale_hw_calib_die_temp(
	} else {
		vtemp0 = adcmap7_die_temp[i-1].x;
		voltage = voltage - vtemp0;
		temp = div64_s64(voltage, adcmap7_die_temp[i-1].y);
		temp = div64_s64(voltage * DIE_TEMP_ADC7_SCALE_FACTOR,
				adcmap7_die_temp[i-1].y);
		temp += DIE_TEMP_ADC7_SCALE_1 + (DIE_TEMP_ADC7_SCALE_2 * (i-1));
		*result_mdec = temp;
	}
+4 −3
Original line number Diff line number Diff line
@@ -86,9 +86,10 @@
#define R_PU_100K			100000
#define RATIO_MAX_ADC7		0x4000

#define DIE_TEMP_ADC7_SCALE_1				-60
#define DIE_TEMP_ADC7_SCALE_2				20
#define DIE_TEMP_ADC7_MAX				160
#define DIE_TEMP_ADC7_SCALE_1				-60000
#define DIE_TEMP_ADC7_SCALE_2				20000
#define DIE_TEMP_ADC7_SCALE_FACTOR			1000
#define DIE_TEMP_ADC7_MAX				160000

/**
 * struct vadc_map_pt - Map the graph representation for ADC channel