Lines Matching +full:half +full:- +full:period

1 // SPDX-License-Identifier: GPL-2.0
4 * This is a 12-bit timer driver from a (62.5/16384) MHz clock. It can't even
56 writel(0, wdt->base + RZN1_WDT_RETRIGGER); in rzn1_wdt_ping()
69 * timeout once started. Also note that the WDT clock is half the bus in rzn1_wdt_start()
76 val |= compute_reload_value(w->max_hw_heartbeat_ms, wdt->clk_rate_khz); in rzn1_wdt_start()
77 writel(val, wdt->base + RZN1_WDT_RETRIGGER); in rzn1_wdt_start()
103 struct device *dev = &pdev->dev; in rzn1_wdt_probe()
105 struct device_node *np = dev->of_node; in rzn1_wdt_probe()
113 return -ENOMEM; in rzn1_wdt_probe()
115 wdt->base = devm_platform_ioremap_resource(pdev, 0); in rzn1_wdt_probe()
116 if (IS_ERR(wdt->base)) in rzn1_wdt_probe()
117 return PTR_ERR(wdt->base); in rzn1_wdt_probe()
124 np->name, wdt); in rzn1_wdt_probe()
139 return -EINVAL; in rzn1_wdt_probe()
142 wdt->clk_rate_khz = clk_rate / 1000; in rzn1_wdt_probe()
143 wdt->wdtdev.info = &rzn1_wdt_info; in rzn1_wdt_probe()
144 wdt->wdtdev.ops = &rzn1_wdt_ops; in rzn1_wdt_probe()
145 wdt->wdtdev.status = WATCHDOG_NOWAYOUT_INIT_STATUS; in rzn1_wdt_probe()
146 wdt->wdtdev.parent = dev; in rzn1_wdt_probe()
148 * The period of the watchdog cannot be changed once set in rzn1_wdt_probe()
149 * and is limited to a very short period. in rzn1_wdt_probe()
150 * Configure it for a 1s period once and for all, and in rzn1_wdt_probe()
151 * rely on the heart-beat provided by the watchdog core in rzn1_wdt_probe()
152 * to make this usable by the user-space. in rzn1_wdt_probe()
154 wdt->wdtdev.max_hw_heartbeat_ms = max_heart_beat_ms(wdt->clk_rate_khz); in rzn1_wdt_probe()
155 if (wdt->wdtdev.max_hw_heartbeat_ms > 1000) in rzn1_wdt_probe()
156 wdt->wdtdev.max_hw_heartbeat_ms = 1000; in rzn1_wdt_probe()
158 wdt->wdtdev.timeout = DEFAULT_TIMEOUT; in rzn1_wdt_probe()
159 ret = watchdog_init_timeout(&wdt->wdtdev, 0, dev); in rzn1_wdt_probe()
163 watchdog_set_drvdata(&wdt->wdtdev, wdt); in rzn1_wdt_probe()
165 return devm_watchdog_register_device(dev, &wdt->wdtdev); in rzn1_wdt_probe()
170 { .compatible = "renesas,rzn1-wdt" },