void watchdog_init( void ) { wdt_init(); wdt_config(); wdt_set_timeout(((WATCHDOG_TIMEOUT/1000)*WATCHDOG_CLK_FREQ)); watchdog_smphr = xSemaphoreCreateBinary(); xTaskCreate( WatchdogTask, (const char *) "Watchdog Task", 60, (void * ) NULL, tskWATCHDOG_PRIORITY, ( TaskHandle_t * ) NULL); }
static int wdt_turnoff(void) { del_timer(&timer); wdt_config(0); pr_info("Watchdog timer is now disabled...\n"); return 0; }
static int wdt_turnoff(void) { /* Stop the timer */ del_timer(&timer); /* Stop the watchdog */ wdt_config(0); printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); return 0; }
static int wdt_startup(void) { next_heartbeat = jiffies + (timeout * HZ); mod_timer(&timer, jiffies + WDT_INTERVAL); wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); pr_info("Watchdog timer is now enabled\n"); return 0; }
static int wdt_startup(void) { next_heartbeat = jiffies + (timeout * HZ); /* Start the timer */ mod_timer(&timer, jiffies + WDT_INTERVAL); /* Start the watchdog */ wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); return 0; }
static long hisik3_wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int ret = -ENOTTY; int timeout; unsigned int temp = 0x0; switch (cmd) { case WDIOC_GETSUPPORT: ret = copy_to_user((struct watchdog_info *)arg, &ident, sizeof(ident)) ? -EFAULT : 0; break; case WDIOC_GETSTATUS: ret = put_user(0, (int *)arg); break; /* do not implement this feature now case WDIOC_GETBOOTSTATUS: ret = put_user(wdt->boot_status, (int *)arg); break; */ case WDIOC_KEEPALIVE: wdt_enable(); ret = 0; break; case WDIOC_SETTIMEOUT: ret = get_user(timeout, (int *)arg); if (ret) break; dev_warn(&wdt->pdev->dev,"SETTIMEOUT : %d\n",timeout); wdt_config(timeout); wdt_enable(); break; case WDIOC_GETTIMEOUT: ret = put_user(wdt->timeout, (int *)arg); break; case WDIOC_GETTEMP: temp = readl(wdt->base + WDTVALUE); /*dev_warn(&wdt->pdev->dev, "temp value = %02x", temp);*/ ret = put_user(temp, (unsigned int *)arg); break; default: break; } return ret; }