Skip to content

Commit

Permalink
[WATCHDOG] OMAP fixes: enable clock in probe, trigger timer reload
Browse files Browse the repository at this point in the history
This patch contains two fixes:

1)In omap_wdt_probe() the watchdog is reset and disabled. This
requires register access and the clks needs to be enabled temporarily

2)In omap_wdt_open() the timer register needs to be reloaded
to trigger a new timer value (the default of 60s)

Tested on OMAP34xx platform (Zoom1)

Reviewed-by: Kevin Hilman <khilman@ti.deeprootsystems.com>
Signed-off-by: Ulrik Bech Hald <ubh@ti.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Ulrik Bech Hald authored and Wim Van Sebroeck committed Jun 23, 2009
1 parent 90074dc commit 789cd47
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/watchdog/omap_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ static int omap_wdt_open(struct inode *inode, struct file *file)
file->private_data = (void *) wdev;

omap_wdt_set_timeout(wdev);
omap_wdt_ping(wdev); /* trigger loading of new timeout value */
omap_wdt_enable(wdev);

return nonseekable_open(inode, file);
Expand Down Expand Up @@ -313,6 +314,9 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, wdev);

clk_enable(wdev->ick);
clk_enable(wdev->fck);

omap_wdt_disable(wdev);
omap_wdt_adjust_timeout(timer_margin);

Expand All @@ -332,6 +336,9 @@ static int __devinit omap_wdt_probe(struct platform_device *pdev)
/* autogate OCP interface clock */
__raw_writel(0x01, wdev->base + OMAP_WATCHDOG_SYS_CONFIG);

clk_disable(wdev->ick);
clk_disable(wdev->fck);

omap_wdt_dev = pdev;

return 0;
Expand Down

0 comments on commit 789cd47

Please sign in to comment.