/linux-4.1.27/drivers/watchdog/ |
H A D | bcm47xx_wdt.c | 54 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_hard_keepalive() local 56 wdt->timer_set_ms(wdt, wdd->timeout * 1000); bcm47xx_wdt_hard_keepalive() 68 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_hard_stop() local 70 wdt->timer_set(wdt, 0); bcm47xx_wdt_hard_stop() 78 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_hard_set_timeout() local 79 u32 max_timer = wdt->max_timer_ms; bcm47xx_wdt_hard_set_timeout() 101 struct bcm47xx_wdt *wdt = (struct bcm47xx_wdt *)data; bcm47xx_wdt_soft_timer_tick() local 102 u32 next_tick = min(wdt->wdd.timeout * 1000, wdt->max_timer_ms); bcm47xx_wdt_soft_timer_tick() 104 if (!atomic_dec_and_test(&wdt->soft_ticks)) { bcm47xx_wdt_soft_timer_tick() 105 wdt->timer_set_ms(wdt, next_tick); bcm47xx_wdt_soft_timer_tick() 106 mod_timer(&wdt->soft_timer, jiffies + HZ); bcm47xx_wdt_soft_timer_tick() 114 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_soft_keepalive() local 116 atomic_set(&wdt->soft_ticks, wdd->timeout); bcm47xx_wdt_soft_keepalive() 123 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_soft_start() local 126 bcm47xx_wdt_soft_timer_tick((unsigned long)wdt); bcm47xx_wdt_soft_start() 133 struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd); bcm47xx_wdt_soft_stop() local 135 del_timer_sync(&wdt->soft_timer); bcm47xx_wdt_soft_stop() 136 wdt->timer_set(wdt, 0); bcm47xx_wdt_soft_stop() 164 struct bcm47xx_wdt *wdt; bcm47xx_wdt_notify_sys() local 166 wdt = container_of(this, struct bcm47xx_wdt, notifier); bcm47xx_wdt_notify_sys() 168 wdt->wdd.ops->stop(&wdt->wdd); bcm47xx_wdt_notify_sys() 175 struct bcm47xx_wdt *wdt; bcm47xx_wdt_restart() local 177 wdt = container_of(this, struct bcm47xx_wdt, restart_handler); bcm47xx_wdt_restart() 178 wdt->timer_set(wdt, 1); bcm47xx_wdt_restart() 195 struct bcm47xx_wdt *wdt = dev_get_platdata(&pdev->dev); bcm47xx_wdt_probe() local 197 if (!wdt) bcm47xx_wdt_probe() 200 soft = wdt->max_timer_ms < WDT_SOFTTIMER_THRESHOLD * 1000; bcm47xx_wdt_probe() 203 wdt->wdd.ops = &bcm47xx_wdt_soft_ops; bcm47xx_wdt_probe() 204 setup_timer(&wdt->soft_timer, bcm47xx_wdt_soft_timer_tick, bcm47xx_wdt_probe() 205 (long unsigned int)wdt); 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() 217 wdt->notifier.notifier_call = &bcm47xx_wdt_notify_sys; bcm47xx_wdt_probe() 219 ret = register_reboot_notifier(&wdt->notifier); bcm47xx_wdt_probe() 223 wdt->restart_handler.notifier_call = &bcm47xx_wdt_restart; bcm47xx_wdt_probe() 224 wdt->restart_handler.priority = 64; bcm47xx_wdt_probe() 225 ret = register_restart_handler(&wdt->restart_handler); bcm47xx_wdt_probe() 229 ret = watchdog_register_device(&wdt->wdd); bcm47xx_wdt_probe() 239 unregister_restart_handler(&wdt->restart_handler); bcm47xx_wdt_probe() 241 unregister_reboot_notifier(&wdt->notifier); bcm47xx_wdt_probe() 244 del_timer_sync(&wdt->soft_timer); bcm47xx_wdt_probe() 251 struct bcm47xx_wdt *wdt = dev_get_platdata(&pdev->dev); bcm47xx_wdt_remove() local 253 if (!wdt) bcm47xx_wdt_remove() 256 watchdog_unregister_device(&wdt->wdd); bcm47xx_wdt_remove() 257 unregister_reboot_notifier(&wdt->notifier); bcm47xx_wdt_remove() 264 .name = "bcm47xx-wdt",
|
H A D | sp805_wdt.c | 2 * drivers/char/watchdog/sp805-wdt.c 34 #define MODULE_NAME "sp805-wdt" 54 * struct sp805_wdt: sp805 wdt device structure 57 * @base: base address of wdt 58 * @clk: clock structure of wdt 59 * @adev: amba device structure of wdt 60 * @status: current status of wdt 80 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); wdt_setload() local 83 rate = clk_get_rate(wdt->clk); wdt_setload() 96 spin_lock(&wdt->lock); wdt_setload() 97 wdt->load_val = load; wdt_setload() 100 spin_unlock(&wdt->lock); wdt_setload() 108 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); wdt_timeleft() local 111 rate = clk_get_rate(wdt->clk); wdt_timeleft() 113 spin_lock(&wdt->lock); wdt_timeleft() 114 load = readl_relaxed(wdt->base + WDTVALUE); wdt_timeleft() 117 if (!(readl_relaxed(wdt->base + WDTRIS) & INT_MASK)) wdt_timeleft() 118 load += wdt->load_val + 1; wdt_timeleft() 119 spin_unlock(&wdt->lock); wdt_timeleft() 126 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); wdt_config() local 131 ret = clk_prepare_enable(wdt->clk); wdt_config() 133 dev_err(&wdt->adev->dev, "clock enable fail"); wdt_config() 138 spin_lock(&wdt->lock); wdt_config() 140 writel_relaxed(UNLOCK, wdt->base + WDTLOCK); wdt_config() 141 writel_relaxed(wdt->load_val, wdt->base + WDTLOAD); wdt_config() 144 writel_relaxed(INT_MASK, wdt->base + WDTINTCLR); wdt_config() 145 writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + wdt_config() 149 writel_relaxed(LOCK, wdt->base + WDTLOCK); wdt_config() 152 readl_relaxed(wdt->base + WDTLOCK); wdt_config() 153 spin_unlock(&wdt->lock); wdt_config() 172 struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); wdt_disable() local 174 spin_lock(&wdt->lock); wdt_disable() 176 writel_relaxed(UNLOCK, wdt->base + WDTLOCK); wdt_disable() 177 writel_relaxed(0, wdt->base + WDTCONTROL); wdt_disable() 178 writel_relaxed(LOCK, wdt->base + WDTLOCK); wdt_disable() 181 readl_relaxed(wdt->base + WDTLOCK); wdt_disable() 182 spin_unlock(&wdt->lock); wdt_disable() 184 clk_disable_unprepare(wdt->clk); wdt_disable() 206 struct sp805_wdt *wdt; sp805_wdt_probe() local 209 wdt = devm_kzalloc(&adev->dev, sizeof(*wdt), GFP_KERNEL); sp805_wdt_probe() 210 if (!wdt) { sp805_wdt_probe() 215 wdt->base = devm_ioremap_resource(&adev->dev, &adev->res); sp805_wdt_probe() 216 if (IS_ERR(wdt->base)) sp805_wdt_probe() 217 return PTR_ERR(wdt->base); sp805_wdt_probe() 219 wdt->clk = devm_clk_get(&adev->dev, NULL); sp805_wdt_probe() 220 if (IS_ERR(wdt->clk)) { sp805_wdt_probe() 222 ret = PTR_ERR(wdt->clk); sp805_wdt_probe() 226 wdt->adev = adev; sp805_wdt_probe() 227 wdt->wdd.info = &wdt_info; sp805_wdt_probe() 228 wdt->wdd.ops = &wdt_ops; sp805_wdt_probe() 230 spin_lock_init(&wdt->lock); 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() 241 amba_set_drvdata(adev, wdt); sp805_wdt_probe() 253 struct sp805_wdt *wdt = amba_get_drvdata(adev); sp805_wdt_remove() local 255 watchdog_unregister_device(&wdt->wdd); sp805_wdt_remove() 256 watchdog_set_drvdata(&wdt->wdd, NULL); sp805_wdt_remove() 263 struct sp805_wdt *wdt = dev_get_drvdata(dev); sp805_wdt_suspend() local 265 if (watchdog_active(&wdt->wdd)) sp805_wdt_suspend() 266 return wdt_disable(&wdt->wdd); sp805_wdt_suspend() 273 struct sp805_wdt *wdt = dev_get_drvdata(dev); sp805_wdt_resume() local 275 if (watchdog_active(&wdt->wdd)) sp805_wdt_resume() 276 return wdt_enable(&wdt->wdd); sp805_wdt_resume()
|
H A D | at91sam9_wdt.c | 42 #define wdt_read(wdt, field) \ 43 __raw_readl((wdt)->base + (field)) 45 __raw_writel((val), (wdt)->base + (field)) 99 struct at91wdt *wdt = (struct at91wdt *)dev_id; wdt_interrupt() local 101 if (wdt_read(wdt, AT91_WDT_SR)) { wdt_interrupt() 113 static inline void at91_wdt_reset(struct at91wdt *wdt) at91_wdt_reset() argument 115 wdt_write(wdt, AT91_WDT_CR, AT91_WDT_KEY | AT91_WDT_WDRSTT); at91_wdt_reset() 123 struct at91wdt *wdt = (struct at91wdt *)data; at91_ping() local 124 if (time_before(jiffies, wdt->next_heartbeat) || at91_ping() 125 !watchdog_active(&wdt->wdd)) { at91_ping() 126 at91_wdt_reset(wdt); at91_ping() 127 mod_timer(&wdt->timer, jiffies + wdt->heartbeat); at91_ping() 135 struct at91wdt *wdt = to_wdt(wdd); at91_wdt_start() local 137 wdt->next_heartbeat = jiffies + wdd->timeout * HZ; at91_wdt_start() 153 static int at91_wdt_init(struct platform_device *pdev, struct at91wdt *wdt) at91_wdt_init() argument 159 u32 mask = wdt->mr_mask; at91_wdt_init() 164 tmp = wdt_read(wdt, AT91_WDT_MR); at91_wdt_init() 165 if ((tmp & mask) != (wdt->mr & mask)) { at91_wdt_init() 167 wdt_write(wdt, AT91_WDT_MR, wdt->mr); at91_wdt_init() 168 tmp = wdt_read(wdt, AT91_WDT_MR); at91_wdt_init() 173 if (wdt->mr & AT91_WDT_WDDIS) at91_wdt_init() 199 wdt->heartbeat = max_heartbeat / 4; at91_wdt_init() 201 wdt->heartbeat = max_heartbeat / 2; at91_wdt_init() 203 wdt->heartbeat = min_heartbeat; at91_wdt_init() 209 if ((tmp & AT91_WDT_WDFIEN) && wdt->irq) { at91_wdt_init() 210 err = request_irq(wdt->irq, wdt_interrupt, at91_wdt_init() 213 pdev->name, wdt); at91_wdt_init() 218 if ((tmp & wdt->mr_mask) != (wdt->mr & wdt->mr_mask)) at91_wdt_init() 221 tmp & wdt->mr_mask, wdt->mr & wdt->mr_mask); at91_wdt_init() 223 setup_timer(&wdt->timer, at91_ping, (unsigned long)wdt); at91_wdt_init() 232 mod_timer(&wdt->timer, jiffies + min_heartbeat); at91_wdt_init() 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() 247 del_timer(&wdt->timer); at91_wdt_init() 267 static int of_at91wdt_init(struct device_node *np, struct at91wdt *wdt) of_at91wdt_init() argument 274 wdt->irq = irq_of_parse_and_map(np, 0); of_at91wdt_init() 275 if (!wdt->irq) of_at91wdt_init() 276 dev_warn(wdt->wdd.parent, "failed to get IRQ from DT\n"); of_at91wdt_init() 293 wdt->mr_mask = 0x3FFFFFFF; of_at91wdt_init() 294 wdt->mr = 0; of_at91wdt_init() 297 wdt->mr |= AT91_WDT_WDFIEN; of_at91wdt_init() 298 wdt->mr_mask &= ~AT91_WDT_WDRPROC; of_at91wdt_init() 300 wdt->mr |= AT91_WDT_WDRSTEN; of_at91wdt_init() 305 wdt->mr |= AT91_WDT_WDRPROC; of_at91wdt_init() 308 wdt->mr |= AT91_WDT_WDDIS; of_at91wdt_init() 309 wdt->mr_mask &= AT91_WDT_WDDIS; of_at91wdt_init() 313 wdt->mr |= AT91_WDT_WDIDLEHLT; of_at91wdt_init() 316 wdt->mr |= AT91_WDT_WDDBGHLT; of_at91wdt_init() 318 wdt->mr |= max | ((max - min) << 16); of_at91wdt_init() 323 static inline int of_at91wdt_init(struct device_node *np, struct at91wdt *wdt) of_at91wdt_init() argument 333 struct at91wdt *wdt; at91wdt_probe() local 335 wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); at91wdt_probe() 336 if (!wdt) at91wdt_probe() 339 wdt->mr = (WDT_HW_TIMEOUT * 256) | AT91_WDT_WDRSTEN | AT91_WDT_WDD | at91wdt_probe() 341 wdt->mr_mask = 0x3FFFFFFF; at91wdt_probe() 342 wdt->nowayout = nowayout; at91wdt_probe() 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() 351 wdt->base = devm_ioremap_resource(&pdev->dev, r); at91wdt_probe() 352 if (IS_ERR(wdt->base)) at91wdt_probe() 353 return PTR_ERR(wdt->base); at91wdt_probe() 356 err = of_at91wdt_init(pdev->dev.of_node, wdt); at91wdt_probe() 361 err = at91_wdt_init(pdev, wdt); at91wdt_probe() 365 platform_set_drvdata(pdev, wdt); at91wdt_probe() 368 wdt->wdd.timeout, wdt->nowayout); at91wdt_probe() 375 struct at91wdt *wdt = platform_get_drvdata(pdev); at91wdt_remove() local 376 watchdog_unregister_device(&wdt->wdd); at91wdt_remove() 379 del_timer(&wdt->timer); at91wdt_remove() 386 { .compatible = "atmel,at91sam9260-wdt" },
|
H A D | twl4030_wdt.c | 42 static int twl4030_wdt_start(struct watchdog_device *wdt) twl4030_wdt_start() argument 44 return twl4030_wdt_write(wdt->timeout + 1); twl4030_wdt_start() 47 static int twl4030_wdt_stop(struct watchdog_device *wdt) twl4030_wdt_stop() argument 52 static int twl4030_wdt_set_timeout(struct watchdog_device *wdt, twl4030_wdt_set_timeout() argument 55 wdt->timeout = timeout; twl4030_wdt_set_timeout() 74 struct watchdog_device *wdt; twl4030_wdt_probe() local 76 wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); twl4030_wdt_probe() 77 if (!wdt) twl4030_wdt_probe() 80 wdt->info = &twl4030_wdt_info; twl4030_wdt_probe() 81 wdt->ops = &twl4030_wdt_ops; twl4030_wdt_probe() 82 wdt->status = 0; twl4030_wdt_probe() 83 wdt->timeout = 30; twl4030_wdt_probe() 84 wdt->min_timeout = 1; twl4030_wdt_probe() 85 wdt->max_timeout = 30; twl4030_wdt_probe() 87 watchdog_set_nowayout(wdt, nowayout); twl4030_wdt_probe() 88 platform_set_drvdata(pdev, wdt); twl4030_wdt_probe() 90 twl4030_wdt_stop(wdt); twl4030_wdt_probe() 92 ret = watchdog_register_device(wdt); twl4030_wdt_probe() 101 struct watchdog_device *wdt = platform_get_drvdata(pdev); twl4030_wdt_remove() local 103 watchdog_unregister_device(wdt); twl4030_wdt_remove() 111 struct watchdog_device *wdt = platform_get_drvdata(pdev); twl4030_wdt_suspend() local 112 if (watchdog_active(wdt)) twl4030_wdt_suspend() 113 return twl4030_wdt_stop(wdt); twl4030_wdt_suspend() 120 struct watchdog_device *wdt = platform_get_drvdata(pdev); twl4030_wdt_resume() local 121 if (watchdog_active(wdt)) twl4030_wdt_resume() 122 return twl4030_wdt_start(wdt); twl4030_wdt_resume() 132 { .compatible = "ti,twl4030-wdt", },
|
H A D | da9063_wdt.c | 65 struct da9063_watchdog *wdt = watchdog_get_drvdata(wdd); da9063_wdt_start() local 69 selector = da9063_wdt_timeout_to_sel(wdt->wdtdev.timeout); da9063_wdt_start() 70 ret = _da9063_wdt_set_timeout(wdt->da9063, selector); da9063_wdt_start() 72 dev_err(wdt->da9063->dev, "Watchdog failed to start (err = %d)\n", da9063_wdt_start() 80 struct da9063_watchdog *wdt = watchdog_get_drvdata(wdd); da9063_wdt_stop() local 83 ret = regmap_update_bits(wdt->da9063->regmap, DA9063_REG_CONTROL_D, da9063_wdt_stop() 86 dev_alert(wdt->da9063->dev, "Watchdog failed to stop (err = %d)\n", da9063_wdt_stop() 94 struct da9063_watchdog *wdt = watchdog_get_drvdata(wdd); da9063_wdt_ping() local 97 ret = regmap_write(wdt->da9063->regmap, DA9063_REG_CONTROL_F, da9063_wdt_ping() 100 dev_alert(wdt->da9063->dev, "Failed to ping the watchdog (err = %d)\n", da9063_wdt_ping() 109 struct da9063_watchdog *wdt = watchdog_get_drvdata(wdd); da9063_wdt_set_timeout() local 114 ret = _da9063_wdt_set_timeout(wdt->da9063, selector); da9063_wdt_set_timeout() 116 dev_err(wdt->da9063->dev, "Failed to set watchdog timeout (err = %d)\n", da9063_wdt_set_timeout() 127 struct da9063_watchdog *wdt = container_of(this, da9063_wdt_restart_handler() local 132 ret = regmap_write(wdt->da9063->regmap, DA9063_REG_CONTROL_F, da9063_wdt_restart_handler() 135 dev_alert(wdt->da9063->dev, "Failed to shutdown (err = %d)\n", da9063_wdt_restart_handler() 158 struct da9063_watchdog *wdt; da9063_wdt_probe() local 167 wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); da9063_wdt_probe() 168 if (!wdt) da9063_wdt_probe() 171 wdt->da9063 = da9063; da9063_wdt_probe() 173 wdt->wdtdev.info = &da9063_watchdog_info; da9063_wdt_probe() 174 wdt->wdtdev.ops = &da9063_watchdog_ops; da9063_wdt_probe() 175 wdt->wdtdev.min_timeout = DA9063_WDT_MIN_TIMEOUT; da9063_wdt_probe() 176 wdt->wdtdev.max_timeout = DA9063_WDT_MAX_TIMEOUT; da9063_wdt_probe() 177 wdt->wdtdev.timeout = DA9063_WDG_TIMEOUT; da9063_wdt_probe() 179 wdt->wdtdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS; da9063_wdt_probe() 181 watchdog_set_drvdata(&wdt->wdtdev, wdt); da9063_wdt_probe() 182 dev_set_drvdata(&pdev->dev, wdt); da9063_wdt_probe() 184 ret = watchdog_register_device(&wdt->wdtdev); da9063_wdt_probe() 188 wdt->restart_handler.notifier_call = da9063_wdt_restart_handler; da9063_wdt_probe() 189 wdt->restart_handler.priority = 128; da9063_wdt_probe() 190 ret = register_restart_handler(&wdt->restart_handler); da9063_wdt_probe() 192 dev_err(wdt->da9063->dev, da9063_wdt_probe() 200 struct da9063_watchdog *wdt = dev_get_drvdata(&pdev->dev); da9063_wdt_remove() local 202 unregister_restart_handler(&wdt->restart_handler); da9063_wdt_remove() 204 watchdog_unregister_device(&wdt->wdtdev); da9063_wdt_remove()
|
H A D | s3c2410_wdt.c | 171 { .compatible = "samsung,s3c2410-wdt", 173 { .compatible = "samsung,exynos5250-wdt", 175 { .compatible = "samsung,exynos5420-wdt", 177 { .compatible = "samsung,exynos7-wdt", 186 .name = "s3c2410-wdt", 208 static int s3c2410wdt_mask_and_disable_reset(struct s3c2410_wdt *wdt, bool mask) s3c2410wdt_mask_and_disable_reset() argument 211 u32 mask_val = 1 << wdt->drv_data->mask_bit; s3c2410wdt_mask_and_disable_reset() 215 if (!(wdt->drv_data->quirks & QUIRK_HAS_PMU_CONFIG)) s3c2410wdt_mask_and_disable_reset() 221 ret = regmap_update_bits(wdt->pmureg, s3c2410wdt_mask_and_disable_reset() 222 wdt->drv_data->disable_reg, s3c2410wdt_mask_and_disable_reset() 227 ret = regmap_update_bits(wdt->pmureg, s3c2410wdt_mask_and_disable_reset() 228 wdt->drv_data->mask_reset_reg, s3c2410wdt_mask_and_disable_reset() 232 dev_err(wdt->dev, "failed to update reg(%d)\n", ret); s3c2410wdt_mask_and_disable_reset() 239 struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd); s3c2410wdt_keepalive() local 241 spin_lock(&wdt->lock); s3c2410wdt_keepalive() 242 writel(wdt->count, wdt->reg_base + S3C2410_WTCNT); s3c2410wdt_keepalive() 243 spin_unlock(&wdt->lock); s3c2410wdt_keepalive() 248 static void __s3c2410wdt_stop(struct s3c2410_wdt *wdt) __s3c2410wdt_stop() argument 252 wtcon = readl(wdt->reg_base + S3C2410_WTCON); __s3c2410wdt_stop() 254 writel(wtcon, wdt->reg_base + S3C2410_WTCON); __s3c2410wdt_stop() 259 struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd); s3c2410wdt_stop() local 261 spin_lock(&wdt->lock); s3c2410wdt_stop() 262 __s3c2410wdt_stop(wdt); s3c2410wdt_stop() 263 spin_unlock(&wdt->lock); s3c2410wdt_stop() 271 struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd); s3c2410wdt_start() local 273 spin_lock(&wdt->lock); s3c2410wdt_start() 275 __s3c2410wdt_stop(wdt); s3c2410wdt_start() 277 wtcon = readl(wdt->reg_base + S3C2410_WTCON); s3c2410wdt_start() 289 __func__, wdt->count, wtcon); s3c2410wdt_start() 291 writel(wdt->count, wdt->reg_base + S3C2410_WTDAT); s3c2410wdt_start() 292 writel(wdt->count, wdt->reg_base + S3C2410_WTCNT); s3c2410wdt_start() 293 writel(wtcon, wdt->reg_base + S3C2410_WTCON); s3c2410wdt_start() 294 spin_unlock(&wdt->lock); s3c2410wdt_start() 299 static inline int s3c2410wdt_is_running(struct s3c2410_wdt *wdt) s3c2410wdt_is_running() argument 301 return readl(wdt->reg_base + S3C2410_WTCON) & S3C2410_WTCON_ENABLE; s3c2410wdt_is_running() 306 struct s3c2410_wdt *wdt = watchdog_get_drvdata(wdd); s3c2410wdt_set_heartbeat() local 307 unsigned long freq = clk_get_rate(wdt->clock); s3c2410wdt_set_heartbeat() 330 dev_err(wdt->dev, "timeout %d too big\n", timeout); s3c2410wdt_set_heartbeat() 339 wdt->count = count; s3c2410wdt_set_heartbeat() 342 wtcon = readl(wdt->reg_base + S3C2410_WTCON); s3c2410wdt_set_heartbeat() 346 writel(count, wdt->reg_base + S3C2410_WTDAT); s3c2410wdt_set_heartbeat() 347 writel(wtcon, wdt->reg_base + S3C2410_WTCON); s3c2410wdt_set_heartbeat() 380 struct s3c2410_wdt *wdt = platform_get_drvdata(param); s3c2410wdt_irq() local 382 dev_info(wdt->dev, "watchdog timer expired (irq)\n"); s3c2410wdt_irq() 384 s3c2410wdt_keepalive(&wdt->wdt_device); s3c2410wdt_irq() 394 struct s3c2410_wdt *wdt = freq_to_wdt(nb); s3c2410wdt_cpufreq_transition() local 396 if (!s3c2410wdt_is_running(wdt)) s3c2410wdt_cpufreq_transition() 405 s3c2410wdt_keepalive(&wdt->wdt_device); s3c2410wdt_cpufreq_transition() 407 s3c2410wdt_stop(&wdt->wdt_device); s3c2410wdt_cpufreq_transition() 409 ret = s3c2410wdt_set_heartbeat(&wdt->wdt_device, s3c2410wdt_cpufreq_transition() 410 wdt->wdt_device.timeout); s3c2410wdt_cpufreq_transition() 413 s3c2410wdt_start(&wdt->wdt_device); s3c2410wdt_cpufreq_transition() 422 dev_err(wdt->dev, "cannot set new value for timeout %d\n", s3c2410wdt_cpufreq_transition() 423 wdt->wdt_device.timeout); s3c2410wdt_cpufreq_transition() 427 static inline int s3c2410wdt_cpufreq_register(struct s3c2410_wdt *wdt) s3c2410wdt_cpufreq_register() argument 429 wdt->freq_transition.notifier_call = s3c2410wdt_cpufreq_transition; s3c2410wdt_cpufreq_register() 431 return cpufreq_register_notifier(&wdt->freq_transition, s3c2410wdt_cpufreq_register() 435 static inline void s3c2410wdt_cpufreq_deregister(struct s3c2410_wdt *wdt) s3c2410wdt_cpufreq_deregister() argument 437 wdt->freq_transition.notifier_call = s3c2410wdt_cpufreq_transition; s3c2410wdt_cpufreq_deregister() 439 cpufreq_unregister_notifier(&wdt->freq_transition, s3c2410wdt_cpufreq_deregister() 445 static inline int s3c2410wdt_cpufreq_register(struct s3c2410_wdt *wdt) s3c2410wdt_cpufreq_register() argument 450 static inline void s3c2410wdt_cpufreq_deregister(struct s3c2410_wdt *wdt) s3c2410wdt_cpufreq_deregister() argument 458 struct s3c2410_wdt *wdt = container_of(this, struct s3c2410_wdt, s3c2410wdt_restart() local 460 void __iomem *wdt_base = wdt->reg_base; s3c2410wdt_restart() 480 static inline unsigned int s3c2410wdt_get_bootstatus(struct s3c2410_wdt *wdt) s3c2410wdt_get_bootstatus() argument 485 if (!(wdt->drv_data->quirks & QUIRK_HAS_RST_STAT)) s3c2410wdt_get_bootstatus() 488 ret = regmap_read(wdt->pmureg, wdt->drv_data->rst_stat_reg, &rst_stat); s3c2410wdt_get_bootstatus() 490 dev_warn(wdt->dev, "Couldn't get RST_STAT register\n"); s3c2410wdt_get_bootstatus() 491 else if (rst_stat & BIT(wdt->drv_data->rst_stat_bit)) s3c2410wdt_get_bootstatus() 514 struct s3c2410_wdt *wdt; s3c2410wdt_probe() local 525 wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); s3c2410wdt_probe() 526 if (!wdt) s3c2410wdt_probe() 529 wdt->dev = &pdev->dev; s3c2410wdt_probe() 530 spin_lock_init(&wdt->lock); s3c2410wdt_probe() 531 wdt->wdt_device = s3c2410_wdd; s3c2410wdt_probe() 533 wdt->drv_data = get_wdt_drv_data(pdev); s3c2410wdt_probe() 534 if (wdt->drv_data->quirks & QUIRKS_HAVE_PMUREG) { s3c2410wdt_probe() 535 wdt->pmureg = syscon_regmap_lookup_by_phandle(dev->of_node, s3c2410wdt_probe() 537 if (IS_ERR(wdt->pmureg)) { s3c2410wdt_probe() 539 return PTR_ERR(wdt->pmureg); s3c2410wdt_probe() 552 wdt->reg_base = devm_ioremap_resource(dev, wdt_mem); s3c2410wdt_probe() 553 if (IS_ERR(wdt->reg_base)) { s3c2410wdt_probe() 554 ret = PTR_ERR(wdt->reg_base); s3c2410wdt_probe() 558 DBG("probe: mapped reg_base=%p\n", wdt->reg_base); s3c2410wdt_probe() 560 wdt->clock = devm_clk_get(dev, "watchdog"); s3c2410wdt_probe() 561 if (IS_ERR(wdt->clock)) { s3c2410wdt_probe() 563 ret = PTR_ERR(wdt->clock); s3c2410wdt_probe() 567 ret = clk_prepare_enable(wdt->clock); s3c2410wdt_probe() 573 ret = s3c2410wdt_cpufreq_register(wdt); s3c2410wdt_probe() 579 watchdog_set_drvdata(&wdt->wdt_device, wdt); s3c2410wdt_probe() 584 watchdog_init_timeout(&wdt->wdt_device, tmr_margin, &pdev->dev); s3c2410wdt_probe() 585 ret = s3c2410wdt_set_heartbeat(&wdt->wdt_device, s3c2410wdt_probe() 586 wdt->wdt_device.timeout); s3c2410wdt_probe() 588 started = s3c2410wdt_set_heartbeat(&wdt->wdt_device, s3c2410wdt_probe() 607 watchdog_set_nowayout(&wdt->wdt_device, nowayout); s3c2410wdt_probe() 609 wdt->wdt_device.bootstatus = s3c2410wdt_get_bootstatus(wdt); s3c2410wdt_probe() 611 ret = watchdog_register_device(&wdt->wdt_device); s3c2410wdt_probe() 617 ret = s3c2410wdt_mask_and_disable_reset(wdt, false); s3c2410wdt_probe() 623 s3c2410wdt_start(&wdt->wdt_device); s3c2410wdt_probe() 629 s3c2410wdt_stop(&wdt->wdt_device); s3c2410wdt_probe() 632 platform_set_drvdata(pdev, wdt); s3c2410wdt_probe() 634 wdt->restart_handler.notifier_call = s3c2410wdt_restart; s3c2410wdt_probe() 635 wdt->restart_handler.priority = 128; s3c2410wdt_probe() 636 ret = register_restart_handler(&wdt->restart_handler); s3c2410wdt_probe() 642 wtcon = readl(wdt->reg_base + S3C2410_WTCON); s3c2410wdt_probe() 652 watchdog_unregister_device(&wdt->wdt_device); s3c2410wdt_probe() 655 s3c2410wdt_cpufreq_deregister(wdt); s3c2410wdt_probe() 658 clk_disable_unprepare(wdt->clock); s3c2410wdt_probe() 667 struct s3c2410_wdt *wdt = platform_get_drvdata(dev); s3c2410wdt_remove() local 669 unregister_restart_handler(&wdt->restart_handler); s3c2410wdt_remove() 671 ret = s3c2410wdt_mask_and_disable_reset(wdt, true); s3c2410wdt_remove() 675 watchdog_unregister_device(&wdt->wdt_device); s3c2410wdt_remove() 677 s3c2410wdt_cpufreq_deregister(wdt); s3c2410wdt_remove() 679 clk_disable_unprepare(wdt->clock); s3c2410wdt_remove() 686 struct s3c2410_wdt *wdt = platform_get_drvdata(dev); s3c2410wdt_shutdown() local 688 s3c2410wdt_mask_and_disable_reset(wdt, true); s3c2410wdt_shutdown() 690 s3c2410wdt_stop(&wdt->wdt_device); s3c2410wdt_shutdown() 698 struct s3c2410_wdt *wdt = dev_get_drvdata(dev); s3c2410wdt_suspend() local 701 wdt->wtcon_save = readl(wdt->reg_base + S3C2410_WTCON); s3c2410wdt_suspend() 702 wdt->wtdat_save = readl(wdt->reg_base + S3C2410_WTDAT); s3c2410wdt_suspend() 704 ret = s3c2410wdt_mask_and_disable_reset(wdt, true); s3c2410wdt_suspend() 709 s3c2410wdt_stop(&wdt->wdt_device); s3c2410wdt_suspend() 717 struct s3c2410_wdt *wdt = dev_get_drvdata(dev); s3c2410wdt_resume() local 720 writel(wdt->wtdat_save, wdt->reg_base + S3C2410_WTDAT); s3c2410wdt_resume() 721 writel(wdt->wtdat_save, wdt->reg_base + S3C2410_WTCNT);/* Reset count */ s3c2410wdt_resume() 722 writel(wdt->wtcon_save, wdt->reg_base + S3C2410_WTCON); s3c2410wdt_resume() 724 ret = s3c2410wdt_mask_and_disable_reset(wdt, false); s3c2410wdt_resume() 729 (wdt->wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis"); s3c2410wdt_resume() 744 .name = "s3c2410-wdt",
|
H A D | bcm_kona_wdt.c | 65 static int secure_register_read(struct bcm_kona_wdt *wdt, uint32_t offset) secure_register_read() argument 78 val = readl_relaxed(wdt->base + offset); secure_register_read() 84 if (count > wdt->busy_count) secure_register_read() 85 wdt->busy_count = count; secure_register_read() 104 struct bcm_kona_wdt *wdt = s->private; bcm_kona_wdt_dbg_show() local 106 if (!wdt) { bcm_kona_wdt_dbg_show() 111 spin_lock_irqsave(&wdt->lock, flags); bcm_kona_wdt_dbg_show() 112 ctl_val = secure_register_read(wdt, SECWDOG_CTRL_REG); bcm_kona_wdt_dbg_show() 113 cur_val = secure_register_read(wdt, SECWDOG_COUNT_REG); bcm_kona_wdt_dbg_show() 114 spin_unlock_irqrestore(&wdt->lock, flags); bcm_kona_wdt_dbg_show() 124 ctl_sec = TICKS_TO_SECS(ctl, wdt); bcm_kona_wdt_dbg_show() 125 cur_sec = TICKS_TO_SECS(cur, wdt); bcm_kona_wdt_dbg_show() 131 res, wdt->resolution, bcm_kona_wdt_dbg_show() 134 wdt->busy_count); bcm_kona_wdt_dbg_show() 155 struct bcm_kona_wdt *wdt = platform_get_drvdata(pdev); bcm_kona_wdt_debug_init() local 157 if (!wdt) bcm_kona_wdt_debug_init() 160 wdt->debugfs = NULL; bcm_kona_wdt_debug_init() 166 if (debugfs_create_file("info", S_IFREG | S_IRUGO, dir, wdt, bcm_kona_wdt_debug_init() 168 wdt->debugfs = dir; bcm_kona_wdt_debug_init() 175 struct bcm_kona_wdt *wdt = platform_get_drvdata(pdev); bcm_kona_wdt_debug_exit() local 177 if (wdt && wdt->debugfs) { bcm_kona_wdt_debug_exit() 178 debugfs_remove_recursive(wdt->debugfs); bcm_kona_wdt_debug_exit() 179 wdt->debugfs = NULL; bcm_kona_wdt_debug_exit() 190 static int bcm_kona_wdt_ctrl_reg_modify(struct bcm_kona_wdt *wdt, bcm_kona_wdt_ctrl_reg_modify() argument 197 spin_lock_irqsave(&wdt->lock, flags); bcm_kona_wdt_ctrl_reg_modify() 199 val = secure_register_read(wdt, SECWDOG_CTRL_REG); bcm_kona_wdt_ctrl_reg_modify() 205 writel_relaxed(val, wdt->base + SECWDOG_CTRL_REG); bcm_kona_wdt_ctrl_reg_modify() 208 spin_unlock_irqrestore(&wdt->lock, flags); bcm_kona_wdt_ctrl_reg_modify() 213 static int bcm_kona_wdt_set_resolution_reg(struct bcm_kona_wdt *wdt) bcm_kona_wdt_set_resolution_reg() argument 215 if (wdt->resolution > SECWDOG_MAX_RES) bcm_kona_wdt_set_resolution_reg() 218 return bcm_kona_wdt_ctrl_reg_modify(wdt, SECWDOG_RES_MASK, bcm_kona_wdt_set_resolution_reg() 219 wdt->resolution << SECWDOG_CLKS_SHIFT); bcm_kona_wdt_set_resolution_reg() 225 struct bcm_kona_wdt *wdt = watchdog_get_drvdata(wdog); bcm_kona_wdt_set_timeout_reg() local 227 return bcm_kona_wdt_ctrl_reg_modify(wdt, SECWDOG_COUNT_MASK, bcm_kona_wdt_set_timeout_reg() 228 SECS_TO_TICKS(wdog->timeout, wdt) | bcm_kona_wdt_set_timeout_reg() 241 struct bcm_kona_wdt *wdt = watchdog_get_drvdata(wdog); bcm_kona_wdt_get_timeleft() local 245 spin_lock_irqsave(&wdt->lock, flags); bcm_kona_wdt_get_timeleft() 246 val = secure_register_read(wdt, SECWDOG_COUNT_REG); bcm_kona_wdt_get_timeleft() 247 spin_unlock_irqrestore(&wdt->lock, flags); bcm_kona_wdt_get_timeleft() 252 return TICKS_TO_SECS(val & SECWDOG_COUNT_MASK, wdt); bcm_kona_wdt_get_timeleft() 263 struct bcm_kona_wdt *wdt = watchdog_get_drvdata(wdog); bcm_kona_wdt_stop() local 265 return bcm_kona_wdt_ctrl_reg_modify(wdt, SECWDOG_EN_MASK | bcm_kona_wdt_stop() 299 struct bcm_kona_wdt *wdt; bcm_kona_wdt_probe() local 303 wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); bcm_kona_wdt_probe() 304 if (!wdt) bcm_kona_wdt_probe() 308 wdt->base = devm_ioremap_resource(dev, res); bcm_kona_wdt_probe() 309 if (IS_ERR(wdt->base)) bcm_kona_wdt_probe() 312 wdt->resolution = SECWDOG_DEFAULT_RESOLUTION; bcm_kona_wdt_probe() 313 ret = bcm_kona_wdt_set_resolution_reg(wdt); bcm_kona_wdt_probe() 319 spin_lock_init(&wdt->lock); bcm_kona_wdt_probe() 320 platform_set_drvdata(pdev, wdt); bcm_kona_wdt_probe() 321 watchdog_set_drvdata(&bcm_kona_wdt_wdd, wdt); bcm_kona_wdt_probe() 352 { .compatible = "brcm,kona-wdt", },
|
H A D | ts72xx_wdt.c | 140 * @wdt: watchdog to be kicked 142 * Called with @wdt->lock held. 144 static inline void ts72xx_wdt_kick(struct ts72xx_wdt *wdt) ts72xx_wdt_kick() argument 146 __raw_writeb(TS72XX_WDT_FEED_VAL, wdt->feed_reg); ts72xx_wdt_kick() 151 * @wdt: watchdog to be started 156 * Called with @wdt->lock held. 158 static void ts72xx_wdt_start(struct ts72xx_wdt *wdt) ts72xx_wdt_start() argument 161 * To program the wdt, it first must be "fed" and ts72xx_wdt_start() 165 ts72xx_wdt_kick(wdt); ts72xx_wdt_start() 166 __raw_writeb((u8)wdt->regval, wdt->control_reg); ts72xx_wdt_start() 171 * @wdt: watchdog to be stopped 173 * Called with @wdt->lock held. 175 static void ts72xx_wdt_stop(struct ts72xx_wdt *wdt) ts72xx_wdt_stop() argument 177 ts72xx_wdt_kick(wdt); ts72xx_wdt_stop() 178 __raw_writeb(0, wdt->control_reg); ts72xx_wdt_stop() 183 struct ts72xx_wdt *wdt = platform_get_drvdata(ts72xx_wdt_pdev); ts72xx_wdt_open() local 192 dev_err(&wdt->pdev->dev, ts72xx_wdt_open() 198 if (mutex_lock_interruptible(&wdt->lock)) ts72xx_wdt_open() 201 if ((wdt->flags & TS72XX_WDT_BUSY_FLAG) != 0) { ts72xx_wdt_open() 202 mutex_unlock(&wdt->lock); ts72xx_wdt_open() 206 wdt->flags = TS72XX_WDT_BUSY_FLAG; ts72xx_wdt_open() 207 wdt->regval = regval; ts72xx_wdt_open() 208 file->private_data = wdt; ts72xx_wdt_open() 210 ts72xx_wdt_start(wdt); ts72xx_wdt_open() 212 mutex_unlock(&wdt->lock); ts72xx_wdt_open() 218 struct ts72xx_wdt *wdt = file->private_data; ts72xx_wdt_release() local 220 if (mutex_lock_interruptible(&wdt->lock)) ts72xx_wdt_release() 223 if ((wdt->flags & TS72XX_WDT_EXPECT_CLOSE_FLAG) != 0) { ts72xx_wdt_release() 224 ts72xx_wdt_stop(wdt); ts72xx_wdt_release() 226 dev_warn(&wdt->pdev->dev, ts72xx_wdt_release() 234 ts72xx_wdt_kick(wdt); ts72xx_wdt_release() 237 wdt->flags = 0; ts72xx_wdt_release() 239 mutex_unlock(&wdt->lock); ts72xx_wdt_release() 248 struct ts72xx_wdt *wdt = file->private_data; ts72xx_wdt_write() local 253 if (mutex_lock_interruptible(&wdt->lock)) ts72xx_wdt_write() 256 ts72xx_wdt_kick(wdt); ts72xx_wdt_write() 261 * This means that we know that the wdt timer can be ts72xx_wdt_write() 271 wdt->flags &= ~TS72XX_WDT_EXPECT_CLOSE_FLAG; ts72xx_wdt_write() 274 mutex_unlock(&wdt->lock); ts72xx_wdt_write() 278 wdt->flags |= TS72XX_WDT_EXPECT_CLOSE_FLAG; ts72xx_wdt_write() 284 mutex_unlock(&wdt->lock); ts72xx_wdt_write() 298 struct ts72xx_wdt *wdt = file->private_data; ts72xx_wdt_ioctl() local 303 if (mutex_lock_interruptible(&wdt->lock)) ts72xx_wdt_ioctl() 318 ts72xx_wdt_kick(wdt); ts72xx_wdt_ioctl() 331 ts72xx_wdt_stop(wdt); ts72xx_wdt_ioctl() 335 ts72xx_wdt_start(wdt); ts72xx_wdt_ioctl() 355 ts72xx_wdt_stop(wdt); ts72xx_wdt_ioctl() 356 wdt->regval = regval; ts72xx_wdt_ioctl() 357 ts72xx_wdt_start(wdt); ts72xx_wdt_ioctl() 363 error = put_user(regval_to_timeout(wdt->regval), p); ts72xx_wdt_ioctl() 371 mutex_unlock(&wdt->lock); ts72xx_wdt_ioctl() 392 struct ts72xx_wdt *wdt; ts72xx_wdt_probe() local 396 wdt = devm_kzalloc(&pdev->dev, sizeof(struct ts72xx_wdt), GFP_KERNEL); ts72xx_wdt_probe() 397 if (!wdt) ts72xx_wdt_probe() 401 wdt->control_reg = devm_ioremap_resource(&pdev->dev, r1); ts72xx_wdt_probe() 402 if (IS_ERR(wdt->control_reg)) ts72xx_wdt_probe() 403 return PTR_ERR(wdt->control_reg); ts72xx_wdt_probe() 406 wdt->feed_reg = devm_ioremap_resource(&pdev->dev, r2); ts72xx_wdt_probe() 407 if (IS_ERR(wdt->feed_reg)) ts72xx_wdt_probe() 408 return PTR_ERR(wdt->feed_reg); ts72xx_wdt_probe() 410 platform_set_drvdata(pdev, wdt); ts72xx_wdt_probe() 412 wdt->pdev = pdev; ts72xx_wdt_probe() 413 mutex_init(&wdt->lock); ts72xx_wdt_probe() 416 ts72xx_wdt_stop(wdt); ts72xx_wdt_probe() 438 .name = "ts72xx-wdt", 447 MODULE_ALIAS("platform:ts72xx-wdt");
|
H A D | qcom-wdt.c | 43 struct qcom_wdt *wdt = to_qcom_wdt(wdd); qcom_wdt_start() local 45 writel(0, wdt->base + WDT_EN); qcom_wdt_start() 46 writel(1, wdt->base + WDT_RST); qcom_wdt_start() 47 writel(wdd->timeout * wdt->rate, wdt->base + WDT_BITE_TIME); qcom_wdt_start() 48 writel(1, wdt->base + WDT_EN); qcom_wdt_start() 54 struct qcom_wdt *wdt = to_qcom_wdt(wdd); qcom_wdt_stop() local 56 writel(0, wdt->base + WDT_EN); qcom_wdt_stop() 62 struct qcom_wdt *wdt = to_qcom_wdt(wdd); qcom_wdt_ping() local 64 writel(1, wdt->base + WDT_RST); qcom_wdt_ping() 93 struct qcom_wdt *wdt = container_of(nb, struct qcom_wdt, restart_nb); qcom_wdt_restart() local 100 timeout = 128 * wdt->rate / 1000; qcom_wdt_restart() 102 writel(0, wdt->base + WDT_EN); qcom_wdt_restart() 103 writel(1, wdt->base + WDT_RST); qcom_wdt_restart() 104 writel(timeout, wdt->base + WDT_BITE_TIME); qcom_wdt_restart() 105 writel(1, wdt->base + WDT_EN); qcom_wdt_restart() 118 struct qcom_wdt *wdt; qcom_wdt_probe() local 124 wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); qcom_wdt_probe() 125 if (!wdt) qcom_wdt_probe() 137 wdt->base = devm_ioremap_resource(&pdev->dev, res); qcom_wdt_probe() 138 if (IS_ERR(wdt->base)) qcom_wdt_probe() 139 return PTR_ERR(wdt->base); qcom_wdt_probe() 141 wdt->clk = devm_clk_get(&pdev->dev, NULL); qcom_wdt_probe() 142 if (IS_ERR(wdt->clk)) { qcom_wdt_probe() 144 return PTR_ERR(wdt->clk); qcom_wdt_probe() 147 ret = clk_prepare_enable(wdt->clk); qcom_wdt_probe() 161 wdt->rate = clk_get_rate(wdt->clk); qcom_wdt_probe() 162 if (wdt->rate == 0 || qcom_wdt_probe() 163 wdt->rate > 0x10000000U) { qcom_wdt_probe() 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() 192 wdt->restart_nb.notifier_call = qcom_wdt_restart; qcom_wdt_probe() 193 ret = register_restart_handler(&wdt->restart_nb); qcom_wdt_probe() 197 platform_set_drvdata(pdev, wdt); qcom_wdt_probe() 201 clk_disable_unprepare(wdt->clk); qcom_wdt_probe() 207 struct qcom_wdt *wdt = platform_get_drvdata(pdev); qcom_wdt_remove() local 209 unregister_restart_handler(&wdt->restart_nb); qcom_wdt_remove() 210 watchdog_unregister_device(&wdt->wdd); qcom_wdt_remove() 211 clk_disable_unprepare(wdt->clk); qcom_wdt_remove()
|
H A D | rn5t618_wdt.c | 20 #define DRIVER_NAME "rn5t618-wdt" 56 struct rn5t618_wdt *wdt = watchdog_get_drvdata(wdt_dev); rn5t618_wdt_set_timeout() local 67 ret = regmap_update_bits(wdt->rn5t618->regmap, RN5T618_WATCHDOG, rn5t618_wdt_set_timeout() 78 struct rn5t618_wdt *wdt = watchdog_get_drvdata(wdt_dev); rn5t618_wdt_start() local 86 ret = regmap_update_bits(wdt->rn5t618->regmap, RN5T618_REPCNT, rn5t618_wdt_start() 93 ret = regmap_update_bits(wdt->rn5t618->regmap, RN5T618_WATCHDOG, rn5t618_wdt_start() 100 return regmap_update_bits(wdt->rn5t618->regmap, RN5T618_PWRIREN, rn5t618_wdt_start() 107 struct rn5t618_wdt *wdt = watchdog_get_drvdata(wdt_dev); rn5t618_wdt_stop() local 109 return regmap_update_bits(wdt->rn5t618->regmap, RN5T618_WATCHDOG, rn5t618_wdt_stop() 115 struct rn5t618_wdt *wdt = watchdog_get_drvdata(wdt_dev); rn5t618_wdt_ping() local 120 ret = regmap_read(wdt->rn5t618->regmap, RN5T618_WATCHDOG, &val); rn5t618_wdt_ping() 124 ret = regmap_write(wdt->rn5t618->regmap, RN5T618_WATCHDOG, val); rn5t618_wdt_ping() 129 return regmap_update_bits(wdt->rn5t618->regmap, RN5T618_PWRIRQ, rn5t618_wdt_ping() 150 struct rn5t618_wdt *wdt; rn5t618_wdt_probe() local 153 wdt = devm_kzalloc(&pdev->dev, sizeof(struct rn5t618_wdt), GFP_KERNEL); rn5t618_wdt_probe() 154 if (!wdt) rn5t618_wdt_probe() 160 wdt->rn5t618 = rn5t618; rn5t618_wdt_probe() 161 wdt->wdt_dev.info = &rn5t618_wdt_info; rn5t618_wdt_probe() 162 wdt->wdt_dev.ops = &rn5t618_wdt_ops; rn5t618_wdt_probe() 163 wdt->wdt_dev.min_timeout = min_timeout; rn5t618_wdt_probe() 164 wdt->wdt_dev.max_timeout = max_timeout; rn5t618_wdt_probe() 165 wdt->wdt_dev.timeout = max_timeout; rn5t618_wdt_probe() 166 wdt->wdt_dev.parent = &pdev->dev; rn5t618_wdt_probe() 168 watchdog_set_drvdata(&wdt->wdt_dev, wdt); rn5t618_wdt_probe() 169 watchdog_init_timeout(&wdt->wdt_dev, timeout, &pdev->dev); rn5t618_wdt_probe() 170 watchdog_set_nowayout(&wdt->wdt_dev, nowayout); rn5t618_wdt_probe() 172 platform_set_drvdata(pdev, wdt); rn5t618_wdt_probe() 174 return watchdog_register_device(&wdt->wdt_dev); rn5t618_wdt_probe() 179 struct rn5t618_wdt *wdt = platform_get_drvdata(pdev); rn5t618_wdt_remove() local 181 watchdog_unregister_device(&wdt->wdt_dev); rn5t618_wdt_remove()
|
H A D | shwdt.c | 39 #define DRV_NAME "sh-wdt" 87 struct sh_wdt *wdt = watchdog_get_drvdata(wdt_dev); sh_wdt_start() local 91 pm_runtime_get_sync(wdt->dev); sh_wdt_start() 92 clk_enable(wdt->clk); sh_wdt_start() 94 spin_lock_irqsave(&wdt->lock, flags); sh_wdt_start() 97 mod_timer(&wdt->timer, next_ping_period(clock_division_ratio)); sh_wdt_start() 123 spin_unlock_irqrestore(&wdt->lock, flags); sh_wdt_start() 130 struct sh_wdt *wdt = watchdog_get_drvdata(wdt_dev); sh_wdt_stop() local 134 spin_lock_irqsave(&wdt->lock, flags); sh_wdt_stop() 136 del_timer(&wdt->timer); sh_wdt_stop() 142 spin_unlock_irqrestore(&wdt->lock, flags); sh_wdt_stop() 144 clk_disable(wdt->clk); sh_wdt_stop() 145 pm_runtime_put_sync(wdt->dev); sh_wdt_stop() 152 struct sh_wdt *wdt = watchdog_get_drvdata(wdt_dev); sh_wdt_keepalive() local 155 spin_lock_irqsave(&wdt->lock, flags); sh_wdt_keepalive() 157 spin_unlock_irqrestore(&wdt->lock, flags); sh_wdt_keepalive() 164 struct sh_wdt *wdt = watchdog_get_drvdata(wdt_dev); sh_wdt_set_heartbeat() local 170 spin_lock_irqsave(&wdt->lock, flags); sh_wdt_set_heartbeat() 173 spin_unlock_irqrestore(&wdt->lock, flags); sh_wdt_set_heartbeat() 180 struct sh_wdt *wdt = (struct sh_wdt *)data; sh_wdt_ping() local 183 spin_lock_irqsave(&wdt->lock, flags); sh_wdt_ping() 193 mod_timer(&wdt->timer, next_ping_period(clock_division_ratio)); sh_wdt_ping() 195 dev_warn(wdt->dev, "Heartbeat lost! Will not ping " sh_wdt_ping() 197 spin_unlock_irqrestore(&wdt->lock, flags); sh_wdt_ping() 222 struct sh_wdt *wdt; sh_wdt_probe() local 233 wdt = devm_kzalloc(&pdev->dev, sizeof(struct sh_wdt), GFP_KERNEL); sh_wdt_probe() 234 if (unlikely(!wdt)) sh_wdt_probe() 237 wdt->dev = &pdev->dev; sh_wdt_probe() 239 wdt->clk = devm_clk_get(&pdev->dev, NULL); sh_wdt_probe() 240 if (IS_ERR(wdt->clk)) { sh_wdt_probe() 245 wdt->clk = NULL; sh_wdt_probe() 249 wdt->base = devm_ioremap_resource(wdt->dev, res); sh_wdt_probe() 250 if (IS_ERR(wdt->base)) sh_wdt_probe() 251 return PTR_ERR(wdt->base); sh_wdt_probe() 254 watchdog_set_drvdata(&sh_wdt_dev, wdt); sh_wdt_probe() 256 spin_lock_init(&wdt->lock); sh_wdt_probe() 277 init_timer(&wdt->timer); sh_wdt_probe() 278 wdt->timer.function = sh_wdt_ping; sh_wdt_probe() 279 wdt->timer.data = (unsigned long)wdt; sh_wdt_probe() 280 wdt->timer.expires = next_ping_period(clock_division_ratio); sh_wdt_probe()
|
H A D | menf21bmc_wdt.c | 38 struct watchdog_device wdt; member in struct:menf21bmc_wdt 51 data->wdt.bootstatus |= WDIOF_CARDRESET; menf21bmc_wdt_set_bootstatus() 53 data->wdt.bootstatus |= WDIOF_EXTERN1; menf21bmc_wdt_set_bootstatus() 55 data->wdt.bootstatus |= WDIOF_EXTERN2; menf21bmc_wdt_set_bootstatus() 57 data->wdt.bootstatus |= WDIOF_POWERUNDER; menf21bmc_wdt_set_bootstatus() 62 static int menf21bmc_wdt_start(struct watchdog_device *wdt) menf21bmc_wdt_start() argument 64 struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt); menf21bmc_wdt_start() 69 static int menf21bmc_wdt_stop(struct watchdog_device *wdt) menf21bmc_wdt_stop() argument 71 struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt); menf21bmc_wdt_stop() 78 menf21bmc_wdt_settimeout(struct watchdog_device *wdt, unsigned int timeout) menf21bmc_wdt_settimeout() argument 81 struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt); menf21bmc_wdt_settimeout() 93 wdt->timeout = timeout; menf21bmc_wdt_settimeout() 98 static int menf21bmc_wdt_ping(struct watchdog_device *wdt) menf21bmc_wdt_ping() argument 100 struct menf21bmc_wdt *drv_data = watchdog_get_drvdata(wdt); menf21bmc_wdt_ping() 129 drv_data->wdt.ops = &menf21bmc_wdt_ops; menf21bmc_wdt_probe() 130 drv_data->wdt.info = &menf21bmc_wdt_info; menf21bmc_wdt_probe() 131 drv_data->wdt.min_timeout = BMC_WD_TIMEOUT_MIN; menf21bmc_wdt_probe() 132 drv_data->wdt.max_timeout = BMC_WD_TIMEOUT_MAX; menf21bmc_wdt_probe() 136 * Get the current wdt timeout value from the BMC because menf21bmc_wdt_probe() 146 watchdog_init_timeout(&drv_data->wdt, bmc_timeout / 10, &pdev->dev); menf21bmc_wdt_probe() 147 watchdog_set_nowayout(&drv_data->wdt, nowayout); menf21bmc_wdt_probe() 148 watchdog_set_drvdata(&drv_data->wdt, drv_data); menf21bmc_wdt_probe() 157 ret = watchdog_register_device(&drv_data->wdt); menf21bmc_wdt_probe() 175 watchdog_unregister_device(&drv_data->wdt); menf21bmc_wdt_remove()
|
H A D | cadence_wdt.c | 91 static inline void cdns_wdt_writereg(struct cdns_wdt *wdt, u32 offset, u32 val) cdns_wdt_writereg() argument 93 writel_relaxed(val, wdt->regs + offset); cdns_wdt_writereg() 132 struct cdns_wdt *wdt = watchdog_get_drvdata(wdd); cdns_wdt_stop() local 134 spin_lock(&wdt->io_lock); cdns_wdt_stop() 135 cdns_wdt_writereg(wdt, CDNS_WDT_ZMR_OFFSET, cdns_wdt_stop() 137 spin_unlock(&wdt->io_lock); cdns_wdt_stop() 153 struct cdns_wdt *wdt = watchdog_get_drvdata(wdd); cdns_wdt_reload() local 155 spin_lock(&wdt->io_lock); cdns_wdt_reload() 156 cdns_wdt_writereg(wdt, CDNS_WDT_RESTART_OFFSET, cdns_wdt_reload() 158 spin_unlock(&wdt->io_lock); cdns_wdt_reload() 183 struct cdns_wdt *wdt = watchdog_get_drvdata(wdd); cdns_wdt_start() local 186 unsigned long clock_f = clk_get_rate(wdt->clk); cdns_wdt_start() 192 count = (wdd->timeout * (clock_f / wdt->prescaler)) / cdns_wdt_start() 198 spin_lock(&wdt->io_lock); cdns_wdt_start() 199 cdns_wdt_writereg(wdt, CDNS_WDT_ZMR_OFFSET, cdns_wdt_start() 205 data = count | CDNS_WDT_REGISTER_ACCESS_KEY | wdt->ctrl_clksel; cdns_wdt_start() 206 cdns_wdt_writereg(wdt, CDNS_WDT_CCR_OFFSET, data); cdns_wdt_start() 211 if (wdt->rst) { cdns_wdt_start() 218 cdns_wdt_writereg(wdt, CDNS_WDT_ZMR_OFFSET, data); cdns_wdt_start() 219 cdns_wdt_writereg(wdt, CDNS_WDT_RESTART_OFFSET, cdns_wdt_start() 221 spin_unlock(&wdt->io_lock); cdns_wdt_start() 298 struct cdns_wdt *wdt = container_of(this, struct cdns_wdt, cdns_wdt_notify_sys() local 301 cdns_wdt_stop(&wdt->cdns_wdt_device); cdns_wdt_notify_sys() 320 struct cdns_wdt *wdt; cdns_wdt_probe() local 323 wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); cdns_wdt_probe() 324 if (!wdt) cdns_wdt_probe() 327 cdns_wdt_device = &wdt->cdns_wdt_device; cdns_wdt_probe() 335 wdt->regs = devm_ioremap_resource(&pdev->dev, res); cdns_wdt_probe() 336 if (IS_ERR(wdt->regs)) cdns_wdt_probe() 337 return PTR_ERR(wdt->regs); cdns_wdt_probe() 340 wdt->rst = of_property_read_bool(pdev->dev.of_node, "reset-on-timeout"); cdns_wdt_probe() 342 if (!wdt->rst && irq >= 0) { cdns_wdt_probe() 363 watchdog_set_drvdata(cdns_wdt_device, wdt); cdns_wdt_probe() 365 wdt->clk = devm_clk_get(&pdev->dev, NULL); cdns_wdt_probe() 366 if (IS_ERR(wdt->clk)) { cdns_wdt_probe() 368 ret = PTR_ERR(wdt->clk); cdns_wdt_probe() 372 ret = clk_prepare_enable(wdt->clk); cdns_wdt_probe() 378 clock_f = clk_get_rate(wdt->clk); cdns_wdt_probe() 380 wdt->prescaler = CDNS_WDT_PRESCALE_512; cdns_wdt_probe() 381 wdt->ctrl_clksel = CDNS_WDT_PRESCALE_SELECT_512; cdns_wdt_probe() 383 wdt->prescaler = CDNS_WDT_PRESCALE_4096; cdns_wdt_probe() 384 wdt->ctrl_clksel = CDNS_WDT_PRESCALE_SELECT_4096; cdns_wdt_probe() 387 spin_lock_init(&wdt->io_lock); cdns_wdt_probe() 389 wdt->cdns_wdt_notifier.notifier_call = &cdns_wdt_notify_sys; cdns_wdt_probe() 390 ret = register_reboot_notifier(&wdt->cdns_wdt_notifier); cdns_wdt_probe() 399 dev_err(&pdev->dev, "Failed to register wdt device\n"); cdns_wdt_probe() 402 platform_set_drvdata(pdev, wdt); cdns_wdt_probe() 405 wdt->regs, cdns_wdt_device->timeout, cdns_wdt_probe() 411 clk_disable_unprepare(wdt->clk); cdns_wdt_probe() 426 struct cdns_wdt *wdt = platform_get_drvdata(pdev); cdns_wdt_remove() local 428 cdns_wdt_stop(&wdt->cdns_wdt_device); cdns_wdt_remove() 429 watchdog_unregister_device(&wdt->cdns_wdt_device); cdns_wdt_remove() 430 unregister_reboot_notifier(&wdt->cdns_wdt_notifier); cdns_wdt_remove() 431 clk_disable_unprepare(wdt->clk); cdns_wdt_remove() 444 struct cdns_wdt *wdt = platform_get_drvdata(pdev); cdns_wdt_shutdown() local 446 cdns_wdt_stop(&wdt->cdns_wdt_device); cdns_wdt_shutdown() 447 clk_disable_unprepare(wdt->clk); cdns_wdt_shutdown() 460 struct cdns_wdt *wdt = platform_get_drvdata(pdev); cdns_wdt_suspend() local 462 cdns_wdt_stop(&wdt->cdns_wdt_device); cdns_wdt_suspend() 463 clk_disable_unprepare(wdt->clk); cdns_wdt_suspend() 479 struct cdns_wdt *wdt = platform_get_drvdata(pdev); cdns_wdt_resume() local 481 ret = clk_prepare_enable(wdt->clk); cdns_wdt_resume() 486 cdns_wdt_start(&wdt->cdns_wdt_device); cdns_wdt_resume() 494 { .compatible = "cdns,wdt-r1p2", }, 505 .name = "cdns-wdt",
|
H A D | bcm2835_wdt.c | 47 struct bcm2835_wdt *wdt = watchdog_get_drvdata(wdog); bcm2835_wdt_start() local 51 spin_lock_irqsave(&wdt->lock, flags); bcm2835_wdt_start() 54 PM_WDOG_TIME_SET), wdt->base + PM_WDOG); bcm2835_wdt_start() 55 cur = readl_relaxed(wdt->base + PM_RSTC); bcm2835_wdt_start() 57 PM_RSTC_WRCFG_FULL_RESET, wdt->base + PM_RSTC); bcm2835_wdt_start() 59 spin_unlock_irqrestore(&wdt->lock, flags); bcm2835_wdt_start() 66 struct bcm2835_wdt *wdt = watchdog_get_drvdata(wdog); bcm2835_wdt_stop() local 68 writel_relaxed(PM_PASSWORD | PM_RSTC_RESET, wdt->base + PM_RSTC); bcm2835_wdt_stop() 81 struct bcm2835_wdt *wdt = watchdog_get_drvdata(wdog); bcm2835_wdt_get_timeleft() local 83 uint32_t ret = readl_relaxed(wdt->base + PM_WDOG); bcm2835_wdt_get_timeleft() 113 struct bcm2835_wdt *wdt; bcm2835_wdt_probe() local 116 wdt = devm_kzalloc(dev, sizeof(struct bcm2835_wdt), GFP_KERNEL); bcm2835_wdt_probe() 117 if (!wdt) bcm2835_wdt_probe() 119 platform_set_drvdata(pdev, wdt); bcm2835_wdt_probe() 121 spin_lock_init(&wdt->lock); bcm2835_wdt_probe() 123 wdt->base = of_iomap(np, 0); bcm2835_wdt_probe() 124 if (!wdt->base) { bcm2835_wdt_probe() 129 watchdog_set_drvdata(&bcm2835_wdt_wdd, wdt); bcm2835_wdt_probe() 135 iounmap(wdt->base); bcm2835_wdt_probe() 145 struct bcm2835_wdt *wdt = platform_get_drvdata(pdev); bcm2835_wdt_remove() local 148 iounmap(wdt->base); bcm2835_wdt_remove() 159 { .compatible = "brcm,bcm2835-pm-wdt", }, 169 .name = "bcm2835-wdt",
|
H A D | at32ap700x_wdt.c | 85 static struct wdt_at32ap700x *wdt; variable in typeref:struct:wdt_at32ap700x 95 spin_lock(&wdt->io_lock); at32_wdt_stop() 96 psel = wdt_readl(wdt, CTRL) & WDT_BF(CTRL_PSEL, 0x0f); at32_wdt_stop() 97 wdt_writel(wdt, CTRL, psel | WDT_BF(CTRL_KEY, 0x55)); at32_wdt_stop() 98 wdt_writel(wdt, CTRL, psel | WDT_BF(CTRL_KEY, 0xaa)); at32_wdt_stop() 99 spin_unlock(&wdt->io_lock); at32_wdt_stop() 108 unsigned long psel = (wdt->timeout > 1) ? 0xf : 0xe; at32_wdt_start() 110 spin_lock(&wdt->io_lock); at32_wdt_start() 111 wdt_writel(wdt, CTRL, WDT_BIT(CTRL_EN) at32_wdt_start() 114 wdt_writel(wdt, CTRL, WDT_BIT(CTRL_EN) at32_wdt_start() 117 spin_unlock(&wdt->io_lock); at32_wdt_start() 125 spin_lock(&wdt->io_lock); at32_wdt_pat() 126 wdt_writel(wdt, CLR, 0x42); at32_wdt_pat() 127 spin_unlock(&wdt->io_lock); at32_wdt_pat() 135 if (test_and_set_bit(1, &wdt->users)) at32_wdt_open() 150 dev_dbg(wdt->miscdev.parent, at32_wdt_close() 154 clear_bit(1, &wdt->users); at32_wdt_close() 175 wdt->timeout = time; at32_wdt_settimeout() 187 rcause = wdt_readl(wdt, RCAUSE); at32_wdt_get_status() 233 ret = put_user(wdt->boot_status, p); at32_wdt_ioctl() 260 ret = put_user(wdt->timeout, p); at32_wdt_ioctl() 313 if (wdt) { at32_wdt_probe() 314 dev_dbg(&pdev->dev, "only 1 wdt instance supported.\n"); at32_wdt_probe() 324 wdt = devm_kzalloc(&pdev->dev, sizeof(struct wdt_at32ap700x), at32_wdt_probe() 326 if (!wdt) at32_wdt_probe() 329 wdt->regs = devm_ioremap(&pdev->dev, regs->start, resource_size(regs)); at32_wdt_probe() 330 if (!wdt->regs) { at32_wdt_probe() 336 spin_lock_init(&wdt->io_lock); at32_wdt_probe() 337 wdt->boot_status = at32_wdt_get_status(); at32_wdt_probe() 340 if (wdt->boot_status & WDIOF_CARDRESET) { at32_wdt_probe() 346 wdt->users = 0; at32_wdt_probe() 349 wdt->miscdev.minor = WATCHDOG_MINOR; at32_wdt_probe() 350 wdt->miscdev.name = "watchdog"; at32_wdt_probe() 351 wdt->miscdev.fops = &at32_wdt_fops; at32_wdt_probe() 352 wdt->miscdev.parent = &pdev->dev; at32_wdt_probe() 354 platform_set_drvdata(pdev, wdt); at32_wdt_probe() 363 ret = misc_register(&wdt->miscdev); at32_wdt_probe() 365 dev_dbg(&pdev->dev, "failed to register wdt miscdev\n"); at32_wdt_probe() 371 wdt->regs, wdt->timeout, nowayout); at32_wdt_probe() 376 wdt = NULL; at32_wdt_probe() 382 if (wdt && platform_get_drvdata(pdev) == wdt) { at32_wdt_remove() 387 misc_deregister(&wdt->miscdev); at32_wdt_remove() 388 wdt = NULL; at32_wdt_remove() 407 if (wdt->users) at32_wdt_resume()
|
H A D | tegra_wdt.c | 88 struct tegra_wdt *wdt = watchdog_get_drvdata(wdd); tegra_wdt_start() local 99 writel(val, wdt->tmr_regs + TIMER_PTV); tegra_wdt_start() 111 writel(val, wdt->wdt_regs + WDT_CFG); tegra_wdt_start() 113 writel(WDT_CMD_START_COUNTER, wdt->wdt_regs + WDT_CMD); tegra_wdt_start() 120 struct tegra_wdt *wdt = watchdog_get_drvdata(wdd); tegra_wdt_stop() local 122 writel(WDT_UNLOCK_PATTERN, wdt->wdt_regs + WDT_UNLOCK); tegra_wdt_stop() 123 writel(WDT_CMD_DISABLE_COUNTER, wdt->wdt_regs + WDT_CMD); tegra_wdt_stop() 124 writel(0, wdt->tmr_regs + TIMER_PTV); tegra_wdt_stop() 131 struct tegra_wdt *wdt = watchdog_get_drvdata(wdd); tegra_wdt_ping() local 133 writel(WDT_CMD_START_COUNTER, wdt->wdt_regs + WDT_CMD); tegra_wdt_ping() 151 struct tegra_wdt *wdt = watchdog_get_drvdata(wdd); tegra_wdt_get_timeleft() local 156 val = readl(wdt->wdt_regs + WDT_STS); tegra_wdt_get_timeleft() 191 struct tegra_wdt *wdt; tegra_wdt_probe() local 206 wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); tegra_wdt_probe() 207 if (!wdt) tegra_wdt_probe() 211 wdt->wdt_regs = regs + WDT_BASE; tegra_wdt_probe() 212 wdt->tmr_regs = regs + WDT_TIMER_BASE; tegra_wdt_probe() 215 wdd = &wdt->wdd; tegra_wdt_probe() 222 watchdog_set_drvdata(wdd, wdt); tegra_wdt_probe() 233 platform_set_drvdata(pdev, wdt); tegra_wdt_probe() 244 struct tegra_wdt *wdt = platform_get_drvdata(pdev); tegra_wdt_remove() local 246 tegra_wdt_stop(&wdt->wdd); tegra_wdt_remove() 248 watchdog_unregister_device(&wdt->wdd); tegra_wdt_remove() 250 dev_info(&pdev->dev, "removed wdt\n"); tegra_wdt_remove() 258 struct tegra_wdt *wdt = dev_get_drvdata(dev); tegra_wdt_runtime_suspend() local 260 if (watchdog_active(&wdt->wdd)) tegra_wdt_runtime_suspend() 261 tegra_wdt_stop(&wdt->wdd); tegra_wdt_runtime_suspend() 268 struct tegra_wdt *wdt = dev_get_drvdata(dev); tegra_wdt_runtime_resume() local 270 if (watchdog_active(&wdt->wdd)) tegra_wdt_runtime_resume() 271 tegra_wdt_start(&wdt->wdd); tegra_wdt_runtime_resume() 292 .name = "tegra-wdt",
|
H A D | mena21_wdt.c | 35 struct watchdog_device wdt; member in struct:a21_wdt_drv 56 static int a21_wdt_start(struct watchdog_device *wdt) a21_wdt_start() argument 58 struct a21_wdt_drv *drv = watchdog_get_drvdata(wdt); a21_wdt_start() 69 static int a21_wdt_stop(struct watchdog_device *wdt) a21_wdt_stop() argument 71 struct a21_wdt_drv *drv = watchdog_get_drvdata(wdt); a21_wdt_stop() 82 static int a21_wdt_ping(struct watchdog_device *wdt) a21_wdt_ping() argument 84 struct a21_wdt_drv *drv = watchdog_get_drvdata(wdt); a21_wdt_ping() 97 static int a21_wdt_set_timeout(struct watchdog_device *wdt, a21_wdt_set_timeout() argument 100 struct a21_wdt_drv *drv = watchdog_get_drvdata(wdt); a21_wdt_set_timeout() 103 dev_err(wdt->dev, "Only 1 and 30 allowed as timeout\n"); a21_wdt_set_timeout() 107 if (timeout == 30 && wdt->timeout == 1) { a21_wdt_set_timeout() 108 dev_err(wdt->dev, a21_wdt_set_timeout() 120 wdt->timeout = timeout; a21_wdt_set_timeout() 236 watchdog_unregister_device(&drv->wdt); a21_wdt_remove() 251 { .compatible = "men,a021-wdt" },
|
H A D | imgpdc_wdt.c | 64 struct pdc_wdt_dev *wdt = watchdog_get_drvdata(wdt_dev); pdc_wdt_keepalive() local 66 writel(PDC_WDT_TICKLE1_MAGIC, wdt->base + PDC_WDT_TICKLE1); pdc_wdt_keepalive() 67 writel(PDC_WDT_TICKLE2_MAGIC, wdt->base + PDC_WDT_TICKLE2); pdc_wdt_keepalive() 75 struct pdc_wdt_dev *wdt = watchdog_get_drvdata(wdt_dev); pdc_wdt_stop() local 77 val = readl(wdt->base + PDC_WDT_CONFIG); pdc_wdt_stop() 79 writel(val, wdt->base + PDC_WDT_CONFIG); pdc_wdt_stop() 91 struct pdc_wdt_dev *wdt = watchdog_get_drvdata(wdt_dev); pdc_wdt_set_timeout() local 92 unsigned long clk_rate = clk_get_rate(wdt->wdt_clk); pdc_wdt_set_timeout() 94 wdt->wdt_dev.timeout = new_timeout; pdc_wdt_set_timeout() 96 val = readl(wdt->base + PDC_WDT_CONFIG) & ~PDC_WDT_CONFIG_DELAY_MASK; pdc_wdt_set_timeout() 98 writel(val, wdt->base + PDC_WDT_CONFIG); pdc_wdt_set_timeout() 107 struct pdc_wdt_dev *wdt = watchdog_get_drvdata(wdt_dev); pdc_wdt_start() local 109 val = readl(wdt->base + PDC_WDT_CONFIG); pdc_wdt_start() 111 writel(val, wdt->base + PDC_WDT_CONFIG); pdc_wdt_start() 153 pdc_wdt->wdt_clk = devm_clk_get(&pdev->dev, "wdt"); pdc_wdt_probe() 155 dev_err(&pdev->dev, "failed to get the wdt clock\n"); pdc_wdt_probe() 167 dev_err(&pdev->dev, "could not prepare or enable wdt clock\n"); pdc_wdt_probe() 270 { .compatible = "img,pdc-wdt" }, 277 .name = "imgpdc-wdt",
|
H A D | xen_wdt.c | 14 #define DRV_NAME "wdt" 37 static struct sched_watchdog wdt; variable in typeref:struct:sched_watchdog 54 wdt.timeout = timeout; set_timeout() 66 if (!wdt.id) xen_wdt_start() 67 err = HYPERVISOR_sched_op(SCHEDOP_watchdog, &wdt); xen_wdt_start() 71 wdt.id = err; xen_wdt_start() 88 wdt.timeout = 0; xen_wdt_stop() 89 if (wdt.id) xen_wdt_stop() 90 err = HYPERVISOR_sched_op(SCHEDOP_watchdog, &wdt); xen_wdt_stop() 92 wdt.id = 0; xen_wdt_stop() 107 if (wdt.id) xen_wdt_kick() 108 err = HYPERVISOR_sched_op(SCHEDOP_watchdog, &wdt); xen_wdt_kick() 301 typeof(wdt.id) id = wdt.id; xen_wdt_suspend() 304 wdt.id = id; xen_wdt_suspend() 310 if (!wdt.id) xen_wdt_resume() 312 wdt.id = 0; xen_wdt_resume()
|
H A D | orion_wdt.c | 67 struct watchdog_device wdt; member in struct:orion_watchdog 456 .compatible = "marvell,orion-wdt", 460 .compatible = "marvell,armada-370-wdt", 464 .compatible = "marvell,armada-xp-wdt", 468 .compatible = "marvell,armada-375-wdt", 472 .compatible = "marvell,armada-380-wdt", 494 if (of_device_is_compatible(node, "marvell,orion-wdt")) { orion_wdt_get_regs() 501 } else if (of_device_is_compatible(node, "marvell,armada-370-wdt") || orion_wdt_get_regs() 502 of_device_is_compatible(node, "marvell,armada-xp-wdt")) { orion_wdt_get_regs() 510 } else if (of_device_is_compatible(node, "marvell,armada-375-wdt") || orion_wdt_get_regs() 511 of_device_is_compatible(node, "marvell,armada-380-wdt")) { orion_wdt_get_regs() 551 dev->wdt.info = &orion_wdt_info; orion_wdt_probe() 552 dev->wdt.ops = &orion_wdt_ops; orion_wdt_probe() 553 dev->wdt.min_timeout = 1; orion_wdt_probe() 568 dev->wdt.timeout = wdt_max_duration; orion_wdt_probe() 569 dev->wdt.max_timeout = wdt_max_duration; orion_wdt_probe() 570 watchdog_init_timeout(&dev->wdt, heartbeat, &pdev->dev); orion_wdt_probe() 572 platform_set_drvdata(pdev, &dev->wdt); orion_wdt_probe() 573 watchdog_set_drvdata(&dev->wdt, dev); orion_wdt_probe() 581 if (!orion_wdt_enabled(&dev->wdt)) orion_wdt_probe() 582 orion_wdt_stop(&dev->wdt); orion_wdt_probe() 599 watchdog_set_nowayout(&dev->wdt, nowayout); orion_wdt_probe() 600 ret = watchdog_register_device(&dev->wdt); orion_wdt_probe() 605 dev->wdt.timeout, nowayout ? ", nowayout" : ""); orion_wdt_probe()
|
H A D | of_xilinx_wdt.c | 173 rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-interval", xwdt_probe() 177 "Parameter \"xlnx,wdt-interval\" not found\n"); xwdt_probe() 179 rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-enable-once", xwdt_probe() 183 "Parameter \"xlnx,wdt-enable-once\" not found\n"); xwdt_probe() 188 * Twice of the 2^wdt_interval / freq because the first wdt overflow is xwdt_probe() 189 * ignored (interrupt), reset is only generated at second wdt overflow xwdt_probe() 229 { .compatible = "xlnx,xps-timebase-wdt-1.00.a", }, 230 { .compatible = "xlnx,xps-timebase-wdt-1.01.a", },
|
H A D | jz4740_wdt.c | 66 struct watchdog_device wdt; member in struct:jz4740_wdt_drvdata 171 jz4740_wdt = &drvdata->wdt; jz4740_wdt_probe() 194 ret = watchdog_register_device(&drvdata->wdt); jz4740_wdt_probe() 211 jz4740_wdt_stop(&drvdata->wdt); jz4740_wdt_remove() 212 watchdog_unregister_device(&drvdata->wdt); jz4740_wdt_remove() 222 .name = "jz4740-wdt", 232 MODULE_ALIAS("platform:jz4740-wdt");
|
H A D | Makefile | 20 obj-$(CONFIG_WDT) += wdt.o 62 obj-$(CONFIG_QCOM_WDT) += qcom-wdt.o 142 obj-$(CONFIG_OCTEON_WDT) += octeon-wdt.o 143 octeon-wdt-y := octeon-wdt-main.o octeon-wdt-nmi.o
|
H A D | ep93xx_wdt.c | 20 * wdt each ~200msec and eventually stop doing it if the user space 57 /* reset the wdt every ~200ms - the heartbeat of the device is 0.250 seconds*/ 159 .name = "ep93xx-wdt",
|
H A D | da9052_wdt.c | 32 struct watchdog_device wdt; member in struct:da9052_wdt_data 193 da9052_wdt = &driver_data->wdt; da9052_wdt_probe() 210 ret = watchdog_register_device(&driver_data->wdt); da9052_wdt_probe() 226 watchdog_unregister_device(&driver_data->wdt); da9052_wdt_remove()
|
H A D | da9055_wdt.c | 36 struct watchdog_device wdt; member in struct:da9055_wdt_data 159 da9055_wdt = &driver_data->wdt; da9055_wdt_probe() 177 ret = watchdog_register_device(&driver_data->wdt); da9055_wdt_probe() 190 watchdog_unregister_device(&driver_data->wdt); da9055_wdt_remove()
|
H A D | mtx-1_wdt.c | 77 /* toggle wdt gpio */ mtx1_wdt_trigger() 212 GPIOF_OUT_INIT_HIGH, "mtx1-wdt"); mtx1_wdt_probe() 250 .driver.name = "mtx1-wdt", 259 MODULE_ALIAS("platform:mtx1-wdt");
|
H A D | mpc8xxx_wdt.c | 199 * MPC8xxx, we should ping the wdt from the kernel until the mpc8xxx_wdt_probe() 230 .compatible = "fsl,mpc8610-wdt", 237 .compatible = "fsl,mpc823-wdt", 257 * We do wdt initialization in two steps: arch_initcall probes the wdt
|
H A D | davinci_wdt.c | 213 { .compatible = "ti,davinci-wdt", }, 220 .name = "davinci-wdt", 239 MODULE_ALIAS("platform:davinci-wdt");
|
H A D | lantiq_wdt.c | 7 * Based on EP93xx wdt driver 225 { .compatible = "lantiq,wdt" }, 234 .name = "wdt",
|
H A D | wm8350_wdt.c | 171 .name = "wm8350-wdt", 180 MODULE_ALIAS("platform:wm8350-wdt");
|
H A D | wm831x_wdt.c | 32 struct watchdog_device wdt; member in struct:wm831x_wdt_drvdata 214 wm831x_wdt = &driver_data->wdt; wm831x_wdt_probe() 275 ret = watchdog_register_device(&driver_data->wdt); wm831x_wdt_probe() 294 watchdog_unregister_device(&driver_data->wdt); wm831x_wdt_remove()
|
H A D | gpio_wdt.c | 257 { .compatible = "linux,wdt-gpio", }, 264 .name = "gpio-wdt",
|
H A D | mtk_wdt.c | 58 #define DRV_NAME "mtk-wdt" 225 { .compatible = "mediatek,mt6589-wdt" },
|
H A D | retu_wdt.c | 168 .name = "retu-wdt", 173 MODULE_ALIAS("platform:retu-wdt");
|
H A D | sirfsoc_wdt.c | 212 .name = "sirfsoc-wdt", 225 MODULE_ALIAS("platform:sirfsoc-wdt");
|
H A D | ath79_wdt.c | 39 #define DRIVER_NAME "ath79-wdt" 264 wdt_clk = devm_clk_get(&pdev->dev, "wdt"); ath79_wdt_probe() 317 { .compatible = "qca,ar7130-wdt" },
|
H A D | bcm63xx_wdt.c | 260 dev_err(&pdev->dev, "failed to register wdt timer isr\n"); bcm63xx_wdt_probe() 307 .name = "bcm63xx-wdt", 317 MODULE_ALIAS("platform:bcm63xx-wdt");
|
H A D | nuc900_wdt.c | 30 #define WTE (0x01 << 7) /*wdt enable*/ 299 .name = "nuc900-wdt", 308 MODULE_ALIAS("platform:nuc900-wdt");
|
H A D | rdc321x_wdt.c | 239 r = platform_get_resource_byname(pdev, IORESOURCE_IO, "wdt-reg"); rdc321x_wdt_probe() 241 dev_err(&pdev->dev, "failed to get wdt-reg resource\n"); rdc321x_wdt_probe() 290 .name = "rdc321x-wdt",
|
H A D | sbc8360.c | 7 * on acquirewdt.c which is based on wdt.c. 12 * is based on wdt.c. 16 * Based on acquirewdt.c which is based on wdt.c.
|
H A D | sunxi_wdt.c | 40 #define DRV_NAME "sunxi-wdt" 232 { .compatible = "allwinner,sun4i-a10-wdt", .data = &sun4i_wdt_reg }, 233 { .compatible = "allwinner,sun6i-a31-wdt", .data = &sun6i_wdt_reg },
|
H A D | moxart_wdt.c | 80 .identity = "moxart-wdt",
|
H A D | rt2880_wdt.c | 189 { .compatible = "ralink,rt2880-wdt" },
|
H A D | ib700wdt.c | 7 * is based on wdt.c. 11 * Based on acquirewdt.c which is based on wdt.c.
|
H A D | meson_wdt.c | 208 { .compatible = "amlogic,meson6-wdt" },
|
H A D | pnx4008_wdt.c | 201 { .compatible = "nxp,pnx4008-wdt" },
|
H A D | softdog.c | 24 * NB: uses same minor as wdt (WATCHDOG_MINOR); we could use separate
|
H A D | imx2_wdt.c | 40 #define DRIVER_NAME "imx2-wdt" 398 { .compatible = "fsl,imx21-wdt", },
|
H A D | pc87413_wdt.c | 2 * NS pc87413-wdt Watchdog Timer driver for Linux 2.6.x.x 4 * This code is based on wdt.c with original copyright.
|
H A D | acquirewdt.c | 4 * Based on wdt.c. Original copyright messages:
|
H A D | advantechwdt.c | 6 * Based on acquirewdt.c which is based on wdt.c.
|
H A D | at91rm9200_wdt.c | 305 { .compatible = "atmel,at91rm9200-wdt" },
|
H A D | booke_wdt.c | 25 /* If the kernel parameter wdt=1, the watchdog will be enabled at boot.
|
H A D | dw_wdt.c | 388 { .compatible = "snps,dw-wdt", },
|
H A D | gef_wdt.c | 302 .compatible = "gef,fpga-wdt",
|
H A D | omap_wdt.c | 351 { .compatible = "ti,omap3-wdt", },
|
H A D | via_wdt.c | 201 dev_err(&pdev->dev, "cannot remap VIA wdt MMIO registers\n"); wdt_probe()
|
H A D | wafer5823wdt.c | 10 * Based on advantechwdt.c which is based on wdt.c.
|
H A D | bfin_wdt.c | 34 #define WATCHDOG_NAME "bfin-wdt"
|
H A D | eurotechwdt.c | 8 * Based on wdt.c.
|
H A D | sc1200wdt.c | 5 * Based on wdt.c and wdt977.c by Alan Cox and Woody Suwalski respectively.
|
H A D | w83627hf_wdt.c | 12 * Based on advantechwdt.c which is based on wdt.c.
|
H A D | kempld_wdt.c | 565 .name = "kempld-wdt",
|
H A D | octeon-wdt-main.c | 8 * Some parts derived from wdt.c
|
H A D | smsc37b787_wdt.c | 43 * Documentation/watchdog/wdt.txt
|
H A D | wdt.c | 25 * Alan Cox : Added wdt= boot option
|
H A D | wdt_pci.c | 25 * Alan Cox : Added wdt= boot option
|
/linux-4.1.27/include/linux/ |
H A D | bcm47xx_wdt.h | 25 static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt) bcm47xx_wdt_get_drvdata() argument 27 return wdt->driver_data; bcm47xx_wdt_get_drvdata()
|
/linux-4.1.27/arch/mn10300/kernel/ |
H A D | mn10300-watchdog.c | 106 u8 wdt; watchdog_go() local 110 wdt = WDCTR & ~WDCTR_WDCNE; watchdog_go() 111 WDCTR = wdt | WDCTR_WDRST; watchdog_go() 112 wdt = WDCTR; watchdog_go() 113 WDCTR = wdt | WDCTR_WDCNE; watchdog_go() 114 wdt = WDCTR; watchdog_go() 137 u8 wdt, tmp; watchdog_interrupt() local 139 wdt = WDCTR & ~WDCTR_WDCNE; watchdog_interrupt() 140 WDCTR = wdt; watchdog_interrupt() 201 WDCTR = wdt | WDCTR_WDRST; 203 WDCTR = wdt | WDCTR_WDCNE;
|
/linux-4.1.27/include/linux/mfd/wm8350/ |
H A D | wdt.h | 2 * wdt.h -- Watchdog Driver for Wolfson WM8350 PMIC
|
H A D | core.h | 27 #include <linux/mfd/wm8350/wdt.h> 621 struct wm8350_wdt wdt; member in struct:wm8350
|
/linux-4.1.27/drivers/ssb/ |
H A D | embedded.c | 39 struct bcm47xx_wdt wdt = {}; ssb_watchdog_register() local 43 wdt.driver_data = &bus->chipco; ssb_watchdog_register() 44 wdt.timer_set = ssb_chipco_watchdog_timer_set_wdt; ssb_watchdog_register() 45 wdt.timer_set_ms = ssb_chipco_watchdog_timer_set_ms; ssb_watchdog_register() 46 wdt.max_timer_ms = bus->chipco.max_timer_ms; ssb_watchdog_register() 48 wdt.driver_data = &bus->extif; ssb_watchdog_register() 49 wdt.timer_set = ssb_extif_watchdog_timer_set_wdt; ssb_watchdog_register() 50 wdt.timer_set_ms = ssb_extif_watchdog_timer_set_ms; ssb_watchdog_register() 51 wdt.max_timer_ms = SSB_EXTIF_WATCHDOG_MAX_TIMER_MS; ssb_watchdog_register() 56 pdev = platform_device_register_data(NULL, "bcm47xx-wdt", ssb_watchdog_register() 57 bus->busnumber, &wdt, ssb_watchdog_register() 58 sizeof(wdt)); ssb_watchdog_register()
|
H A D | driver_extif.c | 115 u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, u32 ticks) ssb_extif_watchdog_timer_set_wdt() argument 117 struct ssb_extif *extif = bcm47xx_wdt_get_drvdata(wdt); ssb_extif_watchdog_timer_set_wdt() 122 u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms) ssb_extif_watchdog_timer_set_ms() argument 124 struct ssb_extif *extif = bcm47xx_wdt_get_drvdata(wdt); ssb_extif_watchdog_timer_set_ms()
|
H A D | ssb_private.h | 227 extern u32 ssb_chipco_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, 229 extern u32 ssb_chipco_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms); 251 extern u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, u32 ticks); 252 extern u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms); 254 static inline u32 ssb_extif_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, ssb_extif_watchdog_timer_set_wdt() argument 259 static inline u32 ssb_extif_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, ssb_extif_watchdog_timer_set_ms() argument
|
H A D | driver_chipcommon.c | 311 u32 ssb_chipco_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, u32 ticks) ssb_chipco_watchdog_timer_set_wdt() argument 313 struct ssb_chipcommon *cc = bcm47xx_wdt_get_drvdata(wdt); ssb_chipco_watchdog_timer_set_wdt() 321 u32 ssb_chipco_watchdog_timer_set_ms(struct bcm47xx_wdt *wdt, u32 ms) ssb_chipco_watchdog_timer_set_ms() argument 323 struct ssb_chipcommon *cc = bcm47xx_wdt_get_drvdata(wdt); ssb_chipco_watchdog_timer_set_ms()
|
/linux-4.1.27/drivers/bcma/ |
H A D | driver_chipcommon.c | 58 static u32 bcma_chipco_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt, bcma_chipco_watchdog_timer_set_wdt() argument 61 struct bcma_drv_cc *cc = bcm47xx_wdt_get_drvdata(wdt); bcma_chipco_watchdog_timer_set_wdt() 66 static u32 bcma_chipco_watchdog_timer_set_ms_wdt(struct bcm47xx_wdt *wdt, bcma_chipco_watchdog_timer_set_ms_wdt() argument 69 struct bcma_drv_cc *cc = bcm47xx_wdt_get_drvdata(wdt); bcma_chipco_watchdog_timer_set_ms_wdt() 96 struct bcm47xx_wdt wdt = {}; bcma_chipco_watchdog_register() local 99 wdt.driver_data = cc; bcma_chipco_watchdog_register() 100 wdt.timer_set = bcma_chipco_watchdog_timer_set_wdt; bcma_chipco_watchdog_register() 101 wdt.timer_set_ms = bcma_chipco_watchdog_timer_set_ms_wdt; bcma_chipco_watchdog_register() 102 wdt.max_timer_ms = bcma_chipco_watchdog_register() 105 pdev = platform_device_register_data(NULL, "bcm47xx-wdt", bcma_chipco_watchdog_register() 106 cc->core->bus->num, &wdt, bcma_chipco_watchdog_register() 107 sizeof(wdt)); bcma_chipco_watchdog_register()
|
/linux-4.1.27/arch/arm/mach-bcm/ |
H A D | board_bcm281xx.c | 36 np_wdog = of_find_compatible_node(NULL, NULL, "brcm,kona-wdt"); bcm281xx_restart() 38 pr_emerg("Couldn't find brcm,kona-wdt\n"); bcm281xx_restart() 43 pr_emerg("Couldn't map brcm,kona-wdt\n"); bcm281xx_restart()
|
H A D | board_bcm2835.c | 47 "brcm,bcm2835-pm-wdt"); bcm2835_setup_restart()
|
/linux-4.1.27/arch/mips/bcm63xx/ |
H A D | dev-wdt.c | 23 .name = "bcm63xx-wdt",
|
/linux-4.1.27/drivers/power/reset/ |
H A D | keystone-reset.c | 130 /* enable a reset for watchdogs from wdt-list */ rsctrl_probe() 132 ret = of_property_read_u32_index(np, "ti,wdt-list", i, &val); rsctrl_probe() 134 dev_err(dev, "ti,wdt-list property has to contain at" rsctrl_probe() 142 dev_err(dev, "ti,wdt-list property can contain" rsctrl_probe()
|
/linux-4.1.27/arch/arm/plat-samsung/ |
H A D | watchdog-reset.c | 37 pr_err("%s: wdt reset not initialized\n", __func__); samsung_wdt_reset() 69 { .compatible = "samsung,s3c2410-wdt" },
|
H A D | devs.c | 1093 .name = "s3c2410-wdt",
|
/linux-4.1.27/arch/arm/mach-davinci/ |
H A D | da8xx-dt.c | 35 OF_DEV_AUXDATA("ti,davinci-wdt", 0x01c21000, "davinci-wdt", NULL),
|
H A D | devices-da8xx.c | 361 .name = "davinci-wdt", 371 dev = bus_find_device_by_name(&platform_bus_type, NULL, "davinci-wdt"); da8xx_restart()
|
H A D | devices.c | 305 .name = "davinci-wdt",
|
H A D | dm644x.c | 325 CLK("davinci-wdt", NULL, &timer2_clk),
|
H A D | dm646x.c | 359 CLK("davinci-wdt", NULL, &timer2_clk),
|
H A D | dm355.c | 378 CLK("davinci-wdt", NULL, &timer2_clk),
|
H A D | da830.c | 388 CLK("davinci-wdt", NULL, &timerp64_1_clk),
|
H A D | da850.c | 446 CLK("davinci-wdt", NULL, &timerp64_1_clk),
|
H A D | dm365.c | 476 CLK("davinci-wdt", NULL, &timer2_clk),
|
/linux-4.1.27/arch/powerpc/platforms/52xx/ |
H A D | mpc52xx_gpt.c | 21 * The timer gpt0 can be used as watchdog (wdt). If the wdt mode is used, 23 * -EBUSY). Thus, the safety wdt function always has precedence over the gpt 25 * this means that gpt0 is locked in wdt mode until the next reboot - this 86 * if the gpt may be used as wdt, bit 1 (MPC52xx_GPT_IS_WDT) indicates 87 * if the timer is actively used as wdt which blocks gpt functions 443 /* Set and enable the timer, reject an attempt to use a wdt as gpt */ mpc52xx_gpt_do_start() 477 * Returns an error if attempting to stop a wdt 532 /* wdt-capable gpt */ 535 /* low-level wdt functions */ mpc52xx_gpt_wdt_ping() 545 /* wdt misc device api */ mpc52xx_wdt_write() 641 /* note: releasing the wdt in NOWAYOUT-mode does not stop it */ mpc52xx_wdt_release() 690 /* remember the gpt for the wdt operation */ mpc52xx_gpt_wdt_setup() 693 /* configure the wdt if the device tree contained a timeout */ mpc52xx_gpt_wdt_setup() 699 dev_warn(gpt->dev, "starting as wdt failed\n"); mpc52xx_gpt_wdt_setup() 750 if (of_get_property(ofdev->dev.of_node, "fsl,has-wdt", NULL) || mpc52xx_gpt_probe() 751 of_get_property(ofdev->dev.of_node, "has-wdt", NULL)) { mpc52xx_gpt_probe() 756 "fsl,wdt-on-boot", NULL); mpc52xx_gpt_probe()
|
H A D | mpc52xx_common.c | 140 * possibly from a interrupt context. wdt is only implement mpc52xx_map_common_devices() 141 * on a gpt0, so check has-wdt property before mapping. mpc52xx_map_common_devices() 144 if (of_get_property(np, "fsl,has-wdt", NULL) || for_each_matching_node() 145 of_get_property(np, "has-wdt", NULL)) { for_each_matching_node() 259 "mpc52xx_restart: Can't access wdt. " mpc52xx_restart()
|
H A D | mpc5200_simple.c | 19 * - if the 'fsl,has-wdt' property is present in one of the
|
/linux-4.1.27/arch/mips/include/asm/mach-loongson1/ |
H A D | loongson1.h | 48 #include <regs-wdt.h>
|
/linux-4.1.27/arch/arm/mach-imx/devices/ |
H A D | Makefile | 10 obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o
|
H A D | platform-imx2-wdt.c | 53 return imx_add_platform_device("imx2-wdt", data->id, imx_add_imx2_wdt()
|
/linux-4.1.27/drivers/mfd/ |
H A D | rdc321x-southbridge.c | 33 .name = "wdt-reg", 60 .name = "rdc321x-wdt",
|
H A D | rn5t618.c | 22 { .name = "rn5t618-wdt" },
|
H A D | wm8350-core.c | 32 #include <linux/mfd/wm8350/wdt.h> 434 wm8350_client_dev_register(wm8350, "wm8350-wdt", &(wm8350->wdt.pdev)); wm8350_device_init() 455 platform_device_unregister(wm8350->wdt.pdev); wm8350_device_exit()
|
H A D | as3722.c | 78 .name = "as3722-wdt",
|
H A D | retu-mfd.c | 59 .name = "retu-wdt"
|
H A D | wm8350-irq.c | 29 #include <linux/mfd/wm8350/wdt.h>
|
H A D | kempld-core.c | 95 .name = "kempld-wdt",
|
/linux-4.1.27/arch/mips/ath79/ |
H A D | clock.c | 82 clk_add_alias("wdt", NULL, "ahb", NULL); ar71xx_clocks_init() 118 clk_add_alias("wdt", NULL, "ahb", NULL); ar724x_clocks_init() 151 clk_add_alias("wdt", NULL, "ahb", NULL); ar913x_clocks_init() 213 clk_add_alias("wdt", NULL, "ahb", NULL); ar933x_clocks_init() 347 clk_add_alias("wdt", NULL, "ref", NULL); ar934x_clocks_init() 434 clk_add_alias("wdt", NULL, "ref", NULL); qca955x_clocks_init()
|
H A D | dev-common.c | 107 platform_device_register_simple("ath79-wdt", -1, &res, 1); ath79_register_wdt()
|
/linux-4.1.27/arch/arm/mach-orion5x/ |
H A D | board-dt.c | 34 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL),
|
/linux-4.1.27/arch/mips/ralink/ |
H A D | mt7620.c | 66 FUNC("wdt rst", 0, 17, 1), 67 FUNC("wdt refclk", 0, 17, 1), 84 GRP_G("wdt", wdt_grp, MT7620_GPIO_MODE_WDT_MASK, 137 static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 15, 38) }; 213 GRP("wdt", wdt_grp_mt7628, 1, MT7628_GPIO_MODE_WDT),
|
/linux-4.1.27/arch/mips/alchemy/ |
H A D | board-gpr.c | 111 .name = "gpr-adm6320-wdt", 117 .name = "adm6320-wdt",
|
H A D | board-mtx1.c | 135 .name = "mtx1-wdt-gpio", 141 .name = "mtx1-wdt",
|
/linux-4.1.27/arch/arm/mach-w90x900/ |
H A D | cpu.c | 70 static DEFINE_CLK(wdt, 26); 97 DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL),
|
H A D | dev.c | 285 .name = "nuc900-wdt",
|
/linux-4.1.27/arch/sh/boards/mach-hp6xx/ |
H A D | pm.c | 48 /* set wdt */ pm_enter()
|
/linux-4.1.27/arch/arm/mach-imx/ |
H A D | system.c | 85 wdog_clk = clk_get_sys("imx2-wdt.0", NULL); mxc_arch_reset_init()
|
H A D | clk-imx21.c | 152 clk_register_clkdev(clk[IMX21_CLK_WDOG_GATE], NULL, "imx2-wdt.0"); mx21_clocks_init()
|
H A D | clk-imx27.c | 222 clk_register_clkdev(clk[IMX27_CLK_WDOG_IPG_GATE], NULL, "imx2-wdt.0"); mx27_clocks_init()
|
H A D | clk-imx31.c | 132 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0"); mx31_clocks_init()
|
H A D | mach-mx31moboard.c | 505 struct clk *clk = clk_get_sys("imx2-wdt.0", NULL); mx31moboard_poweroff()
|
H A D | clk-imx25.c | 222 /* CCM_CGCR2(19): reserved in datasheet, but used as wdt in FSL kernel */ __mx25_clocks_init()
|
H A D | clk-imx35.c | 255 clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0"); mx35_clocks_init()
|
H A D | clk-vf610.c | 281 clk[VF610_CLK_WDT] = imx_clk_gate2("wdt", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(14)); vf610_clocks_init()
|
/linux-4.1.27/arch/um/drivers/ |
H A D | harddog_kern.c | 25 * NB: uses same minor as wdt (WATCHDOG_MINOR); we could use separate
|
/linux-4.1.27/arch/mips/jz4740/ |
H A D | platform.c | 328 .name = "jz4740-wdt",
|
/linux-4.1.27/arch/blackfin/kernel/ |
H A D | nmi.c | 25 #define DRV_NAME "nmi-wdt"
|
/linux-4.1.27/arch/arm/mach-omap2/ |
H A D | prm.h | 95 * shifts, it's purely coincidental. Used by omap-wdt.c.
|
/linux-4.1.27/arch/arm/mach-ep93xx/ |
H A D | ts72xx.c | 223 .name = "ts72xx-wdt",
|
H A D | core.c | 829 .name = "ep93xx-wdt",
|
/linux-4.1.27/arch/powerpc/sysdev/ |
H A D | mv64x60_dev.c | 418 pdata.bus_clk = *prop / 1000000; /* wdt driver wants freq in MHz */ mv64x60_wdt_device_setup() 493 np = of_find_compatible_node(np, NULL, "marvell,mv64360-wdt");
|
/linux-4.1.27/drivers/iio/common/ssp_sensors/ |
H A D | ssp.h | 186 * @enable_refcount: enable reference count for wdt (watchdog timer)
|
/linux-4.1.27/drivers/clk/samsung/ |
H A D | clk-s3c2412.c | 156 GATE(PCLK_WDT, "wdt", "pclk", CLKCON, 28, 0, 0),
|
H A D | clk-s3c2443.c | 180 GATE(PCLK_WDT, "wdt", "pclk", PCLKCON, 11, 0, 0),
|
H A D | clk-exynos5250.c | 660 GATE(CLK_WDT, "wdt", "div_aclk66", GATE_IP_PERIS, 19, 0, 0),
|
H A D | clk-exynos3250.c | 471 GATE(CLK_WDT, "wdt", "div_aclk_100", GATE_IP_PERIR, 14, 0, 0),
|
H A D | clk-exynos4415.c | 643 GATE(CLK_WDT, "wdt", "div_aclk_100", GATE_IP_PERIR, 14, 0, 0),
|
H A D | clk-exynos5420.c | 1101 GATE(CLK_WDT, "wdt", "aclk66_psgen", GATE_IP_PERIS, 19, 0, 0),
|
/linux-4.1.27/drivers/char/ |
H A D | ds1620.c | 226 /* convert to Fahrenheit, as per wdt.c */ ds1620_read()
|
/linux-4.1.27/drivers/clk/ |
H A D | clk-asm9260.c | 198 { CLKID_AHB_WDT, "wdt", "ahb_div",
|
/linux-4.1.27/arch/mips/ath25/ |
H A D | ar5312_regs.h | 117 #define AR5312_RESET_WDOG 0x00100000 /* last reset was a wdt */
|
H A D | ar2315_regs.h | 220 #define AR2315_AHB_ERROR_WDT 4 /* AHB Error due to wdt instead of hresp */
|
/linux-4.1.27/arch/sh/kernel/cpu/sh4a/ |
H A D | clock-sh7722.c | 209 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
|
H A D | clock-sh7723.c | 240 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
|
H A D | clock-sh7724.c | 311 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
|
/linux-4.1.27/drivers/clk/spear/ |
H A D | spear6xx_clock.c | 153 clk_register_clkdev(clk, NULL, "wdt"); spear6xx_clk_init()
|
H A D | spear3xx_clock.c | 414 clk_register_clkdev(clk, NULL, "fc880000.wdt"); spear3xx_clk_init()
|
H A D | spear1310_clock.c | 502 clk_register_clkdev(clk, NULL, "ec800620.wdt"); spear1310_clk_init()
|
H A D | spear1340_clock.c | 579 clk_register_clkdev(clk, NULL, "ec800620.wdt"); spear1340_clk_init()
|