From: Ramakrishna Pallala Date: Fri, 30 Nov 2012 08:27:46 +0000 (+0530) Subject: power_supply: Add watchdog and safety timer expiries under PROP_HEALTH_* X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a05be99174edc9f258ee68140b71b9645ad977ee;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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. Signed-off-by: Ramakrishna Pallala Signed-off-by: Anton Vorontsov --- diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index 40fa3b7cae54..29178f78d73c 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c @@ -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", diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 1f0ab90aff00..25c0982eb9b1 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -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 {