aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-01-23 07:48:37 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-08 12:50:16 -0500
commit4c5e1946b5f89c33e3bc8ed73fa7ba8f31e37cc5 (patch)
treefb8892538fc97ce6d6836c8f82b9342a55e3e970
parent39a80c7f379e1c1d3e63b204b8353b7381d0a3d5 (diff)
[ARM] omap: watchdog: provide a dummy ick for OMAP1
Eliminate the OMAP1 vs OMAP2 clock knowledge in the watchdog driver. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-omap1/clock.c2
-rw-r--r--drivers/watchdog/omap_wdt.c23
2 files changed, 10 insertions, 15 deletions
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 8ae7827bb8b8..758abaadaf37 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -86,6 +86,8 @@ static struct omap_clk omap_clks[] = {
86 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310), 86 CLK(NULL, "armxor_ck", &armxor_ck.clk, CK_16XX | CK_1510 | CK_310),
87 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310), 87 CLK(NULL, "armtim_ck", &armtim_ck.clk, CK_16XX | CK_1510 | CK_310),
88 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310), 88 CLK("omap_wdt", "fck", &armwdt_ck.clk, CK_16XX | CK_1510 | CK_310),
89 CLK("omap_wdt", "ick", &armper_ck.clk, CK_16XX),
90 CLK("omap_wdt", "ick", &dummy_ck, CK_1510 | CK_310),
89 CLK(NULL, "arminth_ck", &arminth_ck1510, CK_1510 | CK_310), 91 CLK(NULL, "arminth_ck", &arminth_ck1510, CK_1510 | CK_310),
90 CLK(NULL, "arminth_ck", &arminth_ck16xx, CK_16XX), 92 CLK(NULL, "arminth_ck", &arminth_ck16xx, CK_16XX),
91 /* CK_GEN2 clocks */ 93 /* CK_GEN2 clocks */
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 1a4c699762e6..aa5ad6e33f02 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -145,8 +145,7 @@ static int omap_wdt_open(struct inode *inode, struct file *file)
145 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)))
146 return -EBUSY; 146 return -EBUSY;
147 147
148 if (wdev->ick) 148 clk_enable(wdev->ick); /* Enable the interface clock */
149 clk_enable(wdev->ick); /* Enable the interface clock */
150 clk_enable(wdev->fck); /* Enable the functional clock */ 149 clk_enable(wdev->fck); /* Enable the functional clock */
151 150
152 /* initialize prescaler */ 151 /* initialize prescaler */
@@ -176,8 +175,7 @@ static int omap_wdt_release(struct inode *inode, struct file *file)
176 175
177 omap_wdt_disable(wdev); 176 omap_wdt_disable(wdev);
178 177
179 if (wdev->ick) 178 clk_disable(wdev->ick);
180 clk_disable(wdev->ick);
181 clk_disable(wdev->fck); 179 clk_disable(wdev->fck);
182#else 180#else
183 printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n"); 181 printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n");
@@ -294,13 +292,11 @@ static int __init omap_wdt_probe(struct platform_device *pdev)
294 wdev->omap_wdt_users = 0; 292 wdev->omap_wdt_users = 0;
295 wdev->mem = mem; 293 wdev->mem = mem;
296 294
297 if (cpu_is_omap24xx() || cpu_is_omap34xx()) { 295 wdev->ick = clk_get(&pdev->dev, "ick");
298 wdev->ick = clk_get(&pdev->dev, "ick"); 296 if (IS_ERR(wdev->ick)) {
299 if (IS_ERR(wdev->ick)) { 297 ret = PTR_ERR(wdev->ick);
300 ret = PTR_ERR(wdev->ick); 298 wdev->ick = NULL;
301 wdev->ick = NULL; 299 goto err_clk;
302 goto err_clk;
303 }
304 } 300 }
305 wdev->fck = clk_get(&pdev->dev, "fck"); 301 wdev->fck = clk_get(&pdev->dev, "fck");
306 if (IS_ERR(wdev->fck)) { 302 if (IS_ERR(wdev->fck)) {
@@ -383,10 +379,7 @@ static int omap_wdt_remove(struct platform_device *pdev)
383 release_mem_region(res->start, res->end - res->start + 1); 379 release_mem_region(res->start, res->end - res->start + 1);
384 platform_set_drvdata(pdev, NULL); 380 platform_set_drvdata(pdev, NULL);
385 381
386 if (wdev->ick) { 382 clk_put(wdev->ick);
387 clk_put(wdev->ick);
388 }
389
390 clk_put(wdev->fck); 383 clk_put(wdev->fck);
391 iounmap(wdev->base); 384 iounmap(wdev->base);
392 385