Lines Matching refs:meson_wdt

64 	struct meson_wdt_dev *meson_wdt = watchdog_get_drvdata(wdt_dev);  in meson_wdt_restart()  local
67 tc_reboot |= meson_wdt->data->enable; in meson_wdt_restart()
70 writel(tc_reboot, meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_restart()
79 struct meson_wdt_dev *meson_wdt = watchdog_get_drvdata(wdt_dev); in meson_wdt_ping() local
81 writel(0, meson_wdt->wdt_base + MESON_WDT_RESET); in meson_wdt_ping()
89 struct meson_wdt_dev *meson_wdt = watchdog_get_drvdata(wdt_dev); in meson_wdt_change_timeout() local
92 reg = readl(meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_change_timeout()
93 reg &= ~meson_wdt->data->terminal_count_mask; in meson_wdt_change_timeout()
94 reg |= MESON_SEC_TO_TC(timeout, meson_wdt->data->count_unit); in meson_wdt_change_timeout()
95 writel(reg, meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_change_timeout()
111 struct meson_wdt_dev *meson_wdt = watchdog_get_drvdata(wdt_dev); in meson_wdt_stop() local
114 reg = readl(meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_stop()
115 reg &= ~meson_wdt->data->enable; in meson_wdt_stop()
116 writel(reg, meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_stop()
123 struct meson_wdt_dev *meson_wdt = watchdog_get_drvdata(wdt_dev); in meson_wdt_start() local
126 meson_wdt_change_timeout(wdt_dev, meson_wdt->wdt_dev.timeout); in meson_wdt_start()
129 reg = readl(meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_start()
130 reg |= meson_wdt->data->enable; in meson_wdt_start()
131 writel(reg, meson_wdt->wdt_base + MESON_WDT_TC); in meson_wdt_start()
164 struct meson_wdt_dev *meson_wdt; in meson_wdt_probe() local
167 meson_wdt = devm_kzalloc(dev, sizeof(*meson_wdt), GFP_KERNEL); in meson_wdt_probe()
168 if (!meson_wdt) in meson_wdt_probe()
171 meson_wdt->wdt_base = devm_platform_ioremap_resource(pdev, 0); in meson_wdt_probe()
172 if (IS_ERR(meson_wdt->wdt_base)) in meson_wdt_probe()
173 return PTR_ERR(meson_wdt->wdt_base); in meson_wdt_probe()
175 meson_wdt->data = device_get_match_data(dev); in meson_wdt_probe()
177 meson_wdt->wdt_dev.parent = dev; in meson_wdt_probe()
178 meson_wdt->wdt_dev.info = &meson_wdt_info; in meson_wdt_probe()
179 meson_wdt->wdt_dev.ops = &meson_wdt_ops; in meson_wdt_probe()
180 meson_wdt->wdt_dev.max_timeout = in meson_wdt_probe()
181 meson_wdt->data->terminal_count_mask / meson_wdt->data->count_unit; in meson_wdt_probe()
182 meson_wdt->wdt_dev.min_timeout = MESON_WDT_MIN_TIMEOUT; in meson_wdt_probe()
183 meson_wdt->wdt_dev.timeout = min_t(unsigned int, in meson_wdt_probe()
185 meson_wdt->wdt_dev.max_timeout); in meson_wdt_probe()
187 watchdog_set_drvdata(&meson_wdt->wdt_dev, meson_wdt); in meson_wdt_probe()
189 watchdog_init_timeout(&meson_wdt->wdt_dev, timeout, dev); in meson_wdt_probe()
190 watchdog_set_nowayout(&meson_wdt->wdt_dev, nowayout); in meson_wdt_probe()
191 watchdog_set_restart_priority(&meson_wdt->wdt_dev, 128); in meson_wdt_probe()
193 meson_wdt_stop(&meson_wdt->wdt_dev); in meson_wdt_probe()
195 watchdog_stop_on_reboot(&meson_wdt->wdt_dev); in meson_wdt_probe()
196 err = devm_watchdog_register_device(dev, &meson_wdt->wdt_dev); in meson_wdt_probe()
201 meson_wdt->wdt_dev.timeout, nowayout); in meson_wdt_probe()