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

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

Merge "power: smb135x-charger: add support to configure fastcharge current"

parents 3f895cac 12488478
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -63,6 +63,9 @@ Optional Properties:
				property should be used with 'qcom,iterm-disabled'
				to ensure EOC detection in charger is
				disabled.
- qcom,fastchg-ma:		Specifies the maximum fastcharge current.
				The possible range for fastcharge current is
				from 300mA to 3000mA.

Example:
	i2c@f9967000 {
@@ -79,5 +82,6 @@ Example:
			qcom,recharge-thresh-mv = <100>;
			regulator-name = "smb1357-otg";
			qcom,thermal-mitigation = <1500 700 600 325>;
			qcom,fastchg-ma = <3000>;
		};
	};
+15 −0
Original line number Diff line number Diff line
@@ -336,6 +336,7 @@ struct smb135x_chg {
	bool				inhibit_disabled;
	int				fastchg_current_arr_size;
	int				*fastchg_current_table;
	int				fastchg_ma;
	u8				irq_cfg_mask[3];
	int				otg_oc_count;

@@ -3450,6 +3451,16 @@ static int smb135x_hw_init(struct smb135x_chg *chip)
		return rc;
	}

	/* set maximum fastchg current */
	if (chip->fastchg_ma != -EINVAL) {
		rc = smb135x_set_fastchg_current(chip, chip->fastchg_ma);
		if (rc < 0) {
			dev_err(chip->dev, "Couldn't set fastchg current = %d\n",
									rc);
			return rc;
		}
	}

	__smb135x_charging(chip, chip->chg_enabled);

	/* interrupt enabling - active low */
@@ -3643,6 +3654,10 @@ static int smb_parse_dt(struct smb135x_chg *chip)
	if (rc)
		chip->bms_psy_name = NULL;

	rc = of_property_read_u32(node, "qcom,fastchg-ma", &chip->fastchg_ma);
	if (rc < 0)
		chip->fastchg_ma = -EINVAL;

	chip->soft_vfloat_comp_disabled = of_property_read_bool(node,
					"qcom,soft-vfloat-comp-disabled");