aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/orion_wdt.c
diff options
context:
space:
mode:
authorFabio Porcedda <fabio.porcedda@gmail.com>2013-02-14 03:14:25 -0500
committerWim Van Sebroeck <wim@iguana.be>2013-03-01 06:53:45 -0500
commitc1fd5f6402050b2463d0610b94f050fedf1b5019 (patch)
tree7ff33e78c2a4f40b3465d163c03382db0d4d500f /drivers/watchdog/orion_wdt.c
parent490ac7af8b71069ba0c733052c5f448ac070c947 (diff)
watchdog: add timeout-sec property binding
this patchset add the timeout-sec property to the following drivers: orion_wdt, pnx4008_wdt, s3c2410_wdt and at91sam9_wdt. The at91sam9_wdt is tested on evk-pr3, the other drivers are compile tested only. Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> Cc: Andrew Lunn <andrew@lunn.ch> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Wolfram Sang <w.sang@pengutronix.de> Cc: Masanari Iida <standby24x7@gmail.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Andrew Victor <linux@maxim.org.za> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/orion_wdt.c')
-rw-r--r--drivers/watchdog/orion_wdt.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c
index 87ed2b9886a3..da577980d390 100644
--- a/drivers/watchdog/orion_wdt.c
+++ b/drivers/watchdog/orion_wdt.c
@@ -140,6 +140,7 @@ static const struct watchdog_ops orion_wdt_ops = {
140static struct watchdog_device orion_wdt = { 140static struct watchdog_device orion_wdt = {
141 .info = &orion_wdt_info, 141 .info = &orion_wdt_info,
142 .ops = &orion_wdt_ops, 142 .ops = &orion_wdt_ops,
143 .min_timeout = 1,
143}; 144};
144 145
145static int orion_wdt_probe(struct platform_device *pdev) 146static int orion_wdt_probe(struct platform_device *pdev)
@@ -164,12 +165,9 @@ static int orion_wdt_probe(struct platform_device *pdev)
164 165
165 wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk; 166 wdt_max_duration = WDT_MAX_CYCLE_COUNT / wdt_tclk;
166 167
167 if ((heartbeat < 1) || (heartbeat > wdt_max_duration)) 168 orion_wdt.timeout = wdt_max_duration;
168 heartbeat = wdt_max_duration;
169
170 orion_wdt.timeout = heartbeat;
171 orion_wdt.min_timeout = 1;
172 orion_wdt.max_timeout = wdt_max_duration; 169 orion_wdt.max_timeout = wdt_max_duration;
170 watchdog_init_timeout(&orion_wdt, heartbeat, &pdev->dev);
173 171
174 watchdog_set_nowayout(&orion_wdt, nowayout); 172 watchdog_set_nowayout(&orion_wdt, nowayout);
175 ret = watchdog_register_device(&orion_wdt); 173 ret = watchdog_register_device(&orion_wdt);
@@ -179,7 +177,7 @@ static int orion_wdt_probe(struct platform_device *pdev)
179 } 177 }
180 178
181 pr_info("Initial timeout %d sec%s\n", 179 pr_info("Initial timeout %d sec%s\n",
182 heartbeat, nowayout ? ", nowayout" : ""); 180 orion_wdt.timeout, nowayout ? ", nowayout" : "");
183 return 0; 181 return 0;
184} 182}
185 183