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

Commit af702b19 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 always disable charging"

parents 8f907ef7 bdc62b47
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -306,6 +306,7 @@ struct smb135x_chg {
	int				version;

	bool				chg_enabled;
	bool				chg_disabled_permanently;

	bool				usb_present;
	bool				dc_present;
@@ -1146,6 +1147,12 @@ static int __smb135x_charging(struct smb135x_chg *chip, int enable)

	pr_debug("charging enable = %d\n", enable);

	if (chip->chg_disabled_permanently) {
		pr_debug("charging is disabled permanetly\n");
		return -EINVAL;
	}


	rc = smb135x_masked_write(chip, CMD_CHG_REG,
			CMD_CHG_EN, enable ? CMD_CHG_EN : 0);
	if (rc < 0) {
@@ -3260,8 +3267,9 @@ static int smb_parse_dt(struct smb135x_chg *chip)
	chip->iterm_disabled = of_property_read_bool(node,
						"qcom,iterm-disabled");

	chip->chg_enabled = !(of_property_read_bool(node,
	chip->chg_disabled_permanently = (of_property_read_bool(node,
						"qcom,charging-disabled"));
	chip->chg_enabled = !chip->chg_disabled_permanently;

	rc = of_property_read_string(node, "qcom,bms-psy-name",
						&chip->bms_psy_name);