rt2880_wdt.c (85a3685852d9ac7d92be9d824533c915a4597fa4) rt2880_wdt.c (6551881c86c791237a3bebf11eb3bd70b60ea782)
1/*
2 * Ralink RT288x/RT3xxx/MT76xx built-in hardware watchdog timer
3 *
4 * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
6 *
7 * This driver was based on: drivers/watchdog/softdog.c
8 *

--- 147 unchanged lines hidden (view full) ---

156 if (!IS_ERR(rt288x_wdt_reset))
157 reset_control_deassert(rt288x_wdt_reset);
158
159 rt288x_wdt_freq = clk_get_rate(rt288x_wdt_clk) / RALINK_WDT_PRESCALE;
160
161 rt288x_wdt_dev.dev = &pdev->dev;
162 rt288x_wdt_dev.bootstatus = rt288x_wdt_bootcause();
163 rt288x_wdt_dev.max_timeout = (0xfffful / rt288x_wdt_freq);
1/*
2 * Ralink RT288x/RT3xxx/MT76xx built-in hardware watchdog timer
3 *
4 * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
6 *
7 * This driver was based on: drivers/watchdog/softdog.c
8 *

--- 147 unchanged lines hidden (view full) ---

156 if (!IS_ERR(rt288x_wdt_reset))
157 reset_control_deassert(rt288x_wdt_reset);
158
159 rt288x_wdt_freq = clk_get_rate(rt288x_wdt_clk) / RALINK_WDT_PRESCALE;
160
161 rt288x_wdt_dev.dev = &pdev->dev;
162 rt288x_wdt_dev.bootstatus = rt288x_wdt_bootcause();
163 rt288x_wdt_dev.max_timeout = (0xfffful / rt288x_wdt_freq);
164 rt288x_wdt_dev.parent = &pdev->dev;
164
165 watchdog_init_timeout(&rt288x_wdt_dev, rt288x_wdt_dev.max_timeout,
166 &pdev->dev);
167 watchdog_set_nowayout(&rt288x_wdt_dev, nowayout);
168
169 ret = watchdog_register_device(&rt288x_wdt_dev);
170 if (!ret)
171 dev_info(&pdev->dev, "Initialized\n");

--- 37 unchanged lines hidden ---
165
166 watchdog_init_timeout(&rt288x_wdt_dev, rt288x_wdt_dev.max_timeout,
167 &pdev->dev);
168 watchdog_set_nowayout(&rt288x_wdt_dev, nowayout);
169
170 ret = watchdog_register_device(&rt288x_wdt_dev);
171 if (!ret)
172 dev_info(&pdev->dev, "Initialized\n");

--- 37 unchanged lines hidden ---