Skip to content

Commit 59b0f51

Browse files
mtk23002Wim Van Sebroeck
authored andcommitted
watchdog: mtk: add disable_wdt_extrst support
In some cases, we may need watchdog just to trigger an internal soc reset without sending any output signal. Provide a disable_wdt_extrst parameter for configuration. We can disable or enable it just by configuring dts. Signed-off-by: Fengquan Chen <[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 eed0987 commit 59b0f51

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/watchdog/mtk_wdt.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ struct mtk_wdt_dev {
6565
void __iomem *wdt_base;
6666
spinlock_t lock; /* protects WDT_SWSYSRST reg */
6767
struct reset_controller_dev rcdev;
68+
bool disable_wdt_extrst;
6869
};
6970

7071
struct mtk_wdt_data {
@@ -256,6 +257,8 @@ static int mtk_wdt_start(struct watchdog_device *wdt_dev)
256257
reg |= (WDT_MODE_IRQ_EN | WDT_MODE_DUAL_EN);
257258
else
258259
reg &= ~(WDT_MODE_IRQ_EN | WDT_MODE_DUAL_EN);
260+
if (mtk_wdt->disable_wdt_extrst)
261+
reg &= ~WDT_MODE_EXRST_EN;
259262
reg |= (WDT_MODE_EN | WDT_MODE_KEY);
260263
iowrite32(reg, wdt_base + WDT_MODE);
261264

@@ -381,6 +384,10 @@ static int mtk_wdt_probe(struct platform_device *pdev)
381384
if (err)
382385
return err;
383386
}
387+
388+
mtk_wdt->disable_wdt_extrst =
389+
of_property_read_bool(dev->of_node, "mediatek,disable-extrst");
390+
384391
return 0;
385392
}
386393

0 commit comments

Comments
 (0)