[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: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Andrew Victor 2009-02-11 21:23:10 +01:00 committed by Russell King
parent 98ad6e3b1f
commit 2af29b7861
12 changed files with 13 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View File

@ -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,

View 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;

View File

@ -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>