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

Commit ab77bee9 authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

power: smb5-lib: Report USB voltage unconditionally



For PM8150 report USB voltage using the appropriate
ADC channel based on USB presence. For other PMICs
report USB voltage unconditionally. 

Change-Id: I2f267b960a2c73a65b85e72b0bff9a87df68b4e1
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 59f01699
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -3017,18 +3017,12 @@ int smblib_get_prop_usb_voltage_now(struct smb_charger *chg,
		return -ENODATA;
	}

	/* usb not present */
	if (!pval.intval) {
		val->intval = 0;
		return 0;
	}

	/*
	 * For PM8150B, use MID_CHG ADC channel because overvoltage is observed
	 * to occur randomly in the USBIN channel, particularly at high
	 * voltages.
	 */
	if (chg->smb_version == PM8150B_SUBTYPE)
	if (chg->smb_version == PM8150B_SUBTYPE && pval.intval)
		return smblib_read_mid_voltage_chan(chg, val);
	else
		return smblib_read_usbin_voltage_chan(chg, val);