rt2x00: Unify rt2800 WPDMA ready waiting functions.
[safe/jmp/linux-2.6] / drivers / watchdog / omap_wdt.c
index aa5ad6e..429ea99 100644 (file)
@@ -43,7 +43,7 @@
 #include <linux/io.h>
 #include <linux/uaccess.h>
 #include <mach/hardware.h>
-#include <mach/prcm.h>
+#include <plat/prcm.h>
 
 #include "omap_wdt.h"
 
@@ -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);
@@ -258,7 +259,7 @@ static const struct file_operations omap_wdt_fops = {
        .release = omap_wdt_release,
 };
 
-static int __init omap_wdt_probe(struct platform_device *pdev)
+static int __devinit omap_wdt_probe(struct platform_device *pdev)
 {
        struct resource *res, *mem;
        struct omap_wdt_dev *wdev;
@@ -313,6 +314,9 @@ static int __init 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);
 
@@ -332,6 +336,9 @@ static int __init 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;
@@ -367,7 +374,7 @@ static void omap_wdt_shutdown(struct platform_device *pdev)
                omap_wdt_disable(wdev);
 }
 
-static int omap_wdt_remove(struct platform_device *pdev)
+static int __devexit omap_wdt_remove(struct platform_device *pdev)
 {
        struct omap_wdt_dev *wdev = platform_get_drvdata(pdev);
        struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -426,7 +433,7 @@ static int omap_wdt_resume(struct platform_device *pdev)
 
 static struct platform_driver omap_wdt_driver = {
        .probe          = omap_wdt_probe,
-       .remove         = omap_wdt_remove,
+       .remove         = __devexit_p(omap_wdt_remove),
        .shutdown       = omap_wdt_shutdown,
        .suspend        = omap_wdt_suspend,
        .resume         = omap_wdt_resume,