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

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

Merge "power: qpnp-smb2: Add dt property to disable STAT SW_OVERRIDE"

parents 34048027 3abee2fa
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -193,6 +193,12 @@ Charger specific properties:
		to be get from these properties defined in battery profile:
		qcom,step-chg-ranges, qcom,jeita-fcc-ranges, qcom,jeita-fv-ranges.

- qcom,disable-stat-sw-override
  Usage:      optional
  Value type: bool
  Definition: Boolean flag which when present disables STAT pin default software
		override configuration.

=============================================
Second Level Nodes - SMB2 Charger Peripherals
=============================================
+13 −0
Original line number Diff line number Diff line
@@ -331,6 +331,9 @@ static int smb2_parse_dt(struct smb2 *chip)
	if (rc < 0)
		chg->otg_delay_ms = OTG_DEFAULT_DEGLITCH_TIME_MS;

	chg->disable_stat_sw_override = of_property_read_bool(node,
					"qcom,disable-stat-sw-override");

	return 0;
}

@@ -1837,6 +1840,16 @@ static int smb2_init_hw(struct smb2 *chip)
		}
	}

	if (chg->disable_stat_sw_override) {
		rc = smblib_masked_write(chg, STAT_CFG_REG,
				STAT_SW_OVERRIDE_CFG_BIT, 0);
		if (rc < 0) {
			dev_err(chg->dev, "Couldn't disable STAT SW override rc=%d\n",
				rc);
			return rc;
		}
	}

	return rc;
}

+1 −0
Original line number Diff line number Diff line
@@ -353,6 +353,7 @@ struct smb_charger {
	bool			use_extcon;
	bool			otg_present;
	bool			is_audio_adapter;
	bool			disable_stat_sw_override;

	/* workaround flag */
	u32			wa_flags;