mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 01:21:58 +00:00
watchdog: JZ4740: Register a restart handler
The watchdog driver can restart the system by simply configuring the hardware for a timeout of 0 seconds. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Cc: Wim Van Sebroeck <wim@linux-watchdog.org> Cc: Mathieu Malaterre <malat@debian.org> Cc: linux-watchdog@vger.kernel.org Cc: linux-mips@linux-mips.org Signed-off-by: James Hogan <jhogan@kernel.org>
This commit is contained in:
parent
6bdbc1f7f6
commit
b4918057f3
1 changed files with 9 additions and 0 deletions
|
@ -130,6 +130,14 @@ static int jz4740_wdt_stop(struct watchdog_device *wdt_dev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int jz4740_wdt_restart(struct watchdog_device *wdt_dev,
|
||||||
|
unsigned long action, void *data)
|
||||||
|
{
|
||||||
|
wdt_dev->timeout = 0;
|
||||||
|
jz4740_wdt_start(wdt_dev);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct watchdog_info jz4740_wdt_info = {
|
static const struct watchdog_info jz4740_wdt_info = {
|
||||||
.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
|
.options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE,
|
||||||
.identity = "jz4740 Watchdog",
|
.identity = "jz4740 Watchdog",
|
||||||
|
@ -141,6 +149,7 @@ static const struct watchdog_ops jz4740_wdt_ops = {
|
||||||
.stop = jz4740_wdt_stop,
|
.stop = jz4740_wdt_stop,
|
||||||
.ping = jz4740_wdt_ping,
|
.ping = jz4740_wdt_ping,
|
||||||
.set_timeout = jz4740_wdt_set_timeout,
|
.set_timeout = jz4740_wdt_set_timeout,
|
||||||
|
.restart = jz4740_wdt_restart,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue