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

Commit a29283ec authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dt-bindings: qpnp-smb5: Support changing DCIN ICL"

parents ce0e87d0 8ffbf79f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -350,6 +350,13 @@ Charger specific properties:
  Value type: bool
  Definition: Boolean flag which when present disables FCC restriction.

- qcom,wls-current-max-ua
  Usage:      optional
  Value type: <u32>
  Definition: Upper limit of charging current supplied by the wireless
		charger. If left unspecified, the HW min value of 1.5 A is
		applied by default.

=============================================
Second Level Nodes - SMB5 Charger Peripherals
=============================================
+7 −1
Original line number Diff line number Diff line
@@ -397,7 +397,7 @@ static int smb5_parse_dt(struct smb5 *chip)
{
	struct smb_charger *chg = &chip->chg;
	struct device_node *node = chg->dev->of_node;
	int rc, byte_len;
	int rc, byte_len, tmp;

	if (!node) {
		pr_err("device tree node missing\n");
@@ -654,6 +654,12 @@ static int smb5_parse_dt(struct smb5 *chip)
	if (chg->chg_param.hvdcp3_max_icl_ua <= 0)
		chg->chg_param.hvdcp3_max_icl_ua = MICRO_3PA;

	chg->wls_icl_ua = DCIN_ICL_MAX_UA;
	rc = of_property_read_u32(node, "qcom,wls-current-max-ua",
			&tmp);
	if (!rc && tmp < DCIN_ICL_MAX_UA)
		chg->wls_icl_ua = tmp;

	return 0;
}

+2 −3
Original line number Diff line number Diff line
@@ -5995,14 +5995,13 @@ static void dcin_aicl(struct smb_charger *chg)
	if (rc < 0)
		goto unlock;

	if (icl == DCIN_ICL_MAX_UA) {
	if (icl == chg->wls_icl_ua) {
		/* Upper limit reached; do nothing */
		smblib_dbg(chg, PR_WLS, "hit max ICL: stop\n");
		goto unlock;
	}

	icl += DCIN_ICL_STEP_UA;

	icl = min(chg->wls_icl_ua, icl + DCIN_ICL_STEP_UA);
	icl_save = icl;

	rc = smblib_set_charge_param(chg, &chg->param.dc_icl, icl);
+1 −0
Original line number Diff line number Diff line
@@ -563,6 +563,7 @@ struct smb_charger {
	int			init_thermal_ua;
	u32			comp_clamp_level;
	bool			hvdcp3_standalone_config;
	int			wls_icl_ua;

	/* workaround flag */
	u32			wa_flags;