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

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

Merge "power: smb5: Import CYCLE_COUNT property"

parents 1c940fa0 c4feb89e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1086,6 +1086,7 @@ static enum power_supply_property smb5_batt_props[] = {
	POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
	POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
	POWER_SUPPLY_PROP_CHARGE_COUNTER,
	POWER_SUPPLY_PROP_CYCLE_COUNT,
	POWER_SUPPLY_PROP_RECHARGE_SOC,
};

@@ -1180,6 +1181,9 @@ static int smb5_batt_get_prop(struct power_supply *psy,
	case POWER_SUPPLY_PROP_CHARGE_COUNTER:
		rc = smblib_get_prop_batt_charge_counter(chg, val);
		break;
	case POWER_SUPPLY_PROP_CYCLE_COUNT:
		rc = smblib_get_prop_batt_cycle_count(chg, val);
		break;
	case POWER_SUPPLY_PROP_RECHARGE_SOC:
		val->intval = chg->auto_recharge_soc;
		break;
+13 −0
Original line number Diff line number Diff line
@@ -1469,6 +1469,19 @@ int smblib_get_prop_batt_charge_counter(struct smb_charger *chg,
	return rc;
}

int smblib_get_prop_batt_cycle_count(struct smb_charger *chg,
				     union power_supply_propval *val)
{
	int rc;

	if (!chg->bms_psy)
		return -EINVAL;

	rc = power_supply_get_property(chg->bms_psy,
				       POWER_SUPPLY_PROP_CYCLE_COUNT, val);
	return rc;
}

/***********************
 * BATTERY PSY SETTERS *
 ***********************/
+2 −0
Original line number Diff line number Diff line
@@ -462,6 +462,8 @@ int smblib_get_prop_batt_temp(struct smb_charger *chg,
				union power_supply_propval *val);
int smblib_get_prop_batt_charge_counter(struct smb_charger *chg,
				union power_supply_propval *val);
int smblib_get_prop_batt_cycle_count(struct smb_charger *chg,
				union power_supply_propval *val);
int smblib_set_prop_input_suspend(struct smb_charger *chg,
				const union power_supply_propval *val);
int smblib_set_prop_batt_capacity(struct smb_charger *chg,