Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Andrew Victor and committed by
Russell King
2af29b78 98ad6e3b

+13 -12
+1 -1
arch/arm/configs/at91sam9260ek_defconfig
··· 608 608 # Watchdog Device Drivers 609 609 # 610 610 # CONFIG_SOFT_WATCHDOG is not set 611 - CONFIG_AT91SAM9_WATCHDOG=y 611 + CONFIG_AT91SAM9X_WATCHDOG=y 612 612 613 613 # 614 614 # USB-based Watchdog Cards
+1 -1
arch/arm/configs/at91sam9261ek_defconfig
··· 700 700 # Watchdog Device Drivers 701 701 # 702 702 # CONFIG_SOFT_WATCHDOG is not set 703 - CONFIG_AT91SAM9_WATCHDOG=y 703 + CONFIG_AT91SAM9X_WATCHDOG=y 704 704 705 705 # 706 706 # USB-based Watchdog Cards
+1 -1
arch/arm/configs/at91sam9263ek_defconfig
··· 710 710 # Watchdog Device Drivers 711 711 # 712 712 # CONFIG_SOFT_WATCHDOG is not set 713 - CONFIG_AT91SAM9_WATCHDOG=y 713 + CONFIG_AT91SAM9X_WATCHDOG=y 714 714 715 715 # 716 716 # USB-based Watchdog Cards
+1 -1
arch/arm/configs/at91sam9rlek_defconfig
··· 606 606 # Watchdog Device Drivers 607 607 # 608 608 # CONFIG_SOFT_WATCHDOG is not set 609 - CONFIG_AT91SAM9_WATCHDOG=y 609 + CONFIG_AT91SAM9X_WATCHDOG=y 610 610 611 611 # 612 612 # Sonics Silicon Backplane
+1 -1
arch/arm/configs/qil-a9260_defconfig
··· 727 727 # Watchdog Device Drivers 728 728 # 729 729 # CONFIG_SOFT_WATCHDOG is not set 730 - # CONFIG_AT91SAM9_WATCHDOG is not set 730 + # CONFIG_AT91SAM9X_WATCHDOG is not set 731 731 732 732 # 733 733 # USB-based Watchdog Cards
+1 -1
arch/arm/mach-at91/at91cap9_devices.c
··· 697 697 * Watchdog 698 698 * -------------------------------------------------------------------- */ 699 699 700 - #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) 700 + #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 701 701 static struct platform_device at91cap9_wdt_device = { 702 702 .name = "at91_wdt", 703 703 .id = -1,
+1 -1
arch/arm/mach-at91/at91sam9260_devices.c
··· 643 643 * Watchdog 644 644 * -------------------------------------------------------------------- */ 645 645 646 - #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) 646 + #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 647 647 static struct platform_device at91sam9260_wdt_device = { 648 648 .name = "at91_wdt", 649 649 .id = -1,
+1 -1
arch/arm/mach-at91/at91sam9261_devices.c
··· 621 621 * Watchdog 622 622 * -------------------------------------------------------------------- */ 623 623 624 - #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) 624 + #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 625 625 static struct platform_device at91sam9261_wdt_device = { 626 626 .name = "at91_wdt", 627 627 .id = -1,
+1 -1
arch/arm/mach-at91/at91sam9263_devices.c
··· 854 854 * Watchdog 855 855 * -------------------------------------------------------------------- */ 856 856 857 - #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) 857 + #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 858 858 static struct platform_device at91sam9263_wdt_device = { 859 859 .name = "at91_wdt", 860 860 .id = -1,
+1 -1
arch/arm/mach-at91/at91sam9rl_devices.c
··· 609 609 * Watchdog 610 610 * -------------------------------------------------------------------- */ 611 611 612 - #if defined(CONFIG_AT91SAM9_WATCHDOG) || defined(CONFIG_AT91SAM9_WATCHDOG_MODULE) 612 + #if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE) 613 613 static struct platform_device at91sam9rl_wdt_device = { 614 614 .name = "at91_wdt", 615 615 .id = -1,
+2 -2
drivers/watchdog/at91rm9200_wdt.c
··· 107 107 static int at91_wdt_settimeout(int new_time) 108 108 { 109 109 /* 110 - * All counting occurs at SLOW_CLOCK / 128 = 0.256 Hz 110 + * All counting occurs at SLOW_CLOCK / 128 = 256 Hz 111 111 * 112 112 * Since WDV is a 16-bit counter, the maximum period is 113 - * 65536 / 0.256 = 256 seconds. 113 + * 65536 / 256 = 256 seconds. 114 114 */ 115 115 if ((new_time <= 0) || (new_time > WDT_MAX_TIME)) 116 116 return -EINVAL;
+1
drivers/watchdog/at91sam9_wdt.c
··· 18 18 #include <linux/errno.h> 19 19 #include <linux/fs.h> 20 20 #include <linux/init.h> 21 + #include <linux/io.h> 21 22 #include <linux/kernel.h> 22 23 #include <linux/miscdevice.h> 23 24 #include <linux/module.h>