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

Commit d2477562 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qcom-charger: smb2: Only change wipower watts if defined in dtsi"

parents 51cabc94 52ca8e3c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@
					   "usbin_i",
					   "usbin_v";

			qcom,wipower-max-uw = <5000000>;
			dpdm-supply = <&qusb_phy0>;

			qcom,thermal-mitigation
+6 −3
Original line number Diff line number Diff line
@@ -279,10 +279,10 @@ static int smb2_parse_dt(struct smb2 *chip)
	if (rc < 0)
		chip->dt.dc_icl_ua = -EINVAL;

	rc = of_property_read_u32(node,
			"qcom,wipower-max-uw", &chip->dt.wipower_max_uw);
	rc = of_property_read_u32(node, "qcom,wipower-max-uw",
				&chip->dt.wipower_max_uw);
	if (rc < 0)
		chip->dt.wipower_max_uw	= SMB2_DEFAULT_WPWR_UW;
		chip->dt.wipower_max_uw = -EINVAL;

	if (of_find_property(node, "qcom,thermal-mitigation", &byte_len)) {
		chg->thermal_mitigation = devm_kzalloc(chg->dev, byte_len,
@@ -866,6 +866,9 @@ static int smb2_config_wipower_input_power(struct smb2 *chip, int uw)
	struct smb_charger *chg = &chip->chg;
	s64 nw = (s64)uw * 1000;

	if (uw < 0)
		return 0;

	ua = div_s64(nw, ZIN_ICL_PT_MAX_MV);
	rc = smblib_set_charge_param(chg, &chg->param.dc_icl_pt_lv, ua);
	if (rc < 0) {