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

Commit cc3e953c authored by Shiju Mathew's avatar Shiju Mathew
Browse files

power: bcl_peripheral: Fix Ibat calculation



Fix Ibat calculation. This is required since Ibat
reading is showing high values even when the current
is low. This will lead to unnecessary mitigation.

Change-Id: I1b1442d1576675d6eb7aafbcd8767d95b48feff2
Signed-off-by: default avatarShiju Mathew <shijum@codeaurora.org>
parent 6a8a77bd
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ static void convert_ibat_to_adc_val(int *val)
		return;
	perph_data = &bcl_perph->param[BCL_PARAM_CURRENT];
	*val /= (*val * 100 / (100 + perph_data->gain_factor_num
		* BCL_CONSTANT_NUM / perph_data->offset_factor_den)
		* BCL_CONSTANT_NUM / perph_data->gain_factor_den)
		- perph_data->offset_factor_num
		/ perph_data->offset_factor_den)
		/  perph_data->scaling_factor;
@@ -197,7 +197,7 @@ static void convert_adc_to_ibat_val(int *val)
		+ perph_data->offset_factor_num
		/ perph_data->offset_factor_den)
		* (100 + perph_data->gain_factor_num
		* BCL_CONSTANT_NUM / perph_data->offset_factor_den) / 100;
		* BCL_CONSTANT_NUM / perph_data->gain_factor_den) / 100;
	return;
}