watchdog: da9052_wdt: add support for bootstatus bits
Enable support for these bootstatus bits:
WDIOF_CARDRESET
WDIOF_OVERHEAT
WDIOF_POWERUNDER
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20241210-da9052-wdt-v2-2-95a5756e9ac8@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
committed by
Wim Van Sebroeck
parent
3322d53fda
commit
651b5fde35
@@ -135,7 +135,11 @@ static int da9052_wdt_ping(struct watchdog_device *wdt_dev)
|
||||
}
|
||||
|
||||
static const struct watchdog_info da9052_wdt_info = {
|
||||
.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
|
||||
.options = WDIOF_SETTIMEOUT |
|
||||
WDIOF_KEEPALIVEPING |
|
||||
WDIOF_CARDRESET |
|
||||
WDIOF_OVERHEAT |
|
||||
WDIOF_POWERUNDER,
|
||||
.identity = "DA9052 Watchdog",
|
||||
};
|
||||
|
||||
@@ -169,6 +173,13 @@ static int da9052_wdt_probe(struct platform_device *pdev)
|
||||
da9052_wdt->parent = dev;
|
||||
watchdog_set_drvdata(da9052_wdt, driver_data);
|
||||
|
||||
if (da9052->fault_log & DA9052_FAULTLOG_TWDERROR)
|
||||
da9052_wdt->bootstatus |= WDIOF_CARDRESET;
|
||||
if (da9052->fault_log & DA9052_FAULTLOG_TEMPOVER)
|
||||
da9052_wdt->bootstatus |= WDIOF_OVERHEAT;
|
||||
if (da9052->fault_log & DA9052_FAULTLOG_VDDFAULT)
|
||||
da9052_wdt->bootstatus |= WDIOF_POWERUNDER;
|
||||
|
||||
ret = da9052_reg_update(da9052, DA9052_CONTROL_D_REG,
|
||||
DA9052_CONTROLD_TWDSCALE, 0);
|
||||
if (ret < 0) {
|
||||
|
||||
Reference in New Issue
Block a user