Lines Matching +full:timeout +full:- +full:secs

1 // SPDX-License-Identifier: GPL-2.0-or-later
19 #include <asm/mach-pic32/pic32.h>
46 return !!(readl(wdt->regs + WDTCON_REG) & WDTCON_WIN_EN); in pic32_wdt_is_win_enabled()
51 u32 v = readl(wdt->regs + WDTCON_REG); in pic32_wdt_get_post_scaler()
58 u32 v = readl(wdt->regs + WDTCON_REG); in pic32_wdt_get_clk_id()
65 u32 v = readl(wdt->rst_base); in pic32_wdt_bootstatus()
67 writel(RESETCON_WDT_TIMEOUT, PIC32_CLR(wdt->rst_base)); in pic32_wdt_bootstatus()
77 rate = clk_get_rate(wdt->clk); in pic32_wdt_get_timeout_secs()
82 /* default, prescaler of 32 (i.e. div-by-32) is implicit. */ in pic32_wdt_get_timeout_secs()
91 /* find time taken (in secs) to reach terminal count */ in pic32_wdt_get_timeout_secs()
94 "wdt: clk_rate %lu (postscale) / terminal %d, timeout %dsec\n", in pic32_wdt_get_timeout_secs()
102 /* write key through single half-word */ in pic32_wdt_keepalive()
103 writew(WDTCON_CLR_KEY, wdt->regs + WDTCON_REG + 2); in pic32_wdt_keepalive()
110 writel(WDTCON_ON, PIC32_SET(wdt->regs + WDTCON_REG)); in pic32_wdt_start()
120 writel(WDTCON_ON, PIC32_CLR(wdt->regs + WDTCON_REG)); in pic32_wdt_stop()
159 { .compatible = "microchip,pic32mzda-wdt", },
166 struct device *dev = &pdev->dev; in pic32_wdt_drv_probe()
173 return -ENOMEM; in pic32_wdt_drv_probe()
175 wdt->regs = devm_platform_ioremap_resource(pdev, 0); in pic32_wdt_drv_probe()
176 if (IS_ERR(wdt->regs)) in pic32_wdt_drv_probe()
177 return PTR_ERR(wdt->regs); in pic32_wdt_drv_probe()
179 wdt->rst_base = devm_ioremap(dev, PIC32_BASE_RESET, 0x10); in pic32_wdt_drv_probe()
180 if (!wdt->rst_base) in pic32_wdt_drv_probe()
181 return -ENOMEM; in pic32_wdt_drv_probe()
183 wdt->clk = devm_clk_get_enabled(dev, NULL); in pic32_wdt_drv_probe()
184 if (IS_ERR(wdt->clk)) { in pic32_wdt_drv_probe()
186 return PTR_ERR(wdt->clk); in pic32_wdt_drv_probe()
190 dev_err(dev, "windowed-clear mode is not supported.\n"); in pic32_wdt_drv_probe()
191 return -ENODEV; in pic32_wdt_drv_probe()
194 wdd->timeout = pic32_wdt_get_timeout_secs(wdt, dev); in pic32_wdt_drv_probe()
195 if (!wdd->timeout) { in pic32_wdt_drv_probe()
196 dev_err(dev, "failed to read watchdog register timeout\n"); in pic32_wdt_drv_probe()
197 return -EINVAL; in pic32_wdt_drv_probe()
200 dev_info(dev, "timeout %d\n", wdd->timeout); in pic32_wdt_drv_probe()
202 wdd->bootstatus = pic32_wdt_bootstatus(wdt) ? WDIOF_CARDRESET : 0; in pic32_wdt_drv_probe()
219 .name = "pic32-wdt",