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

Commit e93616b4 authored by Nicholas Troast's avatar Nicholas Troast Committed by Ashay Jaiswal
Browse files

power_supply: add DIE_HEALTH and CONNECTOR_HEALTH properties



The DIE_HEALTH and CONNECTOR_HEALTH properties are used to show the
output of the thermal regulation TEMP_RANGE.

Change-Id: Ice3f159b7775084bdd0099047d4660a1e5edce98
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent 3a3c5fd6
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ static ssize_t power_supply_show_property(struct device *dev,
		"Unknown", "Good", "Overheat", "Dead", "Over voltage",
		"Unspecified failure", "Cold", "Watchdog timer expire",
		"Safety timer expire",
		"Warm", "Cool"
		"Warm", "Cool", "Hot"
	};
	static char *technology_text[] = {
		"Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe", "NiCd",
@@ -122,6 +122,10 @@ static ssize_t power_supply_show_property(struct device *dev,
		return sprintf(buf, "%s\n", typec_text[value.intval]);
	else if (off == POWER_SUPPLY_PROP_TYPEC_POWER_ROLE)
		return sprintf(buf, "%s\n", typec_pr_text[value.intval]);
	else if (off == POWER_SUPPLY_PROP_DIE_HEALTH)
		return sprintf(buf, "%s\n", health_text[value.intval]);
	else if (off == POWER_SUPPLY_PROP_CONNECTOR_HEALTH)
		return sprintf(buf, "%s\n", health_text[value.intval]);
	else if (off >= POWER_SUPPLY_PROP_MODEL_NAME)
		return sprintf(buf, "%s\n", value.strval);

@@ -283,6 +287,8 @@ static struct device_attribute power_supply_attrs[] = {
	POWER_SUPPLY_ATTR(icl_reduction),
	POWER_SUPPLY_ATTR(parallel_mode),
	POWER_SUPPLY_ATTR(connector_therm_zone),
	POWER_SUPPLY_ATTR(die_health),
	POWER_SUPPLY_ATTR(connector_health),
	/* Local extensions of type int64_t */
	POWER_SUPPLY_ATTR(charge_counter_ext),
	/* Properties of type `const char *' */
+3 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ enum {
	POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,
	POWER_SUPPLY_HEALTH_WARM,
	POWER_SUPPLY_HEALTH_COOL,
	POWER_SUPPLY_HEALTH_HOT,
};

enum {
@@ -238,6 +239,8 @@ enum power_supply_property {
	POWER_SUPPLY_PROP_ICL_REDUCTION,
	POWER_SUPPLY_PROP_PARALLEL_MODE,
	POWER_SUPPLY_PROP_CONNECTOR_THERM_ZONE,
	POWER_SUPPLY_PROP_DIE_HEALTH,
	POWER_SUPPLY_PROP_CONNECTOR_HEALTH,
	/* Local extensions of type int64_t */
	POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT,
	/* Properties of type `const char *' */