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

Commit 7e2f2e5c authored by Guru Das Srinagesh's avatar Guru Das Srinagesh
Browse files

power: smb5: Enable Rp based ICL for USB Type-C non-compliant cables



Currently ICL is set based on BC 1.2 specification for Type-C
legacy cables. Add option to enable Rp based ICL for Type-C
non-compliant legacy cables.

Change-Id: Idd6be32fcc224bffca74182d6c4502978cfbe892
Signed-off-by: default avatarSahil Chandna <chandna@codeaurora.org>
Signed-off-by: default avatarGuru Das Srinagesh <gurus@codeaurora.org>
parent 0b86d0c1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -347,6 +347,9 @@ static int smb5_parse_dt_misc(struct smb5 *chip, struct device_node *node)
	chg->step_chg_enabled = of_property_read_bool(node,
				"qcom,step-charging-enable");

	chg->typec_legacy_use_rp_icl = of_property_read_bool(node,
				"qcom,typec-legacy-rp-icl");

	chg->sw_jeita_enabled = of_property_read_bool(node,
				"qcom,sw-jeita-enable");

+2 −2
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@
#define typec_rp_med_high(chg, typec_mode)			\
	((typec_mode == POWER_SUPPLY_TYPEC_SOURCE_MEDIUM	\
	|| typec_mode == POWER_SUPPLY_TYPEC_SOURCE_HIGH)	\
	&& !chg->typec_legacy)
	&& (!chg->typec_legacy || chg->typec_legacy_use_rp_icl))

static void update_sw_icl_max(struct smb_charger *chg, int pst);

@@ -4038,7 +4038,7 @@ int smblib_get_charge_current(struct smb_charger *chg,
		return 0;
	}

	if (non_compliant) {
	if (non_compliant && !chg->typec_legacy_use_rp_icl) {
		switch (apsd_result->bit) {
		case CDP_CHARGER_BIT:
			current_ua = CDP_CURRENT_UA;
+1 −0
Original line number Diff line number Diff line
@@ -413,6 +413,7 @@ struct smb_charger {
	int			fake_batt_status;
	bool			step_chg_enabled;
	bool			sw_jeita_enabled;
	bool			typec_legacy_use_rp_icl;
	bool			is_hdc;
	bool			chg_done;
	int			connector_type;