Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Marcus Folkesson and committed by
Wim Van Sebroeck
651b5fde 3322d53f

+12 -1
+12 -1
drivers/watchdog/da9052_wdt.c
··· 135 135 } 136 136 137 137 static const struct watchdog_info da9052_wdt_info = { 138 - .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, 138 + .options = WDIOF_SETTIMEOUT | 139 + WDIOF_KEEPALIVEPING | 140 + WDIOF_CARDRESET | 141 + WDIOF_OVERHEAT | 142 + WDIOF_POWERUNDER, 139 143 .identity = "DA9052 Watchdog", 140 144 }; 141 145 ··· 172 168 da9052_wdt->ops = &da9052_wdt_ops; 173 169 da9052_wdt->parent = dev; 174 170 watchdog_set_drvdata(da9052_wdt, driver_data); 171 + 172 + if (da9052->fault_log & DA9052_FAULTLOG_TWDERROR) 173 + da9052_wdt->bootstatus |= WDIOF_CARDRESET; 174 + if (da9052->fault_log & DA9052_FAULTLOG_TEMPOVER) 175 + da9052_wdt->bootstatus |= WDIOF_OVERHEAT; 176 + if (da9052->fault_log & DA9052_FAULTLOG_VDDFAULT) 177 + da9052_wdt->bootstatus |= WDIOF_POWERUNDER; 175 178 176 179 ret = da9052_reg_update(da9052, DA9052_CONTROL_D_REG, 177 180 DA9052_CONTROLD_TWDSCALE, 0);