Skip to content

Commit 651b5fd

Browse files
marcusfolkessonWim Van Sebroeck
authored andcommitted
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>
1 parent 3322d53 commit 651b5fd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/watchdog/da9052_wdt.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ static int da9052_wdt_ping(struct watchdog_device *wdt_dev)
135135
}
136136

137137
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,
139143
.identity = "DA9052 Watchdog",
140144
};
141145

@@ -169,6 +173,13 @@ static int da9052_wdt_probe(struct platform_device *pdev)
169173
da9052_wdt->parent = dev;
170174
watchdog_set_drvdata(da9052_wdt, driver_data);
171175

176+
if (da9052->fault_log & DA9052_FAULTLOG_TWDERROR)
177+
da9052_wdt->bootstatus |= WDIOF_CARDRESET;
178+
if (da9052->fault_log & DA9052_FAULTLOG_TEMPOVER)
179+
da9052_wdt->bootstatus |= WDIOF_OVERHEAT;
180+
if (da9052->fault_log & DA9052_FAULTLOG_VDDFAULT)
181+
da9052_wdt->bootstatus |= WDIOF_POWERUNDER;
182+
172183
ret = da9052_reg_update(da9052, DA9052_CONTROL_D_REG,
173184
DA9052_CONTROLD_TWDSCALE, 0);
174185
if (ret < 0) {

0 commit comments

Comments
 (0)