path: root/drivers/watchdog/bcm47xx_wdt.c
diff options
authorLinus Torvalds <>2015-02-18 08:42:47 -0800
committerLinus Torvalds <>2015-02-18 08:42:47 -0800
commit928fce2f6d8152d897790c1a5bbeef5642f69e0e (patch)
treebb8b583bae3b76c94c274bbea47d07c00847f465 /drivers/watchdog/bcm47xx_wdt.c
parenta5ac1fb13c1265f942ea1d24c43b42d76c1660c2 (diff)
parent94613431619b555ac1299634efabde2ffd0eb2b4 (diff)
Merge git://
Pull watchdog updates from Wim Van Sebroeck: "This adds the following new drivers: - ImgTec PDC Watchdog Timer Driver, - Mediatek SoC integrated watchdog Add support for BCM5301X, IT8783, NCT6791 and NCT6792 WDT's Add bcm47xx_wdt and da9063 restart handlers and contains overall improvements and fixes" * git:// watchdog: bcm47xx_wdt.c: allow enabling on BCM5301X arch watchdog: jz4740: Add DT support dt: watchdog: Add DT binding documentation for jz4740 watchdog timer watchdog: dw_wdt: Try to get a 30 second watchdog by default watchdog: dw_wdt: pat the watchdog before enabling it watchdog: w83627hf_wdt: Add support for NCT6791 and NCT6792 watchdog: bcm47xx_wdt.c: add restart handler support watchdog: gpio_wdt: Add "always_running" feature to GPIO watchdog watchdog: da9063: Add restart handler support ARM: mediatek: dts: Add bindings for watchdog watchdog: Add driver for Mediatek watchdog watchdog: Fix omap watchdogs to enable the magic close bit watchdog: rt2880_wdt: minor clean up watchdog: hpwdt: Fix initialization message in hpwdt.c watchdog: it87_wdt: add IT8783 ID watchdog: imx2: Constify struct regmap_config and watchdog_ops DT: watchdog: Add ImgTec PDC Watchdog Timer binding documentation watchdog: ImgTec PDC Watchdog Timer Driver
Diffstat (limited to 'drivers/watchdog/bcm47xx_wdt.c')
1 files changed, 20 insertions, 1 deletions
diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c
index 9816485f6825..b28a072abf78 100644
--- a/drivers/watchdog/bcm47xx_wdt.c
+++ b/drivers/watchdog/bcm47xx_wdt.c
@@ -169,6 +169,17 @@ static int bcm47xx_wdt_notify_sys(struct notifier_block *this,
+static int bcm47xx_wdt_restart(struct notifier_block *this, unsigned long mode,
+ void *cmd)
+ struct bcm47xx_wdt *wdt;
+ wdt = container_of(this, struct bcm47xx_wdt, restart_handler);
+ wdt->timer_set(wdt, 1);
+ return NOTIFY_DONE;
static struct watchdog_ops bcm47xx_wdt_soft_ops = {
.owner = THIS_MODULE,
.start = bcm47xx_wdt_soft_start,
@@ -209,15 +220,23 @@ static int bcm47xx_wdt_probe(struct platform_device *pdev)
if (ret)
goto err_timer;
- ret = watchdog_register_device(&wdt->wdd);
+ wdt->restart_handler.notifier_call = &bcm47xx_wdt_restart;
+ wdt->restart_handler.priority = 64;
+ ret = register_restart_handler(&wdt->restart_handler);
if (ret)
goto err_notifier;
+ ret = watchdog_register_device(&wdt->wdd);
+ if (ret)
+ goto err_handler;
dev_info(&pdev->dev, "BCM47xx Watchdog Timer enabled (%d seconds%s%s)\n",
timeout, nowayout ? ", nowayout" : "",
soft ? ", Software Timer" : "");
return 0;
+ unregister_restart_handler(&wdt->restart_handler);