Skip to content

Commit

Permalink
power_supply: Add watchdog and safety timer expiries under PROP_HEALTH_*
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Ramakrishna Pallala <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
  • Loading branch information
Ramakrishna Pallala authored and enomsg committed Jan 6, 2013
1 parent a9672e1 commit a05be99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/power/power_supply_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions include/linux/power_supply.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a05be99

Please sign in to comment.