aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/at32ap700x_wdt.c
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2007-06-18 16:49:35 -0400
committerWim Van Sebroeck <wim@iguana.be>2007-07-05 01:31:27 -0400
commit726c9f611a4079b5265e7ede1d66ed455ac6343c (patch)
treebc9fd4c2fd8d6670ee0df0fc30b3367c02292562 /drivers/char/watchdog/at32ap700x_wdt.c
parentc0ead7e0ff996f0cfa91a73fa674fdca5c05798a (diff)
[WATCHDOG] at32ap700x_wdt.c - timeout module parameter patch
integrate the timeout/heartbeat as a module parameter and not as a CONFIG_* value. Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com> Cc: Haavard Skinnemoen <hskinnemoen@atmel.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Cc: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/char/watchdog/at32ap700x_wdt.c')
-rw-r--r--drivers/char/watchdog/at32ap700x_wdt.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/char/watchdog/at32ap700x_wdt.c b/drivers/char/watchdog/at32ap700x_wdt.c
index 8abe1c77ac1f..6e7c9588b1b9 100644
--- a/drivers/char/watchdog/at32ap700x_wdt.c
+++ b/drivers/char/watchdog/at32ap700x_wdt.c
@@ -20,8 +20,15 @@
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#define TIMEOUT_MIN 1 22#define TIMEOUT_MIN 1
23#define TIMEOUT_DEFAULT CONFIG_AT32AP700X_WDT_TIMEOUT
24#define TIMEOUT_MAX 2 23#define TIMEOUT_MAX 2
24#define TIMEOUT_DEFAULT TIMEOUT_MAX
25
26/* module parameters */
27static int timeout = TIMEOUT_DEFAULT;
28module_param(timeout, int, 0);
29MODULE_PARM_DESC(timeout,
30 "Timeout value. Limited to be 1 or 2 seconds. (default="
31 __MODULE_STRING(TIMEOUT_DEFAULT) ")");
25 32
26/* Watchdog registers and write/read macro */ 33/* Watchdog registers and write/read macro */
27#define WDT_CTRL 0x00 34#define WDT_CTRL 0x00
@@ -233,11 +240,11 @@ static int __init at32_wdt_probe(struct platform_device *pdev)
233 wdt->miscdev.name = "watchdog"; 240 wdt->miscdev.name = "watchdog";
234 wdt->miscdev.fops = &at32_wdt_fops; 241 wdt->miscdev.fops = &at32_wdt_fops;
235 242
236 if (at32_wdt_settimeout(TIMEOUT_DEFAULT)) { 243 if (at32_wdt_settimeout(timeout)) {
237 at32_wdt_settimeout(TIMEOUT_MAX); 244 at32_wdt_settimeout(TIMEOUT_DEFAULT);
238 dev_dbg(&pdev->dev, 245 dev_dbg(&pdev->dev,
239 "default timeout invalid, set to %d sec.\n", 246 "default timeout invalid, set to %d sec.\n",
240 TIMEOUT_MAX); 247 TIMEOUT_DEFAULT);
241 } 248 }
242 249
243 ret = misc_register(&wdt->miscdev); 250 ret = misc_register(&wdt->miscdev);
@@ -248,7 +255,8 @@ static int __init at32_wdt_probe(struct platform_device *pdev)
248 255
249 platform_set_drvdata(pdev, wdt); 256 platform_set_drvdata(pdev, wdt);
250 wdt->miscdev.parent = &pdev->dev; 257 wdt->miscdev.parent = &pdev->dev;
251 dev_info(&pdev->dev, "AT32AP700X WDT at 0x%p\n", wdt->regs); 258 dev_info(&pdev->dev, "AT32AP700X WDT at 0x%p, timeout %d sec\n",
259 wdt->regs, wdt->timeout);
252 260
253 return 0; 261 return 0;
254 262