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

Commit 0c910d0e authored by Siddartha Mohanadoss's avatar Siddartha Mohanadoss
Browse files

hwmon: qpnp-adc-current: Fix specifying batfet status



For the condition when PM8941 is true use the BATFET status
that is passed to the calibration api. Ignore the BATFET
status for all other PMIC versions.

For PM8941 when BATFET is open, the reads on channel 0 for
Internal RSENSE are redirected in HW to channel 0x5:
 EXTRSNS_OFFSET. Recalibrate based on this channel.

Change-Id: Ib0d477c5fb4537379b31faf1676d5956317b06a7
CRs-Fixed: 629758
Signed-off-by: default avatarSiddartha Mohanadoss <smohanad@codeaurora.org>
parent 71ee1119
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -934,7 +934,8 @@ int32_t qpnp_iadc_calibrate_for_trim(struct qpnp_iadc_chip *iadc,
	else
		iadc_offset_ch_batfet_check = false;

	if (iadc_offset_ch_batfet_check || iadc->external_rsense) {
	if ((iadc_offset_ch_batfet_check && !batfet_closed) ||
						(iadc->external_rsense)) {
		/* external offset calculation */
		rc = qpnp_iadc_configure(iadc, OFFSET_CALIBRATION_CSP_CSN,
						&raw_data, mode_sel);