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

Commit 5a0e7722 authored by Shiju Mathew's avatar Shiju Mathew
Browse files

power: bcl_peripheral: Fix reading current offset



Fix reading current offset from the correct register.
This improves the accuracy of the Ibat and vbat thresholds.

Change-Id: Iae68d6ed5ecf846636d49a63c1ad9dbe319fa8bc
Signed-off-by: default avatarShiju Mathew <shijum@codeaurora.org>
parent 5e498329
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -727,8 +727,8 @@ static int bcl_get_devicetree_data(struct spmi_device *spmi)
		goto bcl_dev_exit;
	}
	bcl_perph->param[BCL_PARAM_CURRENT].gain_factor_num *= val;
	ret = bcl_read_register((i_src & 0x01) ? BCL_I_GAIN_RSENSE
		: BCL_I_GAIN_BATFET, &val);
	ret = bcl_read_register((i_src & 0x01) ? BCL_I_OFFSET_RSENSE
		: BCL_I_OFFSET_BATFET, &val);
	if (ret) {
		pr_err("Error reading %s current offset. err:%d\n",
			(i_src & 0x01) ? "rsense" : "batfet", ret);