Lines Matching +full:visconti +full:- +full:wdt

1 // SPDX-License-Identifier: GPL-2.0
43 u32 timeout = wdev->timeout * VISCONTI_WDT_FREQ; in visconti_wdt_start()
45 writel(priv->div, priv->base + WDT_DIV); in visconti_wdt_start()
46 writel(0, priv->base + WDT_MIN); in visconti_wdt_start()
47 writel(timeout, priv->base + WDT_MAX); in visconti_wdt_start()
48 writel(0, priv->base + WDT_CTL); in visconti_wdt_start()
49 writel(WDT_CMD_START_STOP, priv->base + WDT_CMD); in visconti_wdt_start()
58 writel(1, priv->base + WDT_CTL); in visconti_wdt_stop()
59 writel(WDT_CMD_START_STOP, priv->base + WDT_CMD); in visconti_wdt_stop()
68 writel(WDT_CMD_CLEAR, priv->base + WDT_CMD); in visconti_wdt_ping()
76 u32 timeout = wdev->timeout * VISCONTI_WDT_FREQ; in visconti_wdt_get_timeleft()
77 u32 cnt = readl(priv->base + WDT_CNT); in visconti_wdt_get_timeleft()
81 timeout -= cnt; in visconti_wdt_get_timeleft()
91 wdev->timeout = timeout; in visconti_wdt_set_timeout()
92 val = wdev->timeout * VISCONTI_WDT_FREQ; in visconti_wdt_set_timeout()
94 /* Clear counter before setting timeout because WDT expires */ in visconti_wdt_set_timeout()
95 writel(WDT_CMD_CLEAR, priv->base + WDT_CMD); in visconti_wdt_set_timeout()
96 writel(val, priv->base + WDT_MAX); in visconti_wdt_set_timeout()
103 .identity = "Visconti Watchdog",
119 struct device *dev = &pdev->dev; in visconti_wdt_probe()
126 return -ENOMEM; in visconti_wdt_probe()
128 priv->base = devm_platform_ioremap_resource(pdev, 0); in visconti_wdt_probe()
129 if (IS_ERR(priv->base)) in visconti_wdt_probe()
130 return PTR_ERR(priv->base); in visconti_wdt_probe()
138 return -EINVAL; in visconti_wdt_probe()
140 priv->div = clk_freq / VISCONTI_WDT_FREQ; in visconti_wdt_probe()
143 wdev = &priv->wdev; in visconti_wdt_probe()
144 wdev->info = &visconti_wdt_info; in visconti_wdt_probe()
145 wdev->ops = &visconti_wdt_ops; in visconti_wdt_probe()
146 wdev->parent = dev; in visconti_wdt_probe()
147 wdev->min_timeout = 1; in visconti_wdt_probe()
148 wdev->max_timeout = 0xffffffff / VISCONTI_WDT_FREQ; in visconti_wdt_probe()
149 wdev->timeout = min(wdev->max_timeout, WDT_DEFAULT_TIMEOUT); in visconti_wdt_probe()
164 { .compatible = "toshiba,visconti-wdt", },
178 MODULE_DESCRIPTION("TOSHIBA Visconti Watchdog Driver");