提交 2af29b78 编写于 作者: A Andrew Victor 提交者: Russell King

[ARM] 5390/1: AT91: Watchdog fixes

The recently merged AT91SAM9 watchdog driver uses the
AT91SAM9X_WATCHDOG config variable, whereas the original version of
the driver (and the platform support code) used AT91SAM9_WATCHDOG.
This causes the watchdog platform_device to never be registered, and
therefore the driver not to be initialized.

This patch:
- updates the platform support code to use AT91SAM9X_WATCHDOG.
- includes <linux/io.h> to fix compile error (same fix as was applied
to at91rm9200_wdt.c)
- fixes comment regarding watchdog clock-rates in at91rm9200.
Signed-off-by: NAndrew Victor <linux@maxim.org.za>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 98ad6e3b
...@@ -608,7 +608,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y ...@@ -608,7 +608,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
# Watchdog Device Drivers # Watchdog Device Drivers
# #
# CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOFT_WATCHDOG is not set
CONFIG_AT91SAM9_WATCHDOG=y CONFIG_AT91SAM9X_WATCHDOG=y
# #
# USB-based Watchdog Cards # USB-based Watchdog Cards
......
...@@ -700,7 +700,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y ...@@ -700,7 +700,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
# Watchdog Device Drivers # Watchdog Device Drivers
# #
# CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOFT_WATCHDOG is not set
CONFIG_AT91SAM9_WATCHDOG=y CONFIG_AT91SAM9X_WATCHDOG=y
# #
# USB-based Watchdog Cards # USB-based Watchdog Cards
......
...@@ -710,7 +710,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y ...@@ -710,7 +710,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
# Watchdog Device Drivers # Watchdog Device Drivers
# #
# CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOFT_WATCHDOG is not set
CONFIG_AT91SAM9_WATCHDOG=y CONFIG_AT91SAM9X_WATCHDOG=y
# #
# USB-based Watchdog Cards # USB-based Watchdog Cards
......
...@@ -606,7 +606,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y ...@@ -606,7 +606,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
# Watchdog Device Drivers # Watchdog Device Drivers
# #
# CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOFT_WATCHDOG is not set
CONFIG_AT91SAM9_WATCHDOG=y CONFIG_AT91SAM9X_WATCHDOG=y
# #
# Sonics Silicon Backplane # Sonics Silicon Backplane
......
...@@ -727,7 +727,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y ...@@ -727,7 +727,7 @@ CONFIG_WATCHDOG_NOWAYOUT=y
# Watchdog Device Drivers # Watchdog Device Drivers
# #
# CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOFT_WATCHDOG is not set
# CONFIG_AT91SAM9_WATCHDOG is not set # CONFIG_AT91SAM9X_WATCHDOG is not set
# #
# USB-based Watchdog Cards # USB-based Watchdog Cards
......
...@@ -697,7 +697,7 @@ static void __init at91_add_device_rtt(void) ...@@ -697,7 +697,7 @@ static void __init at91_add_device_rtt(void)
* Watchdog * Watchdog
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
static struct platform_device at91cap9_wdt_device = { static struct platform_device at91cap9_wdt_device = {
.name = "at91_wdt", .name = "at91_wdt",
.id = -1, .id = -1,
......
...@@ -643,7 +643,7 @@ static void __init at91_add_device_rtt(void) ...@@ -643,7 +643,7 @@ static void __init at91_add_device_rtt(void)
* Watchdog * Watchdog
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
static struct platform_device at91sam9260_wdt_device = { static struct platform_device at91sam9260_wdt_device = {
.name = "at91_wdt", .name = "at91_wdt",
.id = -1, .id = -1,
......
...@@ -621,7 +621,7 @@ static void __init at91_add_device_rtt(void) ...@@ -621,7 +621,7 @@ static void __init at91_add_device_rtt(void)
* Watchdog * Watchdog
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
static struct platform_device at91sam9261_wdt_device = { static struct platform_device at91sam9261_wdt_device = {
.name = "at91_wdt", .name = "at91_wdt",
.id = -1, .id = -1,
......
...@@ -854,7 +854,7 @@ static void __init at91_add_device_rtt(void) ...@@ -854,7 +854,7 @@ static void __init at91_add_device_rtt(void)
* Watchdog * Watchdog
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
static struct platform_device at91sam9263_wdt_device = { static struct platform_device at91sam9263_wdt_device = {
.name = "at91_wdt", .name = "at91_wdt",
.id = -1, .id = -1,
......
...@@ -609,7 +609,7 @@ static void __init at91_add_device_rtt(void) ...@@ -609,7 +609,7 @@ static void __init at91_add_device_rtt(void)
* Watchdog * Watchdog
* -------------------------------------------------------------------- */ * -------------------------------------------------------------------- */
#if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
static struct platform_device at91sam9rl_wdt_device = { static struct platform_device at91sam9rl_wdt_device = {
.name = "at91_wdt", .name = "at91_wdt",
.id = -1, .id = -1,
......
...@@ -107,10 +107,10 @@ static int at91_wdt_close(struct inode *inode, struct file *file) ...@@ -107,10 +107,10 @@ static int at91_wdt_close(struct inode *inode, struct file *file)
static int at91_wdt_settimeout(int new_time) static int at91_wdt_settimeout(int new_time)
{ {
/* /*
* All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz * All counting occurs at SLOW_CLOCK / 128 = 256 Hz
* *
* Since WDV is a 16-bit counter, the maximum period is * Since WDV is a 16-bit counter, the maximum period is
* 65536 / 0.256 = 256 seconds. * 65536 / 256 = 256 seconds.
*/ */
if ((new_time <= 0) || (new_time > WDT_MAX_TIME)) if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
return -EINVAL; return -EINVAL;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/module.h> #include <linux/module.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册