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

Commit d13947e0 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "power: smb5-lib: Initialize nodes for SBUx and VPH_PWR channel"

parents 22b590bf 68107424
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -603,9 +603,13 @@
	qcom,auto-recharge-soc = <98>;
	io-channels = <&pm8150b_vadc ADC_USB_IN_V_16>,
		      <&pm8150b_vadc ADC_USB_IN_I>,
		      <&pm8150b_vadc ADC_SBUx>,
		      <&pm8150b_vadc ADC_VPH_PWR>,
		      <&pm8150b_vadc ADC_CHG_TEMP>;
	io-channel-names = "usb_in_voltage",
			   "usb_in_current",
			   "sbux_res",
			   "vph_voltage",
			   "chg_temp";
	qcom,battery-data = <&mtp_batterydata>;
	qcom,step-charging-enable;
+4 −0
Original line number Diff line number Diff line
@@ -526,9 +526,13 @@
	qcom,auto-recharge-soc = <98>;
	io-channels = <&pm8150b_vadc ADC_USB_IN_V_16>,
		      <&pm8150b_vadc ADC_USB_IN_I>,
		      <&pm8150b_vadc ADC_SBUx>,
		      <&pm8150b_vadc ADC_VPH_PWR>,
		      <&pm8150b_vadc ADC_CHG_TEMP>;
	io-channel-names = "usb_in_voltage",
			   "usb_in_current",
			   "sbux_res",
			   "vph_voltage",
			   "chg_temp";
	qcom,battery-data = <&qrd_batterydata>;
	qcom,sw-jeita-enable;
+30 −0
Original line number Diff line number Diff line
@@ -482,6 +482,36 @@ static int smb5_parse_dt(struct smb5 *chip)
		}
	}

	rc = of_property_match_string(node, "io-channel-names",
			"sbux_res");
	if (rc >= 0) {
		chg->iio.sbux_chan = iio_channel_get(chg->dev,
				"sbux_res");
		if (IS_ERR(chg->iio.sbux_chan)) {
			rc = PTR_ERR(chg->iio.sbux_chan);
			if (rc != -EPROBE_DEFER)
				dev_err(chg->dev, "USBIN_V channel unavailable, %ld\n",
						rc);
			chg->iio.sbux_chan = NULL;
			return rc;
		}
	}

	rc = of_property_match_string(node, "io-channel-names",
			"vph_voltage");
	if (rc >= 0) {
		chg->iio.vph_v_chan = iio_channel_get(chg->dev,
				"vph_voltage");
		if (IS_ERR(chg->iio.vph_v_chan)) {
			rc = PTR_ERR(chg->iio.vph_v_chan);
			if (rc != -EPROBE_DEFER)
				dev_err(chg->dev, "vph_voltage channel unavailable, %ld\n",
						rc);
			chg->iio.vph_v_chan = NULL;
			return rc;
		}
	}

	return 0;
}

+4 −0
Original line number Diff line number Diff line
@@ -4332,6 +4332,10 @@ static void smblib_iio_deinit(struct smb_charger *chg)
		iio_channel_release(chg->iio.usbin_i_chan);
	if (!IS_ERR_OR_NULL(chg->iio.temp_chan))
		iio_channel_release(chg->iio.temp_chan);
	if (!IS_ERR_OR_NULL(chg->iio.sbux_chan))
		iio_channel_release(chg->iio.sbux_chan);
	if (!IS_ERR_OR_NULL(chg->iio.vph_v_chan))
		iio_channel_release(chg->iio.vph_v_chan);
}

int smblib_init(struct smb_charger *chg)
+2 −0
Original line number Diff line number Diff line
@@ -251,6 +251,8 @@ struct smb_iio {
	struct iio_channel	*usbin_v_chan;
	struct iio_channel	*batt_i_chan;
	struct iio_channel	*connector_temp_chan;
	struct iio_channel	*sbux_chan;
	struct iio_channel	*vph_v_chan;
};

struct smb_charger {