Lines Matching +full:rtd1295 +full:- +full:watchdog

1 // SPDX-License-Identifier: GPL-2.0+
3 * Realtek RTD129x watchdog
15 #include <linux/watchdog.h>
38 val = readl_relaxed(data->base + RTD119X_TCWCR); in rtd119x_wdt_start()
41 writel(val, data->base + RTD119X_TCWCR); in rtd119x_wdt_start()
51 val = readl_relaxed(data->base + RTD119X_TCWCR); in rtd119x_wdt_stop()
54 writel(val, data->base + RTD119X_TCWCR); in rtd119x_wdt_stop()
63 writel_relaxed(RTD119X_TCWTR_WDCLR, data->base + RTD119X_TCWTR); in rtd119x_wdt_ping()
72 writel(val * clk_get_rate(data->clk), data->base + RTD119X_TCWOV); in rtd119x_wdt_set_timeout()
74 data->wdt_dev.timeout = val; in rtd119x_wdt_set_timeout()
88 .identity = "rtd119x-wdt",
93 { .compatible = "realtek,rtd1295-watchdog" },
99 struct device *dev = &pdev->dev; in rtd119x_wdt_probe()
104 return -ENOMEM; in rtd119x_wdt_probe()
106 data->base = devm_platform_ioremap_resource(pdev, 0); in rtd119x_wdt_probe()
107 if (IS_ERR(data->base)) in rtd119x_wdt_probe()
108 return PTR_ERR(data->base); in rtd119x_wdt_probe()
110 data->clk = devm_clk_get_enabled(dev, NULL); in rtd119x_wdt_probe()
111 if (IS_ERR(data->clk)) in rtd119x_wdt_probe()
112 return PTR_ERR(data->clk); in rtd119x_wdt_probe()
114 data->wdt_dev.info = &rtd119x_wdt_info; in rtd119x_wdt_probe()
115 data->wdt_dev.ops = &rtd119x_wdt_ops; in rtd119x_wdt_probe()
116 data->wdt_dev.timeout = 120; in rtd119x_wdt_probe()
117 data->wdt_dev.max_timeout = 0xffffffff / clk_get_rate(data->clk); in rtd119x_wdt_probe()
118 data->wdt_dev.min_timeout = 1; in rtd119x_wdt_probe()
119 data->wdt_dev.parent = dev; in rtd119x_wdt_probe()
121 watchdog_stop_on_reboot(&data->wdt_dev); in rtd119x_wdt_probe()
122 watchdog_set_drvdata(&data->wdt_dev, data); in rtd119x_wdt_probe()
125 writel_relaxed(RTD119X_TCWTR_WDCLR, data->base + RTD119X_TCWTR); in rtd119x_wdt_probe()
126 rtd119x_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout); in rtd119x_wdt_probe()
127 rtd119x_wdt_stop(&data->wdt_dev); in rtd119x_wdt_probe()
129 return devm_watchdog_register_device(dev, &data->wdt_dev); in rtd119x_wdt_probe()
135 .name = "rtd1295-watchdog",