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

Commit 86cc4f67 authored by Nicholas Troast's avatar Nicholas Troast Committed by Harry Yang
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 9481a8f0
Loading
Loading
Loading
Loading
+13 −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",
@@ -131,6 +131,12 @@ static ssize_t power_supply_show_property(struct device *dev,
	else if (off == POWER_SUPPLY_PROP_TYPEC_POWER_ROLE)
		return scnprintf(buf, PAGE_SIZE, "%s\n",
				typec_pr_text[value.intval]);
	else if (off == POWER_SUPPLY_PROP_DIE_HEALTH)
		return scnprintf(buf, PAGE_SIZE, "%s\n",
				health_text[value.intval]);
	else if (off == POWER_SUPPLY_PROP_CONNECTOR_HEALTH)
		return scnprintf(buf, PAGE_SIZE, "%s\n",
				health_text[value.intval]);
	else if (off >= POWER_SUPPLY_PROP_MODEL_NAME)
		return scnprintf(buf, PAGE_SIZE, "%s\n",
				value.strval);
@@ -291,6 +297,12 @@ static struct device_attribute power_supply_attrs[] = {
	POWER_SUPPLY_ATTR(set_ship_mode),
	POWER_SUPPLY_ATTR(soc_reporting_ready),
	POWER_SUPPLY_ATTR(debug_battery),
	POWER_SUPPLY_ATTR(fcc_delta),
	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 *' */
+7 −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 {
@@ -228,6 +229,12 @@ enum power_supply_property {
	POWER_SUPPLY_PROP_SET_SHIP_MODE,
	POWER_SUPPLY_PROP_SOC_REPORTING_READY,
	POWER_SUPPLY_PROP_DEBUG_BATTERY,
	POWER_SUPPLY_PROP_FCC_DELTA,
	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 *' */