Skip to contentSkip to conversation

power_supply: add watchdog and safety timer expiries under PROP_HEALTH_*

PATCH Applied Ramakrishna Pallala 2 participants 2 messages Nov 30, 2012 – Jan 6, 2013 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power_supply: add watchdog and safety timer expiries under PROP_HEALTH_*

As most of the charger chips come with two kinds of safety features related to timing.
1. Watchdog Timer (interms of seconds/mins)
2. Safety Timer (interms of hours)

This patch adds these to fault causes in POWER_SUPPLY_PROP_HEALTH_* enums so that whenever there is either watchdog timeout or safety timer timeout driver could notify the user space accurately about the fault and will also be helpful for debug.

---
 drivers/power/power_supply_sysfs.c |    3 ++-
 include/linux/power_supply.h       |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)
drivers/power/power_supply_sysfs.c +2 -1
index 40fa3b7..29178f7 100644
@@ -55,7 +55,8 @@ static ssize_t power_supply_show_property(struct device *dev,
 	};
 	static char *health_text[] = {
 		"Unknown", "Good", "Overheat", "Dead", "Over voltage",
-		"Unspecified failure", "Cold",
+		"Unspecified failure", "Cold", "Watchdog timer expire",
+		"Safety timer expire"
 	};
 	static char *technology_text[] = {
 		"Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe", "NiCd",
include/linux/power_supply.h +2 -0
index 35cdf2c..4e672e1 100644
@@ -54,6 +54,8 @@ enum {
 	POWER_SUPPLY_HEALTH_OVERVOLTAGE,
 	POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,
 	POWER_SUPPLY_HEALTH_COLD,
+	POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE,
+	POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,
 };
 
 enum {
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 11 lines · Ramakrishna Pallala

As most of the charger chips come with two kinds of safety features related to timing.
1. Watchdog Timer (interms of seconds/mins)
2. Safety Timer (interms of hours)

This patch adds these to fault causes in POWER_SUPPLY_PROP_HEALTH_* enums so that whenever there is either watchdog timeout or safety timer timeout driver could notify the user space accurately about the fault and will also be helpful for debug.

Applied, thanks a lot!

Quoted 34 lines
---
 drivers/power/power_supply_sysfs.c |    3 ++-
 include/linux/power_supply.h       |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)
drivers/power/power_supply_sysfs.c +2 -1
index 40fa3b7..29178f7 100644
@@ -55,7 +55,8 @@ static ssize_t power_supply_show_property(struct device *dev,
 	};
 	static char *health_text[] = {
 		"Unknown", "Good", "Overheat", "Dead", "Over voltage",
-		"Unspecified failure", "Cold",
+		"Unspecified failure", "Cold", "Watchdog timer expire",
+		"Safety timer expire"
 	};
 	static char *technology_text[] = {
 		"Unknown", "NiMH", "Li-ion", "Li-poly", "LiFe", "NiCd",
include/linux/power_supply.h +2 -0
index 35cdf2c..4e672e1 100644
@@ -54,6 +54,8 @@ enum {
 	POWER_SUPPLY_HEALTH_OVERVOLTAGE,
 	POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,
 	POWER_SUPPLY_HEALTH_COLD,
+	POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE,
+	POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE,
 };
 
 enum {
Signature · 1 line
1.7.0.4