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

Commit d6c6b61a authored by Nicholas Troast's avatar Nicholas Troast Committed by Kyle Yan
Browse files

qcom-charger: qpnp-smb2: expose AICL settled current through USB psy



There is a requirement to expose the settled input current limit via a
power supply property. Add it.

Change-Id: I1a7b77e3a64da245afd0c4f73c8d04627a061ada
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent acb4a107
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ static enum power_supply_property smb2_usb_props[] = {
	POWER_SUPPLY_PROP_TYPEC_CC_ORIENTATION,
	POWER_SUPPLY_PROP_PD_ALLOWED,
	POWER_SUPPLY_PROP_PD_ACTIVE,
	POWER_SUPPLY_PROP_INPUT_CURRENT_SETTLED,
};

static int smb2_usb_get_prop(struct power_supply *psy,
@@ -201,6 +202,9 @@ static int smb2_usb_get_prop(struct power_supply *psy,
	case POWER_SUPPLY_PROP_PD_ACTIVE:
		val->intval = chg->pd_active;
		break;
	case POWER_SUPPLY_PROP_INPUT_CURRENT_SETTLED:
		rc = smblib_get_prop_input_current_settled(chg, val);
		break;
	default:
		pr_err("get prop %d is not supported\n", psp);
		rc = -EINVAL;
+6 −0
Original line number Diff line number Diff line
@@ -1066,6 +1066,12 @@ int smblib_get_prop_pd_allowed(struct smb_charger *chg,
	return 0;
}

int smblib_get_prop_input_current_settled(struct smb_charger *chg,
					  union power_supply_propval *val)
{
	return smblib_get_charge_param(chg, &chg->param.icl_stat, &val->intval);
}

/*******************
 * USB PSY SETTERS *
 * *****************/
+2 −0
Original line number Diff line number Diff line
@@ -182,6 +182,8 @@ int smblib_get_prop_typec_power_role(struct smb_charger *chg,
				union power_supply_propval *val);
int smblib_get_prop_pd_allowed(struct smb_charger *chg,
				union power_supply_propval *val);
int smblib_get_prop_input_current_settled(struct smb_charger *chg,
				union power_supply_propval *val);
int smblib_set_prop_usb_current_max(struct smb_charger *chg,
				const union power_supply_propval *val);
int smblib_set_prop_usb_voltage_min(struct smb_charger *chg,