#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/bcm47xx_wdt.h>
#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/platform_device.h>
#include <linux/watchdog.h>
#include <linux/jiffies.h>
#define DRV_NAME "bcm47xx_wdt"
#define WDT_DEFAULT_TIME 30
#define WDT_SOFTTIMER_MAX 255
#define WDT_SOFTTIMER_THRESHOLD 60
static int timeout = WDT_DEFAULT_TIME;
static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(timeout, int, 0);
MODULE_PARM_DESC(timeout, "Watchdog time in seconds. (default="
__MODULE_STRING(WDT_DEFAULT_TIME) ")");
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout,
"Watchdog cannot be stopped once started (default="
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
static inline struct bcm47xx_wdt *bcm47xx_wdt_get(struct watchdog_device *wdd)
return container_of(wdd, struct bcm47xx_wdt, wdd);
static int bcm47xx_wdt_hard_keepalive(struct watchdog_device *wdd)
struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd);
wdt->timer_set_ms(wdt, wdd->timeout * 1000);
static int bcm47xx_wdt_hard_start(struct watchdog_device *wdd)
static int bcm47xx_wdt_hard_stop(struct watchdog_device *wdd)