Skip to content

Commit 8807f0a

Browse files
marcusfolkessonWim Van Sebroeck
authored andcommitted
watchdog: da9052_wdt: do not disable wdt during probe
If the watchog is started by the bootloader, we do not want the watchdog to be disabled. Signed-off-by: Marcus Folkesson <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent ec90349 commit 8807f0a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/watchdog/da9052_wdt.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,15 @@ static int da9052_wdt_probe(struct platform_device *pdev)
194194
if (da9052->fault_log & DA9052_FAULTLOG_VDDFAULT)
195195
da9052_wdt->bootstatus |= WDIOF_POWERUNDER;
196196

197-
ret = da9052_reg_update(da9052, DA9052_CONTROL_D_REG,
198-
DA9052_CONTROLD_TWDSCALE, 0);
199-
if (ret < 0) {
200-
dev_err(dev, "Failed to disable watchdog bits, %d\n", ret);
197+
ret = da9052_reg_read(da9052, DA9052_CONTROL_D_REG);
198+
if (ret < 0)
201199
return ret;
200+
201+
/* Check if FW enabled the watchdog */
202+
if (ret & DA9052_CONTROLD_TWDSCALE) {
203+
/* Ensure proper initialization */
204+
da9052_wdt_start(da9052_wdt);
205+
set_bit(WDOG_HW_RUNNING, &da9052_wdt->status);
202206
}
203207

204208
return devm_watchdog_register_device(dev, &driver_data->wdt);

0 commit comments

Comments
 (0)