/linux-4.1.27/drivers/watchdog/ |
H A D | bcm47xx_wdt.c | 47 static inline struct bcm47xx_wdt *bcm47xx_wdt_get(struct watchdog_device *wdd) bcm47xx_wdt_get() argument 49 return container_of(wdd, struct bcm47xx_wdt, wdd); bcm47xx_wdt_get() 52 static int bcm47xx_wdt_hard_keepalive(struct watchdog_device *wdd) bcm47xx_wdt_hard_keepalive() argument 54 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_hard_keepalive() 56 wdt->timer_set_ms(wdt, wdd->timeout * 1000); bcm47xx_wdt_hard_keepalive() 61 static int bcm47xx_wdt_hard_start(struct watchdog_device *wdd) bcm47xx_wdt_hard_start() argument 66 static int bcm47xx_wdt_hard_stop(struct watchdog_device *wdd) bcm47xx_wdt_hard_stop() argument 68 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_hard_stop() 75 static int bcm47xx_wdt_hard_set_timeout(struct watchdog_device *wdd, bcm47xx_wdt_hard_set_timeout() argument 78 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_hard_set_timeout() 87 wdd->timeout = new_time; bcm47xx_wdt_hard_set_timeout() 102 u32 next_tick = min(wdt->wdd.timeout * 1000, wdt->max_timer_ms); bcm47xx_wdt_soft_timer_tick() 112 static int bcm47xx_wdt_soft_keepalive(struct watchdog_device *wdd) bcm47xx_wdt_soft_keepalive() argument 114 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_soft_keepalive() 116 atomic_set(&wdt->soft_ticks, wdd->timeout); bcm47xx_wdt_soft_keepalive() 121 static int bcm47xx_wdt_soft_start(struct watchdog_device *wdd) bcm47xx_wdt_soft_start() argument 123 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_soft_start() 125 bcm47xx_wdt_soft_keepalive(wdd); bcm47xx_wdt_soft_start() 131 static int bcm47xx_wdt_soft_stop(struct watchdog_device *wdd) bcm47xx_wdt_soft_stop() argument 133 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_soft_stop() 141 static int bcm47xx_wdt_soft_set_timeout(struct watchdog_device *wdd, bcm47xx_wdt_soft_set_timeout() argument 150 wdd->timeout = new_time; bcm47xx_wdt_soft_set_timeout() 168 wdt->wdd.ops->stop(&wdt->wdd); bcm47xx_wdt_notify_sys() 203 wdt->wdd.ops = &bcm47xx_wdt_soft_ops; bcm47xx_wdt_probe() 207 wdt->wdd.ops = &bcm47xx_wdt_hard_ops; bcm47xx_wdt_probe() 210 wdt->wdd.info = &bcm47xx_wdt_info; bcm47xx_wdt_probe() 211 wdt->wdd.timeout = WDT_DEFAULT_TIME; bcm47xx_wdt_probe() 212 ret = wdt->wdd.ops->set_timeout(&wdt->wdd, timeout); bcm47xx_wdt_probe() 215 watchdog_set_nowayout(&wdt->wdd, nowayout); bcm47xx_wdt_probe() 229 ret = watchdog_register_device(&wdt->wdd); bcm47xx_wdt_probe() 256 watchdog_unregister_device(&wdt->wdd); bcm47xx_wdt_remove()
|
H A D | stmp3xxx_rtc_wdt.c | 28 static int wdt_start(struct watchdog_device *wdd) wdt_start() argument 30 struct device *dev = watchdog_get_drvdata(wdd); wdt_start() 33 pdata->wdt_set_timeout(dev->parent, wdd->timeout * WDOG_TICK_RATE); wdt_start() 37 static int wdt_stop(struct watchdog_device *wdd) wdt_stop() argument 39 struct device *dev = watchdog_get_drvdata(wdd); wdt_stop() 46 static int wdt_set_timeout(struct watchdog_device *wdd, unsigned new_timeout) wdt_set_timeout() argument 48 wdd->timeout = new_timeout; wdt_set_timeout() 49 return wdt_start(wdd); wdt_set_timeout() 99 struct watchdog_device *wdd = &stmp3xxx_wdd; stmp3xxx_wdt_suspend() local 101 if (watchdog_active(wdd)) stmp3xxx_wdt_suspend() 102 return wdt_stop(wdd); stmp3xxx_wdt_suspend() 109 struct watchdog_device *wdd = &stmp3xxx_wdd; stmp3xxx_wdt_resume() local 111 if (watchdog_active(wdd)) stmp3xxx_wdt_resume() 112 return wdt_start(wdd); stmp3xxx_wdt_resume()
|
H A D | davinci_wdt.c | 63 * @wdd - hold watchdog device as is in WDT core 68 struct watchdog_device wdd; member in struct:davinci_wdt_device 71 static int davinci_wdt_start(struct watchdog_device *wdd) davinci_wdt_start() argument 76 struct davinci_wdt_device *davinci_wdt = watchdog_get_drvdata(wdd); davinci_wdt_start() 90 timer_margin = (((u64)wdd->timeout * wdt_freq) & 0xffffffff); davinci_wdt_start() 92 timer_margin = (((u64)wdd->timeout * wdt_freq) >> 32); davinci_wdt_start() 107 static int davinci_wdt_ping(struct watchdog_device *wdd) davinci_wdt_ping() argument 109 struct davinci_wdt_device *davinci_wdt = watchdog_get_drvdata(wdd); davinci_wdt_ping() 118 static unsigned int davinci_wdt_get_timeleft(struct watchdog_device *wdd) davinci_wdt_get_timeleft() argument 123 struct davinci_wdt_device *davinci_wdt = watchdog_get_drvdata(wdd); davinci_wdt_get_timeleft() 140 return wdd->timeout - timer_counter; davinci_wdt_get_timeleft() 161 struct watchdog_device *wdd; davinci_wdt_probe() local 176 wdd = &davinci_wdt->wdd; davinci_wdt_probe() 177 wdd->info = &davinci_wdt_info; davinci_wdt_probe() 178 wdd->ops = &davinci_wdt_ops; davinci_wdt_probe() 179 wdd->min_timeout = 1; davinci_wdt_probe() 180 wdd->max_timeout = MAX_HEARTBEAT; davinci_wdt_probe() 181 wdd->timeout = DEFAULT_HEARTBEAT; davinci_wdt_probe() 183 watchdog_init_timeout(wdd, heartbeat, dev); davinci_wdt_probe() 185 dev_info(dev, "heartbeat %d sec\n", wdd->timeout); davinci_wdt_probe() 187 watchdog_set_drvdata(wdd, davinci_wdt); davinci_wdt_probe() 188 watchdog_set_nowayout(wdd, 1); davinci_wdt_probe() 195 ret = watchdog_register_device(wdd); davinci_wdt_probe() 206 watchdog_unregister_device(&davinci_wdt->wdd); davinci_wdt_remove()
|
H A D | gpio_wdt.c | 41 struct watchdog_device wdd; member in struct:gpio_wdt_priv 61 static int gpio_wdt_start(struct watchdog_device *wdd) gpio_wdt_start() argument 63 struct gpio_wdt_priv *priv = watchdog_get_drvdata(wdd); gpio_wdt_start() 71 static int gpio_wdt_stop(struct watchdog_device *wdd) gpio_wdt_stop() argument 73 struct gpio_wdt_priv *priv = watchdog_get_drvdata(wdd); gpio_wdt_stop() 84 static int gpio_wdt_ping(struct watchdog_device *wdd) gpio_wdt_ping() argument 86 struct gpio_wdt_priv *priv = watchdog_get_drvdata(wdd); gpio_wdt_ping() 93 static int gpio_wdt_set_timeout(struct watchdog_device *wdd, unsigned int t) gpio_wdt_set_timeout() argument 95 wdd->timeout = t; gpio_wdt_set_timeout() 97 return gpio_wdt_ping(wdd); gpio_wdt_set_timeout() 102 struct watchdog_device *wdd = (struct watchdog_device *)data; gpio_wdt_hwping() local 103 struct gpio_wdt_priv *priv = watchdog_get_drvdata(wdd); gpio_wdt_hwping() 106 msecs_to_jiffies(wdd->timeout * 1000))) { gpio_wdt_hwping() 107 dev_crit(wdd->dev, "Timer expired. System will reboot soon!\n"); gpio_wdt_hwping() 214 watchdog_set_drvdata(&priv->wdd, priv); gpio_wdt_probe() 216 priv->wdd.info = &gpio_wdt_ident; gpio_wdt_probe() 217 priv->wdd.ops = &gpio_wdt_ops; gpio_wdt_probe() 218 priv->wdd.min_timeout = SOFT_TIMEOUT_MIN; gpio_wdt_probe() 219 priv->wdd.max_timeout = SOFT_TIMEOUT_MAX; gpio_wdt_probe() 221 if (watchdog_init_timeout(&priv->wdd, 0, &pdev->dev) < 0) gpio_wdt_probe() 222 priv->wdd.timeout = SOFT_TIMEOUT_DEF; gpio_wdt_probe() 224 setup_timer(&priv->timer, gpio_wdt_hwping, (unsigned long)&priv->wdd); gpio_wdt_probe() 226 ret = watchdog_register_device(&priv->wdd); gpio_wdt_probe() 241 watchdog_unregister_device(&priv->wdd); gpio_wdt_probe() 251 watchdog_unregister_device(&priv->wdd); gpio_wdt_remove()
|
H A D | watchdog_core.c | 46 static void watchdog_check_min_max_timeout(struct watchdog_device *wdd) watchdog_check_min_max_timeout() argument 52 if (wdd->min_timeout > wdd->max_timeout) { watchdog_check_min_max_timeout() 54 wdd->min_timeout = 0; watchdog_check_min_max_timeout() 55 wdd->max_timeout = 0; watchdog_check_min_max_timeout() 72 int watchdog_init_timeout(struct watchdog_device *wdd, watchdog_init_timeout() argument 78 watchdog_check_min_max_timeout(wdd); watchdog_init_timeout() 81 if (!watchdog_timeout_invalid(wdd, timeout_parm) && timeout_parm) { watchdog_init_timeout() 82 wdd->timeout = timeout_parm; watchdog_init_timeout() 92 if (!watchdog_timeout_invalid(wdd, t) && t) watchdog_init_timeout() 93 wdd->timeout = t; watchdog_init_timeout() 103 * @wdd: watchdog device 111 int watchdog_register_device(struct watchdog_device *wdd) watchdog_register_device() argument 115 if (wdd == NULL || wdd->info == NULL || wdd->ops == NULL) watchdog_register_device() 119 if (wdd->ops->start == NULL || wdd->ops->stop == NULL) watchdog_register_device() 122 watchdog_check_min_max_timeout(wdd); watchdog_register_device() 130 mutex_init(&wdd->lock); watchdog_register_device() 134 wdd->id = id; watchdog_register_device() 136 ret = watchdog_dev_register(wdd); watchdog_register_device() 146 wdd->id = id; watchdog_register_device() 148 ret = watchdog_dev_register(wdd); watchdog_register_device() 155 devno = wdd->cdev.dev; watchdog_register_device() 156 wdd->dev = device_create(watchdog_class, wdd->parent, devno, watchdog_register_device() 157 NULL, "watchdog%d", wdd->id); watchdog_register_device() 158 if (IS_ERR(wdd->dev)) { watchdog_register_device() 159 watchdog_dev_unregister(wdd); watchdog_register_device() 161 ret = PTR_ERR(wdd->dev); watchdog_register_device() 171 * @wdd: watchdog device to unregister 176 void watchdog_unregister_device(struct watchdog_device *wdd) watchdog_unregister_device() argument 181 if (wdd == NULL) watchdog_unregister_device() 184 devno = wdd->cdev.dev; watchdog_unregister_device() 185 ret = watchdog_dev_unregister(wdd); watchdog_unregister_device() 189 ida_simple_remove(&watchdog_ida, wdd->id); watchdog_unregister_device() 190 wdd->dev = NULL; watchdog_unregister_device()
|
H A D | tegra_wdt.c | 68 struct watchdog_device wdd; member in struct:tegra_wdt 86 static int tegra_wdt_start(struct watchdog_device *wdd) tegra_wdt_start() argument 88 struct tegra_wdt *wdt = watchdog_get_drvdata(wdd); tegra_wdt_start() 109 (wdd->timeout << WDT_CFG_PERIOD_SHIFT) | tegra_wdt_start() 118 static int tegra_wdt_stop(struct watchdog_device *wdd) tegra_wdt_stop() argument 120 struct tegra_wdt *wdt = watchdog_get_drvdata(wdd); tegra_wdt_stop() 129 static int tegra_wdt_ping(struct watchdog_device *wdd) tegra_wdt_ping() argument 131 struct tegra_wdt *wdt = watchdog_get_drvdata(wdd); tegra_wdt_ping() 138 static int tegra_wdt_set_timeout(struct watchdog_device *wdd, tegra_wdt_set_timeout() argument 141 wdd->timeout = timeout; tegra_wdt_set_timeout() 143 if (watchdog_active(wdd)) tegra_wdt_set_timeout() 144 return tegra_wdt_start(wdd); tegra_wdt_set_timeout() 149 static unsigned int tegra_wdt_get_timeleft(struct watchdog_device *wdd) tegra_wdt_get_timeleft() argument 151 struct tegra_wdt *wdt = watchdog_get_drvdata(wdd); tegra_wdt_get_timeleft() 168 return (((3 - exp) * wdd->timeout) + count) / 4; tegra_wdt_get_timeleft() 190 struct watchdog_device *wdd; tegra_wdt_probe() local 215 wdd = &wdt->wdd; tegra_wdt_probe() 216 wdd->timeout = heartbeat; tegra_wdt_probe() 217 wdd->info = &tegra_wdt_info; tegra_wdt_probe() 218 wdd->ops = &tegra_wdt_ops; tegra_wdt_probe() 219 wdd->min_timeout = MIN_WDT_TIMEOUT; tegra_wdt_probe() 220 wdd->max_timeout = MAX_WDT_TIMEOUT; tegra_wdt_probe() 222 watchdog_set_drvdata(wdd, wdt); tegra_wdt_probe() 224 watchdog_set_nowayout(wdd, nowayout); tegra_wdt_probe() 226 ret = watchdog_register_device(wdd); tegra_wdt_probe() 246 tegra_wdt_stop(&wdt->wdd); tegra_wdt_remove() 248 watchdog_unregister_device(&wdt->wdd); tegra_wdt_remove() 260 if (watchdog_active(&wdt->wdd)) tegra_wdt_runtime_suspend() 261 tegra_wdt_stop(&wdt->wdd); tegra_wdt_runtime_suspend() 270 if (watchdog_active(&wdt->wdd)) tegra_wdt_runtime_resume() 271 tegra_wdt_start(&wdt->wdd); tegra_wdt_runtime_resume()
|
H A D | kempld_wdt.c | 83 struct watchdog_device wdd; member in struct:kempld_wdt_data 205 static int kempld_wdt_set_timeout(struct watchdog_device *wdd, kempld_wdt_set_timeout() argument 208 struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); kempld_wdt_set_timeout() 228 wdd->timeout = timeout; kempld_wdt_set_timeout() 232 static int kempld_wdt_set_pretimeout(struct watchdog_device *wdd, kempld_wdt_set_pretimeout() argument 235 struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); kempld_wdt_set_pretimeout() 245 if (pretimeout > wdd->timeout) kempld_wdt_set_pretimeout() 256 wdd->timeout - pretimeout); kempld_wdt_set_pretimeout() 284 wdt_data->wdd.timeout = pretimeout + timeout; kempld_wdt_update_timeouts() 287 static int kempld_wdt_start(struct watchdog_device *wdd) kempld_wdt_start() argument 289 struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); kempld_wdt_start() 294 ret = kempld_wdt_set_timeout(wdd, wdd->timeout); kempld_wdt_start() 312 static int kempld_wdt_stop(struct watchdog_device *wdd) kempld_wdt_stop() argument 314 struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); kempld_wdt_stop() 332 static int kempld_wdt_keepalive(struct watchdog_device *wdd) kempld_wdt_keepalive() argument 334 struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); kempld_wdt_keepalive() 344 static long kempld_wdt_ioctl(struct watchdog_device *wdd, unsigned int cmd, kempld_wdt_ioctl() argument 347 struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); kempld_wdt_ioctl() 357 ret = kempld_wdt_set_pretimeout(wdd, new_value); kempld_wdt_ioctl() 360 ret = kempld_wdt_keepalive(wdd); kempld_wdt_ioctl() 370 static int kempld_wdt_probe_stages(struct watchdog_device *wdd) kempld_wdt_probe_stages() argument 372 struct kempld_wdt_data *wdt_data = watchdog_get_drvdata(wdd); kempld_wdt_probe_stages() 447 struct watchdog_device *wdd; kempld_wdt_probe() local 456 wdd = &wdt_data->wdd; kempld_wdt_probe() 457 wdd->parent = dev; kempld_wdt_probe() 472 wdd->info = &kempld_wdt_info; kempld_wdt_probe() 473 wdd->ops = &kempld_wdt_ops; kempld_wdt_probe() 475 watchdog_set_drvdata(wdd, wdt_data); kempld_wdt_probe() 476 watchdog_set_nowayout(wdd, nowayout); kempld_wdt_probe() 478 ret = kempld_wdt_probe_stages(wdd); kempld_wdt_probe() 482 kempld_wdt_set_timeout(wdd, timeout); kempld_wdt_probe() 483 kempld_wdt_set_pretimeout(wdd, pretimeout); kempld_wdt_probe() 493 ret = watchdog_register_device(wdd); kempld_wdt_probe() 497 dev_info(dev, "Watchdog registered with %ds timeout\n", wdd->timeout); kempld_wdt_probe() 506 kempld_wdt_stop(&wdt_data->wdd); kempld_wdt_shutdown() 512 struct watchdog_device *wdd = &wdt_data->wdd; kempld_wdt_remove() local 516 ret = kempld_wdt_stop(wdd); kempld_wdt_remove() 517 watchdog_unregister_device(wdd); kempld_wdt_remove() 529 struct watchdog_device *wdd = &wdt_data->wdd; kempld_wdt_suspend() local 538 return kempld_wdt_stop(wdd); kempld_wdt_suspend() 547 struct watchdog_device *wdd = &wdt_data->wdd; kempld_wdt_resume() local 554 return kempld_wdt_start(wdd); kempld_wdt_resume() 556 return kempld_wdt_stop(wdd); kempld_wdt_resume()
|
H A D | sp805_wdt.c | 55 * @wdd: instance of struct watchdog_device 64 struct watchdog_device wdd; member in struct:sp805_wdt 78 static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout) wdt_setload() argument 80 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); wdt_setload() 99 wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate); wdt_setload() 106 static unsigned int wdt_timeleft(struct watchdog_device *wdd) wdt_timeleft() argument 108 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); wdt_timeleft() 124 static int wdt_config(struct watchdog_device *wdd, bool ping) wdt_config() argument 126 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); wdt_config() 158 static int wdt_ping(struct watchdog_device *wdd) wdt_ping() argument 160 return wdt_config(wdd, true); wdt_ping() 164 static int wdt_enable(struct watchdog_device *wdd) wdt_enable() argument 166 return wdt_config(wdd, false); wdt_enable() 170 static int wdt_disable(struct watchdog_device *wdd) wdt_disable() argument 172 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); wdt_disable() 227 wdt->wdd.info = &wdt_info; sp805_wdt_probe() 228 wdt->wdd.ops = &wdt_ops; sp805_wdt_probe() 231 watchdog_set_nowayout(&wdt->wdd, nowayout); sp805_wdt_probe() 232 watchdog_set_drvdata(&wdt->wdd, wdt); sp805_wdt_probe() 233 wdt_setload(&wdt->wdd, DEFAULT_TIMEOUT); sp805_wdt_probe() 235 ret = watchdog_register_device(&wdt->wdd); sp805_wdt_probe() 255 watchdog_unregister_device(&wdt->wdd); sp805_wdt_remove() 256 watchdog_set_drvdata(&wdt->wdd, NULL); sp805_wdt_remove() 265 if (watchdog_active(&wdt->wdd)) sp805_wdt_suspend() 266 return wdt_disable(&wdt->wdd); sp805_wdt_suspend() 275 if (watchdog_active(&wdt->wdd)) sp805_wdt_resume() 276 return wdt_enable(&wdt->wdd); sp805_wdt_resume()
|
H A D | sirfsoc_wdt.c | 42 static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd) sirfsoc_wdt_gettimeleft() argument 48 wdt_base = watchdog_get_drvdata(wdd); sirfsoc_wdt_gettimeleft() 58 static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) sirfsoc_wdt_updatetimeout() argument 63 timeout_ticks = wdd->timeout * CLOCK_FREQ; sirfsoc_wdt_updatetimeout() 64 wdt_base = watchdog_get_drvdata(wdd); sirfsoc_wdt_updatetimeout() 80 static int sirfsoc_wdt_enable(struct watchdog_device *wdd) sirfsoc_wdt_enable() argument 82 void __iomem *wdt_base = watchdog_get_drvdata(wdd); sirfsoc_wdt_enable() 83 sirfsoc_wdt_updatetimeout(wdd); sirfsoc_wdt_enable() 97 static int sirfsoc_wdt_disable(struct watchdog_device *wdd) sirfsoc_wdt_disable() argument 99 void __iomem *wdt_base = watchdog_get_drvdata(wdd); sirfsoc_wdt_disable() 109 static int sirfsoc_wdt_settimeout(struct watchdog_device *wdd, unsigned int to) sirfsoc_wdt_settimeout() argument 111 wdd->timeout = to; sirfsoc_wdt_settimeout() 112 sirfsoc_wdt_updatetimeout(wdd); sirfsoc_wdt_settimeout() 169 struct watchdog_device *wdd = platform_get_drvdata(pdev); sirfsoc_wdt_shutdown() local 171 sirfsoc_wdt_disable(wdd); sirfsoc_wdt_shutdown() 188 struct watchdog_device *wdd = dev_get_drvdata(dev); sirfsoc_wdt_resume() local 195 sirfsoc_wdt_updatetimeout(wdd); sirfsoc_wdt_resume()
|
H A D | watchdog_dev.c | 295 struct watchdog_device *wdd = file->private_data; watchdog_write() local 306 clear_bit(WDOG_ALLOW_RELEASE, &wdd->status); watchdog_write() 313 set_bit(WDOG_ALLOW_RELEASE, &wdd->status); watchdog_write() 317 watchdog_ping(wdd); watchdog_write() 335 struct watchdog_device *wdd = file->private_data; watchdog_ioctl() local 341 err = watchdog_ioctl_op(wdd, cmd, arg); watchdog_ioctl() 347 return copy_to_user(argp, wdd->info, watchdog_ioctl() 350 err = watchdog_get_status(wdd, &val); watchdog_ioctl() 355 return put_user(wdd->bootstatus, p); watchdog_ioctl() 360 err = watchdog_stop(wdd); watchdog_ioctl() 365 err = watchdog_start(wdd); watchdog_ioctl() 371 if (!(wdd->info->options & WDIOF_KEEPALIVEPING)) watchdog_ioctl() 373 watchdog_ping(wdd); watchdog_ioctl() 378 err = watchdog_set_timeout(wdd, val); watchdog_ioctl() 384 watchdog_ping(wdd); watchdog_ioctl() 388 if (wdd->timeout == 0) watchdog_ioctl() 390 return put_user(wdd->timeout, p); watchdog_ioctl() 392 err = watchdog_get_timeleft(wdd, &val); watchdog_ioctl() 414 struct watchdog_device *wdd; watchdog_open() local 418 wdd = old_wdd; watchdog_open() 420 wdd = container_of(inode->i_cdev, struct watchdog_device, cdev); watchdog_open() 423 if (test_and_set_bit(WDOG_DEV_OPEN, &wdd->status)) watchdog_open() 430 if (!try_module_get(wdd->ops->owner)) watchdog_open() 433 err = watchdog_start(wdd); watchdog_open() 437 file->private_data = wdd; watchdog_open() 439 if (wdd->ops->ref) watchdog_open() 440 wdd->ops->ref(wdd); watchdog_open() 446 module_put(wdd->ops->owner); watchdog_open() 448 clear_bit(WDOG_DEV_OPEN, &wdd->status); watchdog_open() 464 struct watchdog_device *wdd = file->private_data; watchdog_release() local 472 if (!test_bit(WDOG_ACTIVE, &wdd->status)) watchdog_release() 474 else if (test_and_clear_bit(WDOG_ALLOW_RELEASE, &wdd->status) || watchdog_release() 475 !(wdd->info->options & WDIOF_MAGICCLOSE)) watchdog_release() 476 err = watchdog_stop(wdd); watchdog_release() 480 mutex_lock(&wdd->lock); watchdog_release() 481 if (!test_bit(WDOG_UNREGISTERED, &wdd->status)) watchdog_release() 482 dev_crit(wdd->dev, "watchdog did not stop!\n"); watchdog_release() 483 mutex_unlock(&wdd->lock); watchdog_release() 484 watchdog_ping(wdd); watchdog_release() 488 module_put(wdd->ops->owner); watchdog_release() 491 clear_bit(WDOG_DEV_OPEN, &wdd->status); watchdog_release() 493 /* Note wdd may be gone after this, do not use after this! */ watchdog_release() 494 if (wdd->ops->unref) watchdog_release() 495 wdd->ops->unref(wdd); watchdog_release()
|
H A D | qcom-wdt.c | 28 struct watchdog_device wdd; member in struct:qcom_wdt 36 struct qcom_wdt *to_qcom_wdt(struct watchdog_device *wdd) to_qcom_wdt() argument 38 return container_of(wdd, struct qcom_wdt, wdd); to_qcom_wdt() 41 static int qcom_wdt_start(struct watchdog_device *wdd) qcom_wdt_start() argument 43 struct qcom_wdt *wdt = to_qcom_wdt(wdd); qcom_wdt_start() 47 writel(wdd->timeout * wdt->rate, wdt->base + WDT_BITE_TIME); qcom_wdt_start() 52 static int qcom_wdt_stop(struct watchdog_device *wdd) qcom_wdt_stop() argument 54 struct qcom_wdt *wdt = to_qcom_wdt(wdd); qcom_wdt_stop() 60 static int qcom_wdt_ping(struct watchdog_device *wdd) qcom_wdt_ping() argument 62 struct qcom_wdt *wdt = to_qcom_wdt(wdd); qcom_wdt_ping() 68 static int qcom_wdt_set_timeout(struct watchdog_device *wdd, qcom_wdt_set_timeout() argument 71 wdd->timeout = timeout; qcom_wdt_set_timeout() 72 return qcom_wdt_start(wdd); qcom_wdt_set_timeout() 169 wdt->wdd.dev = &pdev->dev; qcom_wdt_probe() 170 wdt->wdd.info = &qcom_wdt_info; qcom_wdt_probe() 171 wdt->wdd.ops = &qcom_wdt_ops; qcom_wdt_probe() 172 wdt->wdd.min_timeout = 1; qcom_wdt_probe() 173 wdt->wdd.max_timeout = 0x10000000U / wdt->rate; qcom_wdt_probe() 180 wdt->wdd.timeout = min(wdt->wdd.max_timeout, 30U); qcom_wdt_probe() 181 watchdog_init_timeout(&wdt->wdd, 0, &pdev->dev); qcom_wdt_probe() 183 ret = watchdog_register_device(&wdt->wdd); qcom_wdt_probe() 210 watchdog_unregister_device(&wdt->wdd); qcom_wdt_remove()
|
H A D | at91sam9_wdt.c | 82 #define to_wdt(wdd) container_of(wdd, struct at91wdt, wdd) 84 struct watchdog_device wdd; member in struct:at91wdt 125 !watchdog_active(&wdt->wdd)) { at91_ping() 133 static int at91_wdt_start(struct watchdog_device *wdd) at91_wdt_start() argument 135 struct at91wdt *wdt = to_wdt(wdd); at91_wdt_start() 137 wdt->next_heartbeat = jiffies + wdd->timeout * HZ; at91_wdt_start() 141 static int at91_wdt_stop(struct watchdog_device *wdd) at91_wdt_stop() argument 147 static int at91_wdt_set_timeout(struct watchdog_device *wdd, unsigned int new_timeout) at91_wdt_set_timeout() argument 149 wdd->timeout = new_timeout; at91_wdt_set_timeout() 150 return at91_wdt_start(wdd); at91_wdt_set_timeout() 235 if (watchdog_init_timeout(&wdt->wdd, 0, dev)) at91_wdt_init() 236 watchdog_init_timeout(&wdt->wdd, heartbeat, dev); at91_wdt_init() 237 watchdog_set_nowayout(&wdt->wdd, wdt->nowayout); at91_wdt_init() 238 err = watchdog_register_device(&wdt->wdd); at91_wdt_init() 242 wdt->next_heartbeat = jiffies + wdt->wdd.timeout * HZ; at91_wdt_init() 276 dev_warn(wdt->wdd.parent, "failed to get IRQ from DT\n"); of_at91wdt_init() 343 wdt->wdd.parent = &pdev->dev; at91wdt_probe() 344 wdt->wdd.info = &at91_wdt_info; at91wdt_probe() 345 wdt->wdd.ops = &at91_wdt_ops; at91wdt_probe() 346 wdt->wdd.timeout = WDT_HEARTBEAT; at91wdt_probe() 347 wdt->wdd.min_timeout = 1; at91wdt_probe() 348 wdt->wdd.max_timeout = 0xFFFF; at91wdt_probe() 368 wdt->wdd.timeout, wdt->nowayout); at91wdt_probe() 376 watchdog_unregister_device(&wdt->wdd); at91wdt_remove()
|
H A D | da9063_wdt.c | 63 static int da9063_wdt_start(struct watchdog_device *wdd) da9063_wdt_start() argument 65 struct da9063_watchdog *wdt = watchdog_get_drvdata(wdd); da9063_wdt_start() 78 static int da9063_wdt_stop(struct watchdog_device *wdd) da9063_wdt_stop() argument 80 struct da9063_watchdog *wdt = watchdog_get_drvdata(wdd); da9063_wdt_stop() 92 static int da9063_wdt_ping(struct watchdog_device *wdd) da9063_wdt_ping() argument 94 struct da9063_watchdog *wdt = watchdog_get_drvdata(wdd); da9063_wdt_ping() 106 static int da9063_wdt_set_timeout(struct watchdog_device *wdd, da9063_wdt_set_timeout() argument 109 struct da9063_watchdog *wdt = watchdog_get_drvdata(wdd); da9063_wdt_set_timeout() 119 wdd->timeout = wdt_timeout[selector]; da9063_wdt_set_timeout()
|
H A D | ux500_wdt.c | 41 static int ux500_wdt_start(struct watchdog_device *wdd) ux500_wdt_start() argument 46 static int ux500_wdt_stop(struct watchdog_device *wdd) ux500_wdt_stop() argument 51 static int ux500_wdt_keepalive(struct watchdog_device *wdd) ux500_wdt_keepalive() argument 56 static int ux500_wdt_set_timeout(struct watchdog_device *wdd, ux500_wdt_set_timeout() argument 59 ux500_wdt_stop(wdd); ux500_wdt_set_timeout() 61 ux500_wdt_start(wdd); ux500_wdt_set_timeout()
|
H A D | of_xilinx_wdt.c | 50 static int xilinx_wdt_start(struct watchdog_device *wdd) xilinx_wdt_start() argument 53 struct xwdt_device *xdev = watchdog_get_drvdata(wdd); xilinx_wdt_start() 71 static int xilinx_wdt_stop(struct watchdog_device *wdd) xilinx_wdt_stop() argument 74 struct xwdt_device *xdev = watchdog_get_drvdata(wdd); xilinx_wdt_stop() 91 static int xilinx_wdt_keepalive(struct watchdog_device *wdd) xilinx_wdt_keepalive() argument 94 struct xwdt_device *xdev = watchdog_get_drvdata(wdd); xilinx_wdt_keepalive()
|
H A D | via_wdt.c | 101 static int wdt_ping(struct watchdog_device *wdd) wdt_ping() argument 104 next_heartbeat = jiffies + wdd->timeout * HZ; wdt_ping() 108 static int wdt_start(struct watchdog_device *wdd) wdt_start() argument 112 writel(wdd->timeout, wdt_mem + VIA_WDT_COUNT); wdt_start() 114 wdt_ping(wdd); wdt_start() 119 static int wdt_stop(struct watchdog_device *wdd) wdt_stop() argument 127 static int wdt_set_timeout(struct watchdog_device *wdd, wdt_set_timeout() argument 131 wdd->timeout = new_timeout; wdt_set_timeout()
|
H A D | cadence_wdt.c | 123 * @wdd: watchdog device 130 static int cdns_wdt_stop(struct watchdog_device *wdd) cdns_wdt_stop() argument 132 struct cdns_wdt *wdt = watchdog_get_drvdata(wdd); cdns_wdt_stop() 145 * @wdd: watchdog device 151 static int cdns_wdt_reload(struct watchdog_device *wdd) cdns_wdt_reload() argument 153 struct cdns_wdt *wdt = watchdog_get_drvdata(wdd); cdns_wdt_reload() 166 * @wdd: watchdog device 181 static int cdns_wdt_start(struct watchdog_device *wdd) cdns_wdt_start() argument 183 struct cdns_wdt *wdt = watchdog_get_drvdata(wdd); cdns_wdt_start() 192 count = (wdd->timeout * (clock_f / wdt->prescaler)) / cdns_wdt_start() 229 * @wdd: watchdog device 236 static int cdns_wdt_settimeout(struct watchdog_device *wdd, cdns_wdt_settimeout() argument 239 wdd->timeout = new_time; cdns_wdt_settimeout() 241 return cdns_wdt_start(wdd); cdns_wdt_settimeout()
|
H A D | max63xx_wdt.c | 109 static int max63xx_wdt_ping(struct watchdog_device *wdd) max63xx_wdt_ping() argument 124 static int max63xx_wdt_start(struct watchdog_device *wdd) max63xx_wdt_start() argument 126 struct max63xx_timeout *entry = watchdog_get_drvdata(wdd); max63xx_wdt_start() 140 max63xx_wdt_ping(wdd); max63xx_wdt_start() 144 static int max63xx_wdt_stop(struct watchdog_device *wdd) max63xx_wdt_stop() argument
|
H A D | pnx4008_wdt.c | 85 static int pnx4008_wdt_start(struct watchdog_device *wdd) pnx4008_wdt_start() argument 102 writel(wdd->timeout * WDOG_COUNTER_RATE, WDTIM_MATCH0(wdt_base)); pnx4008_wdt_start() 110 static int pnx4008_wdt_stop(struct watchdog_device *wdd) pnx4008_wdt_stop() argument 120 static int pnx4008_wdt_set_timeout(struct watchdog_device *wdd, pnx4008_wdt_set_timeout() argument 123 wdd->timeout = new_timeout; pnx4008_wdt_set_timeout()
|
H A D | ie6xx_wdt.c | 101 static int ie6xx_wdt_ping(struct watchdog_device *wdd) ie6xx_wdt_ping() argument 110 static int ie6xx_wdt_set_timeout(struct watchdog_device *wdd, unsigned int t) ie6xx_wdt_set_timeout() argument 143 wdd->timeout = t; ie6xx_wdt_set_timeout() 147 static int ie6xx_wdt_start(struct watchdog_device *wdd) ie6xx_wdt_start() argument 149 ie6xx_wdt_set_timeout(wdd, wdd->timeout); ie6xx_wdt_start() 159 static int ie6xx_wdt_stop(struct watchdog_device *wdd) ie6xx_wdt_stop() argument
|
H A D | ep93xx_wdt.c | 69 static int ep93xx_wdt_start(struct watchdog_device *wdd) ep93xx_wdt_start() argument 79 static int ep93xx_wdt_stop(struct watchdog_device *wdd) ep93xx_wdt_stop() argument 87 static int ep93xx_wdt_keepalive(struct watchdog_device *wdd) ep93xx_wdt_keepalive() argument
|
H A D | s3c2410_wdt.c | 237 static int s3c2410wdt_keepalive(struct watchdog_device *wdd) s3c2410wdt_keepalive() argument 239 struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd); s3c2410wdt_keepalive() 257 static int s3c2410wdt_stop(struct watchdog_device *wdd) s3c2410wdt_stop() argument 259 struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd); s3c2410wdt_stop() 268 static int s3c2410wdt_start(struct watchdog_device *wdd) s3c2410wdt_start() argument 271 struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd); s3c2410wdt_start() 304 static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, unsigned timeout) s3c2410wdt_set_heartbeat() argument 306 struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd); s3c2410wdt_set_heartbeat() 349 wdd->timeout = (count * divisor) / freq; s3c2410wdt_set_heartbeat()
|
H A D | coh901327_wdt.c | 166 static int coh901327_ping(struct watchdog_device *wdd) coh901327_ping() argument
|
/linux-4.1.27/include/linux/ |
H A D | watchdog.h | 104 static inline bool watchdog_active(struct watchdog_device *wdd) watchdog_active() argument 106 return test_bit(WDOG_ACTIVE, &wdd->status); watchdog_active() 110 static inline void watchdog_set_nowayout(struct watchdog_device *wdd, bool nowayout) watchdog_set_nowayout() argument 113 set_bit(WDOG_NO_WAY_OUT, &wdd->status); watchdog_set_nowayout() 117 static inline bool watchdog_timeout_invalid(struct watchdog_device *wdd, unsigned int t) watchdog_timeout_invalid() argument 119 return ((wdd->max_timeout != 0) && watchdog_timeout_invalid() 120 (t < wdd->min_timeout || t > wdd->max_timeout)); watchdog_timeout_invalid() 124 static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data) watchdog_set_drvdata() argument 126 wdd->driver_data = data; watchdog_set_drvdata() 129 static inline void *watchdog_get_drvdata(struct watchdog_device *wdd) watchdog_get_drvdata() argument 131 return wdd->driver_data; watchdog_get_drvdata() 135 extern int watchdog_init_timeout(struct watchdog_device *wdd,
|
H A D | bcm47xx_wdt.h | 17 struct watchdog_device wdd; member in struct:bcm47xx_wdt
|