]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ftwdt010_wdt: move header to include/faraday and enhance
authorMacpaul Lin <macpaul@andestech.com>
Tue, 12 Apr 2011 05:04:02 +0000 (13:04 +0800)
committerWolfgang Denk <wd@denx.de>
Tue, 12 Apr 2011 20:58:33 +0000 (22:58 +0200)
1. Move header to include/faraday
2. Fix include path in ftwdt010_wdt.c
3. Fix function prototype and declaration to
  - ftwdt010_wdt_settimeout
  - ftwdt010_wdt_reset
  - ftwdt010_wdt_disable
4. Add "#if definde (CONFIG_HW_WATCHDOG)" let user have flexibilty
  to choose which better to his product.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
drivers/watchdog/ftwdt010_wdt.c
include/faraday/ftwdt010_wdt.h [moved from drivers/watchdog/ftwdt010_wdt.h with 98% similarity]

index 6e0617b6a29ff7d00e21f3f843250fedbab45b69..c9cb53ed4f132c13ca7a9c065c460e5e0a695ec1 100644 (file)
 #include <common.h>
 #include <watchdog.h>
 #include <asm/io.h>
-#include "ftwdt010_wdt.h"
+#include <faraday/ftwdt010_wdt.h>
 
 /*
  * Set the watchdog time interval.
  * Counter is 32 bit.
  */
-static int ftwdt010_wdt_settimeout(unsigned int timeout)
+int ftwdt010_wdt_settimeout(unsigned int timeout)
 {
        unsigned int reg;
 
@@ -61,7 +61,7 @@ static int ftwdt010_wdt_settimeout(unsigned int timeout)
        return 0;
 }
 
-void ftwdt010_wdt_reset()
+void ftwdt010_wdt_reset(void)
 {
        struct ftwdt010_wdt *wd = (struct ftwdt010_wdt *)CONFIG_FTWDT010_BASE;
 
@@ -75,7 +75,7 @@ void ftwdt010_wdt_reset()
        writel((FTWDT010_WDCR_RST | FTWDT010_WDCR_ENABLE), &wd->wdcr);
 }
 
-void ftwdt010_wdt_disable()
+void ftwdt010_wdt_disable(void)
 {
        struct ftwdt010_wdt *wd = (struct ftwdt010_wdt *)CONFIG_FTWDT010_BASE;
 
@@ -90,7 +90,8 @@ void ftwdt010_wdt_disable()
        writel(0, &wd->wdcr);
 }
 
-void hw_watchdog_reset()
+#if defined(CONFIG_HW_WATCHDOG)
+void hw_watchdog_reset(void)
 {
        ftwdt010_wdt_reset();
 }
@@ -100,3 +101,4 @@ void hw_watchdog_init(void)
        /* set timer in ms */
        ftwdt010_wdt_settimeout(CONFIG_FTWDT010_HW_TIMEOUT * 1000);
 }
+#endif
similarity index 98%
rename from drivers/watchdog/ftwdt010_wdt.h
rename to include/faraday/ftwdt010_wdt.h
index 8f4fd68bd734d14691fc18082fa2b064415f0945..31ca768111dd5d214b3a7174568dff4f53275f91 100644 (file)
@@ -100,4 +100,7 @@ struct ftwdt010_wdt {
  */
 #define FTWDT010_TIMEOUT_FACTOR                (CONFIG_SYS_CLK_FREQ / 1000) /* 1 ms */
 
+void ftwdt010_wdt_reset(void);
+void ftwdt010_wdt_disable(void);
+
 #endif /* __FTWDT010_H */