Skip to content

Commit 1aea522

Browse files
Linus WalleijWim Van Sebroeck
authored andcommitted
watchdog: ixp4xx: Implement restart
Implement watchdog restart in the IXP4xx watchdog timer. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20220206230028.476659-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent 7a6b3d8 commit 1aea522

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/watchdog/ixp4xx_wdt.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,24 @@ static int ixp4xx_wdt_set_timeout(struct watchdog_device *wdd,
8484
return 0;
8585
}
8686

87+
static int ixp4xx_wdt_restart(struct watchdog_device *wdd,
88+
unsigned long action, void *data)
89+
{
90+
struct ixp4xx_wdt *iwdt = to_ixp4xx_wdt(wdd);
91+
92+
__raw_writel(IXP4XX_WDT_KEY, iwdt->base + IXP4XX_OSWK_OFFSET);
93+
__raw_writel(0, iwdt->base + IXP4XX_OSWT_OFFSET);
94+
__raw_writel(IXP4XX_WDT_COUNT_ENABLE | IXP4XX_WDT_RESET_ENABLE,
95+
iwdt->base + IXP4XX_OSWE_OFFSET);
96+
97+
return 0;
98+
}
99+
87100
static const struct watchdog_ops ixp4xx_wdt_ops = {
88101
.start = ixp4xx_wdt_start,
89102
.stop = ixp4xx_wdt_stop,
90103
.set_timeout = ixp4xx_wdt_set_timeout,
104+
.restart = ixp4xx_wdt_restart,
91105
.owner = THIS_MODULE,
92106
};
93107

0 commit comments

Comments
 (0)