]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/watchdog/s3c2410_wdt.c
[WATCHDOG] add WDIOC_GETTIMELEFT ioctl
[linux-2.6-omap-h63xx.git] / drivers / char / watchdog / s3c2410_wdt.c
index eb667daee19b6de487c28a2563ce42b2dc44935a..1ea04e9b2b0b0938cfc2cbfa04b2eed12b4da01b 100644 (file)
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
+#include <linux/clk.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
 #include <asm/arch/map.h>
-#include <asm/hardware/clock.h>
 
 #undef S3C24XX_VA_WATCHDOG
 #define S3C24XX_VA_WATCHDOG (0)
@@ -397,7 +397,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
                return -ENOENT;
        }
 
-       clk_use(wdt_clock);
        clk_enable(wdt_clock);
 
        /* see if we can actually set the requested timer margin, and if
@@ -424,6 +423,12 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
        if (tmr_atboot && started == 0) {
                printk(KERN_INFO PFX "Starting Watchdog Timer\n");
                s3c2410wdt_start();
+       } else if (!tmr_atboot) {
+               /* if we're not enabling the watchdog, then ensure it is
+                * disabled if it has been left running from the bootloader
+                * or other source */
+
+               s3c2410wdt_stop();
        }
 
        return 0;
@@ -444,7 +449,6 @@ static int s3c2410wdt_remove(struct platform_device *dev)
 
        if (wdt_clock != NULL) {
                clk_disable(wdt_clock);
-               clk_unuse(wdt_clock);
                clk_put(wdt_clock);
                wdt_clock = NULL;
        }