#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/watchdog.h>
#include <linux/platform_device.h>
#include <linux/mfd/twl.h>
#define TWL4030_WATCHDOG_CFG_REG_OFFS 0x3
static bool nowayout = WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started "
"(default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
static int twl4030_wdt_write(unsigned char val)
return twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, val,
TWL4030_WATCHDOG_CFG_REG_OFFS);
static int twl4030_wdt_start(struct watchdog_device *wdt)
return twl4030_wdt_write(wdt->timeout + 1);
static int twl4030_wdt_stop(struct watchdog_device *wdt)
return twl4030_wdt_write(0);
static int twl4030_wdt_set_timeout(struct watchdog_device *wdt,
static const struct watchdog_info twl4030_wdt_info = {
.options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
.identity = "TWL4030 Watchdog",