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

Commit 516699a6 authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

power: bcl_peripheral: Update the ADC to vbat conversion formula



Update the ADC value to battery voltage conversion formula
to accommodate the 2 LSB ADC value error. Without this
correction, the existing formula was estimating a lower
battery voltage by 2 LSB ADC value.

CRs-Fixed: 919926
Change-Id: Ibfffbbb8923504c30bdc4032db27f19d0a00e808
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent 50ab4222
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ static void convert_adc_to_vbat_val(int *val)
	if (!bcl_perph)
		return;
	perph_data = &bcl_perph->param[BCL_PARAM_VOLTAGE];
	*val = (*val * perph_data->scaling_factor)
	*val = ((*val + 2) * perph_data->scaling_factor)
		* (100 + (perph_data->gain_factor_num * perph_data->gain)
		* BCL_CONSTANT_NUM  / perph_data->gain_factor_den)
		/ 100;