aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-28 17:03:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-28 17:03:14 -0400
commit0fe41b8982001cd14ee2c77cd776735a5024e98b (patch)
tree83e65d595c413d55259ea14fb97748ce5efe5707 /drivers/watchdog
parenteedf2c5296a8dfaaf9aec1a938c1d3bd73159a30 (diff)
parent9759d22c8348343b0da4e25d6150c41712686c14 (diff)
Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm: (422 commits) [ARM] 5435/1: fix compile warning in sanity_check_meminfo() [ARM] 5434/1: ARM: OMAP: Fix mailbox compile for 24xx [ARM] pxa: fix the bad assumption that PCMCIA sockets always start with 0 [ARM] pxa: fix Colibri PXA300 and PXA320 LCD backlight pins imxfb: Fix TFT mode i.MX21/27: remove ifdef CONFIG_FB_IMX imxfb: add clock support mxc: add arch_reset() function clkdev: add possibility to get a clock based on the device name i.MX1: remove fb support from mach-imx [ARM] pxa: build arch/arm/plat-pxa/mfp.c only when PXA3xx or ARCH_MMP defined Gemini: Add support for Teltonika RUT100 Gemini: gpiolib based GPIO support v2 MAINTAINERS: add myself as Gemini architecture maintainer ARM: Add Gemini architecture v3 [ARM] OMAP: Fix compile for omap2_init_common_hw() MAINTAINERS: Add myself as Faraday ARM core variant maintainer ARM: Add support for FA526 v2 [ARM] acorn,ebsa110,footbridge,integrator,sa1100: Convert asm/io.h to linux/io.h [ARM] collie: fix two minor formatting nits ...
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/omap_wdt.c94
-rw-r--r--drivers/watchdog/sa1100_wdt.c2
2 files changed, 23 insertions, 73 deletions
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 2f2ce7429f5b..aa5ad6e33f02 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -60,9 +60,8 @@ struct omap_wdt_dev {
60 void __iomem *base; /* physical */ 60 void __iomem *base; /* physical */
61 struct device *dev; 61 struct device *dev;
62 int omap_wdt_users; 62 int omap_wdt_users;
63 struct clk *armwdt_ck; 63 struct clk *ick;
64 struct clk *mpu_wdt_ick; 64 struct clk *fck;
65 struct clk *mpu_wdt_fck;
66 struct resource *mem; 65 struct resource *mem;
67 struct miscdevice omap_wdt_miscdev; 66 struct miscdevice omap_wdt_miscdev;
68}; 67};
@@ -146,13 +145,8 @@ static int omap_wdt_open(struct inode *inode, struct file *file)
146 if (test_and_set_bit(1, (unsigned long *)&(wdev->omap_wdt_users))) 145 if (test_and_set_bit(1, (unsigned long *)&(wdev->omap_wdt_users)))
147 return -EBUSY; 146 return -EBUSY;
148 147
149 if (cpu_is_omap16xx()) 148 clk_enable(wdev->ick); /* Enable the interface clock */
150 clk_enable(wdev->armwdt_ck); /* Enable the clock */ 149 clk_enable(wdev->fck); /* Enable the functional clock */
151
152 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
153 clk_enable(wdev->mpu_wdt_ick); /* Enable the interface clock */
154 clk_enable(wdev->mpu_wdt_fck); /* Enable the functional clock */
155 }
156 150
157 /* initialize prescaler */ 151 /* initialize prescaler */
158 while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01) 152 while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01)
@@ -181,13 +175,8 @@ static int omap_wdt_release(struct inode *inode, struct file *file)
181 175
182 omap_wdt_disable(wdev); 176 omap_wdt_disable(wdev);
183 177
184 if (cpu_is_omap16xx()) 178 clk_disable(wdev->ick);
185 clk_disable(wdev->armwdt_ck); /* Disable the clock */ 179 clk_disable(wdev->fck);
186
187 if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
188 clk_disable(wdev->mpu_wdt_ick); /* Disable the clock */
189 clk_disable(wdev->mpu_wdt_fck); /* Disable the clock */
190 }
191#else 180#else
192 printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n"); 181 printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n");
193#endif 182#endif
@@ -303,44 +292,19 @@ static int __init omap_wdt_probe(struct platform_device *pdev)
303 wdev->omap_wdt_users = 0; 292 wdev->omap_wdt_users = 0;
304 wdev->mem = mem; 293 wdev->mem = mem;
305 294
306 if (cpu_is_omap16xx()) { 295 wdev->ick = clk_get(&pdev->dev, "ick");
307 wdev->armwdt_ck = clk_get(&pdev->dev, "armwdt_ck"); 296 if (IS_ERR(wdev->ick)) {
308 if (IS_ERR(wdev->armwdt_ck)) { 297 ret = PTR_ERR(wdev->ick);
309 ret = PTR_ERR(wdev->armwdt_ck); 298 wdev->ick = NULL;
310 wdev->armwdt_ck = NULL; 299 goto err_clk;
311 goto err_clk;
312 }
313 } 300 }
314 301 wdev->fck = clk_get(&pdev->dev, "fck");
315 if (cpu_is_omap24xx()) { 302 if (IS_ERR(wdev->fck)) {
316 wdev->mpu_wdt_ick = clk_get(&pdev->dev, "mpu_wdt_ick"); 303 ret = PTR_ERR(wdev->fck);
317 if (IS_ERR(wdev->mpu_wdt_ick)) { 304 wdev->fck = NULL;
318 ret = PTR_ERR(wdev->mpu_wdt_ick); 305 goto err_clk;
319 wdev->mpu_wdt_ick = NULL;
320 goto err_clk;
321 }
322 wdev->mpu_wdt_fck = clk_get(&pdev->dev, "mpu_wdt_fck");
323 if (IS_ERR(wdev->mpu_wdt_fck)) {
324 ret = PTR_ERR(wdev->mpu_wdt_fck);
325 wdev->mpu_wdt_fck = NULL;
326 goto err_clk;
327 }
328 } 306 }
329 307
330 if (cpu_is_omap34xx()) {
331 wdev->mpu_wdt_ick = clk_get(&pdev->dev, "wdt2_ick");
332 if (IS_ERR(wdev->mpu_wdt_ick)) {
333 ret = PTR_ERR(wdev->mpu_wdt_ick);
334 wdev->mpu_wdt_ick = NULL;
335 goto err_clk;
336 }
337 wdev->mpu_wdt_fck = clk_get(&pdev->dev, "wdt2_fck");
338 if (IS_ERR(wdev->mpu_wdt_fck)) {
339 ret = PTR_ERR(wdev->mpu_wdt_fck);
340 wdev->mpu_wdt_fck = NULL;
341 goto err_clk;
342 }
343 }
344 wdev->base = ioremap(res->start, res->end - res->start + 1); 308 wdev->base = ioremap(res->start, res->end - res->start + 1);
345 if (!wdev->base) { 309 if (!wdev->base) {
346 ret = -ENOMEM; 310 ret = -ENOMEM;
@@ -380,12 +344,10 @@ err_ioremap:
380 wdev->base = NULL; 344 wdev->base = NULL;
381 345
382err_clk: 346err_clk:
383 if (wdev->armwdt_ck) 347 if (wdev->ick)
384 clk_put(wdev->armwdt_ck); 348 clk_put(wdev->ick);
385 if (wdev->mpu_wdt_ick) 349 if (wdev->fck)
386 clk_put(wdev->mpu_wdt_ick); 350 clk_put(wdev->fck);
387 if (wdev->mpu_wdt_fck)
388 clk_put(wdev->mpu_wdt_fck);
389 kfree(wdev); 351 kfree(wdev);
390 352
391err_kzalloc: 353err_kzalloc:
@@ -417,20 +379,8 @@ static int omap_wdt_remove(struct platform_device *pdev)
417 release_mem_region(res->start, res->end - res->start + 1); 379 release_mem_region(res->start, res->end - res->start + 1);
418 platform_set_drvdata(pdev, NULL); 380 platform_set_drvdata(pdev, NULL);
419 381
420 if (wdev->armwdt_ck) { 382 clk_put(wdev->ick);
421 clk_put(wdev->armwdt_ck); 383 clk_put(wdev->fck);
422 wdev->armwdt_ck = NULL;
423 }
424
425 if (wdev->mpu_wdt_ick) {
426 clk_put(wdev->mpu_wdt_ick);
427 wdev->mpu_wdt_ick = NULL;
428 }
429
430 if (wdev->mpu_wdt_fck) {
431 clk_put(wdev->mpu_wdt_fck);
432 wdev->mpu_wdt_fck = NULL;
433 }
434 iounmap(wdev->base); 384 iounmap(wdev->base);
435 385
436 kfree(wdev); 386 kfree(wdev);
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c
index 5bd782f27837..ee1caae4d33b 100644
--- a/drivers/watchdog/sa1100_wdt.c
+++ b/drivers/watchdog/sa1100_wdt.c
@@ -30,7 +30,7 @@
30#include <linux/timex.h> 30#include <linux/timex.h>
31 31
32#ifdef CONFIG_ARCH_PXA 32#ifdef CONFIG_ARCH_PXA
33#include <mach/pxa-regs.h> 33#include <mach/regs-ost.h>
34#endif 34#endif
35 35
36#include <mach/reset.h> 36#include <mach/reset.h>