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

Commit 52ca8e3c authored by Vic Wei's avatar Vic Wei
Browse files

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



Only change wipower_max_uw value if defined in device tree file.

CRs-Fixed: 1064863
Change-Id: Ic64d80ee5e2f5fc79cb9220a6b2a86751dd3f0ce
Signed-off-by: default avatarVic Wei <vwei@codeaurora.org>
parent 5964f2d7
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,
@@ -862,6 +862,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) {