diff options
103 files changed, 905 insertions, 407 deletions
diff --git a/Documentation/devicetree/bindings/watchdog/dw_wdt.txt b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt new file mode 100644 index 000000000000..08e16f684f2d --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/dw_wdt.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | Synopsys Designware Watchdog Timer | ||
2 | |||
3 | Required Properties: | ||
4 | |||
5 | - compatible : Should contain "snps,dw-wdt" | ||
6 | - reg : Base address and size of the watchdog timer registers. | ||
7 | - clocks : phandle + clock-specifier for the clock that drives the | ||
8 | watchdog timer. | ||
9 | |||
10 | Optional Properties: | ||
11 | |||
12 | - interrupts : The interrupt used for the watchdog timeout warning. | ||
13 | |||
14 | Example: | ||
15 | |||
16 | watchdog0: wd@ffd02000 { | ||
17 | compatible = "snps,dw-wdt"; | ||
18 | reg = <0xffd02000 0x1000>; | ||
19 | interrupts = <0 171 4>; | ||
20 | clocks = <&per_base_clk>; | ||
21 | }; | ||
diff --git a/Documentation/devicetree/bindings/gpio/men-a021-wdt.txt b/Documentation/devicetree/bindings/watchdog/men-a021-wdt.txt index 370dee3226d9..370dee3226d9 100644 --- a/Documentation/devicetree/bindings/gpio/men-a021-wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/men-a021-wdt.txt | |||
diff --git a/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt b/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt new file mode 100644 index 000000000000..1169857d1d12 --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/moxa,moxart-watchdog.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | MOXA ART Watchdog timer | ||
2 | |||
3 | Required properties: | ||
4 | |||
5 | - compatible : Must be "moxa,moxart-watchdog" | ||
6 | - reg : Should contain registers location and length | ||
7 | - clocks : Should contain phandle for the clock that drives the counter | ||
8 | |||
9 | Example: | ||
10 | |||
11 | watchdog: watchdog@98500000 { | ||
12 | compatible = "moxa,moxart-watchdog"; | ||
13 | reg = <0x98500000 0x10>; | ||
14 | clocks = <&coreclk>; | ||
15 | }; | ||
diff --git a/Documentation/devicetree/bindings/watchdog/rt2880-wdt.txt b/Documentation/devicetree/bindings/watchdog/rt2880-wdt.txt new file mode 100644 index 000000000000..d7bab3db9d1f --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/rt2880-wdt.txt | |||
@@ -0,0 +1,19 @@ | |||
1 | Ralink Watchdog Timers | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: must be "ralink,rt2880-wdt" | ||
5 | - reg: physical base address of the controller and length of the register range | ||
6 | |||
7 | Optional properties: | ||
8 | - interrupt-parent: phandle to the INTC device node | ||
9 | - interrupts: Specify the INTC interrupt number | ||
10 | |||
11 | Example: | ||
12 | |||
13 | watchdog@120 { | ||
14 | compatible = "ralink,rt2880-wdt"; | ||
15 | reg = <0x120 0x10>; | ||
16 | |||
17 | interrupt-parent = <&intc>; | ||
18 | interrupts = <1>; | ||
19 | }; | ||
diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt new file mode 100644 index 000000000000..9cbc76c89b2b --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt | |||
@@ -0,0 +1,14 @@ | |||
1 | SiRFSoC Timer and Watchdog Timer(WDT) Controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: "sirf,prima2-tick" | ||
5 | - reg: Address range of tick timer/WDT register set | ||
6 | - interrupts: interrupt number to the cpu | ||
7 | |||
8 | Example: | ||
9 | |||
10 | timer@b0020000 { | ||
11 | compatible = "sirf,prima2-tick"; | ||
12 | reg = <0xb0020000 0x1000>; | ||
13 | interrupts = <0>; | ||
14 | }; | ||
diff --git a/arch/arm/configs/prima2_defconfig b/arch/arm/configs/prima2_defconfig index 002a1ceadceb..23591dba47a0 100644 --- a/arch/arm/configs/prima2_defconfig +++ b/arch/arm/configs/prima2_defconfig | |||
@@ -39,6 +39,7 @@ CONFIG_SPI=y | |||
39 | CONFIG_SPI_SIRF=y | 39 | CONFIG_SPI_SIRF=y |
40 | CONFIG_SPI_SPIDEV=y | 40 | CONFIG_SPI_SPIDEV=y |
41 | # CONFIG_HWMON is not set | 41 | # CONFIG_HWMON is not set |
42 | CONFIG_WATCHDOG=y | ||
42 | CONFIG_USB_GADGET=y | 43 | CONFIG_USB_GADGET=y |
43 | CONFIG_USB_MASS_STORAGE=m | 44 | CONFIG_USB_MASS_STORAGE=m |
44 | CONFIG_MMC=y | 45 | CONFIG_MMC=y |
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 6df632e0bb55..5be6e919f785 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -392,6 +392,25 @@ config RETU_WATCHDOG | |||
392 | To compile this driver as a module, choose M here: the | 392 | To compile this driver as a module, choose M here: the |
393 | module will be called retu_wdt. | 393 | module will be called retu_wdt. |
394 | 394 | ||
395 | config MOXART_WDT | ||
396 | tristate "MOXART watchdog" | ||
397 | depends on ARCH_MOXART | ||
398 | help | ||
399 | Say Y here to include Watchdog timer support for the watchdog | ||
400 | existing on the MOXA ART SoC series platforms. | ||
401 | |||
402 | To compile this driver as a module, choose M here: the | ||
403 | module will be called moxart_wdt. | ||
404 | |||
405 | config SIRFSOC_WATCHDOG | ||
406 | tristate "SiRFSOC watchdog" | ||
407 | depends on ARCH_SIRF | ||
408 | select WATCHDOG_CORE | ||
409 | default y | ||
410 | help | ||
411 | Support for CSR SiRFprimaII and SiRFatlasVI watchdog. When | ||
412 | the watchdog triggers the system will be reset. | ||
413 | |||
395 | # AVR32 Architecture | 414 | # AVR32 Architecture |
396 | 415 | ||
397 | config AT32AP700X_WDT | 416 | config AT32AP700X_WDT |
@@ -866,6 +885,7 @@ config VIA_WDT | |||
866 | config W83627HF_WDT | 885 | config W83627HF_WDT |
867 | tristate "W83627HF/W83627DHG Watchdog Timer" | 886 | tristate "W83627HF/W83627DHG Watchdog Timer" |
868 | depends on X86 | 887 | depends on X86 |
888 | select WATCHDOG_CORE | ||
869 | ---help--- | 889 | ---help--- |
870 | This is the driver for the hardware watchdog on the W83627HF chipset | 890 | This is the driver for the hardware watchdog on the W83627HF chipset |
871 | as used in Advantech PC-9578 and Tyan S2721-533 motherboards | 891 | as used in Advantech PC-9578 and Tyan S2721-533 motherboards |
@@ -1125,6 +1145,13 @@ config LANTIQ_WDT | |||
1125 | help | 1145 | help |
1126 | Hardware driver for the Lantiq SoC Watchdog Timer. | 1146 | Hardware driver for the Lantiq SoC Watchdog Timer. |
1127 | 1147 | ||
1148 | config RALINK_WDT | ||
1149 | tristate "Ralink SoC watchdog" | ||
1150 | select WATCHDOG_CORE | ||
1151 | depends on RALINK | ||
1152 | help | ||
1153 | Hardware driver for the Ralink SoC Watchdog Timer. | ||
1154 | |||
1128 | # PARISC Architecture | 1155 | # PARISC Architecture |
1129 | 1156 | ||
1130 | # POWERPC Architecture | 1157 | # POWERPC Architecture |
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 8c7b8bcbbdc5..91bd95a64baf 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile | |||
@@ -55,6 +55,8 @@ obj-$(CONFIG_IMX2_WDT) += imx2_wdt.o | |||
55 | obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o | 55 | obj-$(CONFIG_UX500_WATCHDOG) += ux500_wdt.o |
56 | obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o | 56 | obj-$(CONFIG_RETU_WATCHDOG) += retu_wdt.o |
57 | obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o | 57 | obj-$(CONFIG_BCM2835_WDT) += bcm2835_wdt.o |
58 | obj-$(CONFIG_MOXART_WDT) += moxart_wdt.o | ||
59 | obj-$(CONFIG_SIRFSOC_WATCHDOG) += sirfsoc_wdt.o | ||
58 | 60 | ||
59 | # AVR32 Architecture | 61 | # AVR32 Architecture |
60 | obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o | 62 | obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o |
@@ -134,6 +136,7 @@ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o | |||
134 | obj-$(CONFIG_OCTEON_WDT) += octeon-wdt.o | 136 | obj-$(CONFIG_OCTEON_WDT) += octeon-wdt.o |
135 | octeon-wdt-y := octeon-wdt-main.o octeon-wdt-nmi.o | 137 | octeon-wdt-y := octeon-wdt-main.o octeon-wdt-nmi.o |
136 | obj-$(CONFIG_LANTIQ_WDT) += lantiq_wdt.o | 138 | obj-$(CONFIG_LANTIQ_WDT) += lantiq_wdt.o |
139 | obj-$(CONFIG_RALINK_WDT) += rt2880_wdt.o | ||
137 | 140 | ||
138 | # PARISC Architecture | 141 | # PARISC Architecture |
139 | 142 | ||
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index 24a517777fa0..5cf1621def9c 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c | |||
@@ -60,8 +60,7 @@ | |||
60 | #include <linux/types.h> /* For standard types (like size_t) */ | 60 | #include <linux/types.h> /* For standard types (like size_t) */ |
61 | #include <linux/errno.h> /* For the -ENODEV/... values */ | 61 | #include <linux/errno.h> /* For the -ENODEV/... values */ |
62 | #include <linux/kernel.h> /* For printk/panic/... */ | 62 | #include <linux/kernel.h> /* For printk/panic/... */ |
63 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV | 63 | #include <linux/miscdevice.h> /* For struct miscdevice */ |
64 | (WATCHDOG_MINOR) */ | ||
65 | #include <linux/watchdog.h> /* For the watchdog specific items */ | 64 | #include <linux/watchdog.h> /* For the watchdog specific items */ |
66 | #include <linux/fs.h> /* For file operations */ | 65 | #include <linux/fs.h> /* For file operations */ |
67 | #include <linux/ioport.h> /* For io-port access */ | 66 | #include <linux/ioport.h> /* For io-port access */ |
@@ -337,4 +336,3 @@ module_exit(acq_exit); | |||
337 | MODULE_AUTHOR("David Woodhouse"); | 336 | MODULE_AUTHOR("David Woodhouse"); |
338 | MODULE_DESCRIPTION("Acquire Inc. Single Board Computer Watchdog Timer driver"); | 337 | MODULE_DESCRIPTION("Acquire Inc. Single Board Computer Watchdog Timer driver"); |
339 | MODULE_LICENSE("GPL"); | 338 | MODULE_LICENSE("GPL"); |
340 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c index cc6702fc5268..a8961addc59c 100644 --- a/drivers/watchdog/advantechwdt.c +++ b/drivers/watchdog/advantechwdt.c | |||
@@ -345,4 +345,3 @@ module_exit(advwdt_exit); | |||
345 | MODULE_LICENSE("GPL"); | 345 | MODULE_LICENSE("GPL"); |
346 | MODULE_AUTHOR("Marek Michalkiewicz <marekm@linux.org.pl>"); | 346 | MODULE_AUTHOR("Marek Michalkiewicz <marekm@linux.org.pl>"); |
347 | MODULE_DESCRIPTION("Advantech Single Board Computer WDT driver"); | 347 | MODULE_DESCRIPTION("Advantech Single Board Computer WDT driver"); |
348 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c index 41b84936a521..fbb7b94cabfd 100644 --- a/drivers/watchdog/alim1535_wdt.c +++ b/drivers/watchdog/alim1535_wdt.c | |||
@@ -452,4 +452,3 @@ module_exit(watchdog_exit); | |||
452 | MODULE_AUTHOR("Alan Cox"); | 452 | MODULE_AUTHOR("Alan Cox"); |
453 | MODULE_DESCRIPTION("ALi M1535 PMU Watchdog Timer driver"); | 453 | MODULE_DESCRIPTION("ALi M1535 PMU Watchdog Timer driver"); |
454 | MODULE_LICENSE("GPL"); | 454 | MODULE_LICENSE("GPL"); |
455 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c index 5eee55012e33..12f0b762b528 100644 --- a/drivers/watchdog/alim7101_wdt.c +++ b/drivers/watchdog/alim7101_wdt.c | |||
@@ -425,4 +425,3 @@ MODULE_DEVICE_TABLE(pci, alim7101_pci_tbl); | |||
425 | MODULE_AUTHOR("Steve Hill"); | 425 | MODULE_AUTHOR("Steve Hill"); |
426 | MODULE_DESCRIPTION("ALi M7101 PMU Computer Watchdog Timer driver"); | 426 | MODULE_DESCRIPTION("ALi M7101 PMU Computer Watchdog Timer driver"); |
427 | MODULE_LICENSE("GPL"); | 427 | MODULE_LICENSE("GPL"); |
428 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c index b3709f9cf5be..3a996576343a 100644 --- a/drivers/watchdog/ar7_wdt.c +++ b/drivers/watchdog/ar7_wdt.c | |||
@@ -46,7 +46,6 @@ | |||
46 | MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>"); | 46 | MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>"); |
47 | MODULE_DESCRIPTION(LONGNAME); | 47 | MODULE_DESCRIPTION(LONGNAME); |
48 | MODULE_LICENSE("GPL"); | 48 | MODULE_LICENSE("GPL"); |
49 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
50 | 49 | ||
51 | static int margin = 60; | 50 | static int margin = 60; |
52 | module_param(margin, int, 0); | 51 | module_param(margin, int, 0); |
diff --git a/drivers/watchdog/at32ap700x_wdt.c b/drivers/watchdog/at32ap700x_wdt.c index b178e717ef09..afe7d17e6776 100644 --- a/drivers/watchdog/at32ap700x_wdt.c +++ b/drivers/watchdog/at32ap700x_wdt.c | |||
@@ -434,4 +434,3 @@ module_platform_driver_probe(at32_wdt_driver, at32_wdt_probe); | |||
434 | MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>"); | 434 | MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>"); |
435 | MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X"); | 435 | MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X"); |
436 | MODULE_LICENSE("GPL"); | 436 | MODULE_LICENSE("GPL"); |
437 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c index 1c75260b987c..dee6cc21d270 100644 --- a/drivers/watchdog/at91rm9200_wdt.c +++ b/drivers/watchdog/at91rm9200_wdt.c | |||
@@ -269,7 +269,7 @@ static struct platform_driver at91wdt_driver = { | |||
269 | .driver = { | 269 | .driver = { |
270 | .name = "at91_wdt", | 270 | .name = "at91_wdt", |
271 | .owner = THIS_MODULE, | 271 | .owner = THIS_MODULE, |
272 | .of_match_table = of_match_ptr(at91_wdt_dt_ids), | 272 | .of_match_table = at91_wdt_dt_ids, |
273 | }, | 273 | }, |
274 | }; | 274 | }; |
275 | 275 | ||
@@ -297,5 +297,4 @@ module_exit(at91_wdt_exit); | |||
297 | MODULE_AUTHOR("Andrew Victor"); | 297 | MODULE_AUTHOR("Andrew Victor"); |
298 | MODULE_DESCRIPTION("Watchdog driver for Atmel AT91RM9200"); | 298 | MODULE_DESCRIPTION("Watchdog driver for Atmel AT91RM9200"); |
299 | MODULE_LICENSE("GPL"); | 299 | MODULE_LICENSE("GPL"); |
300 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
301 | MODULE_ALIAS("platform:at91_wdt"); | 300 | MODULE_ALIAS("platform:at91_wdt"); |
diff --git a/drivers/watchdog/ath79_wdt.c b/drivers/watchdog/ath79_wdt.c index 37cb09b27b63..9fa1f69dac13 100644 --- a/drivers/watchdog/ath79_wdt.c +++ b/drivers/watchdog/ath79_wdt.c | |||
@@ -329,4 +329,3 @@ MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org"); | |||
329 | MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org"); | 329 | MODULE_AUTHOR("Imre Kaloz <kaloz@openwrt.org"); |
330 | MODULE_LICENSE("GPL v2"); | 330 | MODULE_LICENSE("GPL v2"); |
331 | MODULE_ALIAS("platform:" DRIVER_NAME); | 331 | MODULE_ALIAS("platform:" DRIVER_NAME); |
332 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c index 61566fc47f84..a6a2cebb2587 100644 --- a/drivers/watchdog/bcm2835_wdt.c +++ b/drivers/watchdog/bcm2835_wdt.c | |||
@@ -186,4 +186,3 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | |||
186 | MODULE_AUTHOR("Lubomir Rintel <lkundrak@v3.sk>"); | 186 | MODULE_AUTHOR("Lubomir Rintel <lkundrak@v3.sk>"); |
187 | MODULE_DESCRIPTION("Driver for Broadcom BCM2835 watchdog timer"); | 187 | MODULE_DESCRIPTION("Driver for Broadcom BCM2835 watchdog timer"); |
188 | MODULE_LICENSE("GPL"); | 188 | MODULE_LICENSE("GPL"); |
189 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index a14a58d9d110..4eb188b87f8e 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c | |||
@@ -317,5 +317,4 @@ MODULE_AUTHOR("Miguel Gaio <miguel.gaio@efixo.com>"); | |||
317 | MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); | 317 | MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); |
318 | MODULE_DESCRIPTION("Driver for the Broadcom BCM63xx SoC watchdog"); | 318 | MODULE_DESCRIPTION("Driver for the Broadcom BCM63xx SoC watchdog"); |
319 | MODULE_LICENSE("GPL"); | 319 | MODULE_LICENSE("GPL"); |
320 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
321 | MODULE_ALIAS("platform:bcm63xx-wdt"); | 320 | MODULE_ALIAS("platform:bcm63xx-wdt"); |
diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c index 5d36d6fb4969..a3b6a5b30f9f 100644 --- a/drivers/watchdog/bfin_wdt.c +++ b/drivers/watchdog/bfin_wdt.c | |||
@@ -465,7 +465,6 @@ module_exit(bfin_wdt_exit); | |||
465 | MODULE_AUTHOR("Michele d'Amico, Mike Frysinger <vapier@gentoo.org>"); | 465 | MODULE_AUTHOR("Michele d'Amico, Mike Frysinger <vapier@gentoo.org>"); |
466 | MODULE_DESCRIPTION("Blackfin Watchdog Device Driver"); | 466 | MODULE_DESCRIPTION("Blackfin Watchdog Device Driver"); |
467 | MODULE_LICENSE("GPL"); | 467 | MODULE_LICENSE("GPL"); |
468 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
469 | 468 | ||
470 | module_param(timeout, uint, 0); | 469 | module_param(timeout, uint, 0); |
471 | MODULE_PARM_DESC(timeout, | 470 | MODULE_PARM_DESC(timeout, |
diff --git a/drivers/watchdog/cpu5wdt.c b/drivers/watchdog/cpu5wdt.c index f270bb7bc456..f7ae49edb518 100644 --- a/drivers/watchdog/cpu5wdt.c +++ b/drivers/watchdog/cpu5wdt.c | |||
@@ -289,7 +289,6 @@ MODULE_AUTHOR("Heiko Ronsdorf <hero@ihg.uni-duisburg.de>"); | |||
289 | MODULE_DESCRIPTION("sma cpu5 watchdog driver"); | 289 | MODULE_DESCRIPTION("sma cpu5 watchdog driver"); |
290 | MODULE_SUPPORTED_DEVICE("sma cpu5 watchdog"); | 290 | MODULE_SUPPORTED_DEVICE("sma cpu5 watchdog"); |
291 | MODULE_LICENSE("GPL"); | 291 | MODULE_LICENSE("GPL"); |
292 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
293 | 292 | ||
294 | module_param(port, int, 0); | 293 | module_param(port, int, 0); |
295 | MODULE_PARM_DESC(port, "base address of watchdog card, default is 0x91"); | 294 | MODULE_PARM_DESC(port, "base address of watchdog card, default is 0x91"); |
diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index bead7740c86a..dd625cca1ae5 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c | |||
@@ -267,5 +267,4 @@ MODULE_PARM_DESC(heartbeat, | |||
267 | __MODULE_STRING(DEFAULT_HEARTBEAT)); | 267 | __MODULE_STRING(DEFAULT_HEARTBEAT)); |
268 | 268 | ||
269 | MODULE_LICENSE("GPL"); | 269 | MODULE_LICENSE("GPL"); |
270 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
271 | MODULE_ALIAS("platform:watchdog"); | 270 | MODULE_ALIAS("platform:watchdog"); |
diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c index e621098bf663..a46f5c7ee7ff 100644 --- a/drivers/watchdog/dw_wdt.c +++ b/drivers/watchdog/dw_wdt.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/miscdevice.h> | 29 | #include <linux/miscdevice.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/moduleparam.h> | 31 | #include <linux/moduleparam.h> |
32 | #include <linux/of.h> | ||
32 | #include <linux/pm.h> | 33 | #include <linux/pm.h> |
33 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
34 | #include <linux/spinlock.h> | 35 | #include <linux/spinlock.h> |
@@ -203,12 +204,12 @@ static long dw_wdt_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
203 | 204 | ||
204 | switch (cmd) { | 205 | switch (cmd) { |
205 | case WDIOC_GETSUPPORT: | 206 | case WDIOC_GETSUPPORT: |
206 | return copy_to_user((struct watchdog_info *)arg, &dw_wdt_ident, | 207 | return copy_to_user((void __user *)arg, &dw_wdt_ident, |
207 | sizeof(dw_wdt_ident)) ? -EFAULT : 0; | 208 | sizeof(dw_wdt_ident)) ? -EFAULT : 0; |
208 | 209 | ||
209 | case WDIOC_GETSTATUS: | 210 | case WDIOC_GETSTATUS: |
210 | case WDIOC_GETBOOTSTATUS: | 211 | case WDIOC_GETBOOTSTATUS: |
211 | return put_user(0, (int *)arg); | 212 | return put_user(0, (int __user *)arg); |
212 | 213 | ||
213 | case WDIOC_KEEPALIVE: | 214 | case WDIOC_KEEPALIVE: |
214 | dw_wdt_set_next_heartbeat(); | 215 | dw_wdt_set_next_heartbeat(); |
@@ -252,17 +253,17 @@ static int dw_wdt_release(struct inode *inode, struct file *filp) | |||
252 | return 0; | 253 | return 0; |
253 | } | 254 | } |
254 | 255 | ||
255 | #ifdef CONFIG_PM | 256 | #ifdef CONFIG_PM_SLEEP |
256 | static int dw_wdt_suspend(struct device *dev) | 257 | static int dw_wdt_suspend(struct device *dev) |
257 | { | 258 | { |
258 | clk_disable(dw_wdt.clk); | 259 | clk_disable_unprepare(dw_wdt.clk); |
259 | 260 | ||
260 | return 0; | 261 | return 0; |
261 | } | 262 | } |
262 | 263 | ||
263 | static int dw_wdt_resume(struct device *dev) | 264 | static int dw_wdt_resume(struct device *dev) |
264 | { | 265 | { |
265 | int err = clk_enable(dw_wdt.clk); | 266 | int err = clk_prepare_enable(dw_wdt.clk); |
266 | 267 | ||
267 | if (err) | 268 | if (err) |
268 | return err; | 269 | return err; |
@@ -271,12 +272,9 @@ static int dw_wdt_resume(struct device *dev) | |||
271 | 272 | ||
272 | return 0; | 273 | return 0; |
273 | } | 274 | } |
275 | #endif /* CONFIG_PM_SLEEP */ | ||
274 | 276 | ||
275 | static const struct dev_pm_ops dw_wdt_pm_ops = { | 277 | static SIMPLE_DEV_PM_OPS(dw_wdt_pm_ops, dw_wdt_suspend, dw_wdt_resume); |
276 | .suspend = dw_wdt_suspend, | ||
277 | .resume = dw_wdt_resume, | ||
278 | }; | ||
279 | #endif /* CONFIG_PM */ | ||
280 | 278 | ||
281 | static const struct file_operations wdt_fops = { | 279 | static const struct file_operations wdt_fops = { |
282 | .owner = THIS_MODULE, | 280 | .owner = THIS_MODULE, |
@@ -309,7 +307,7 @@ static int dw_wdt_drv_probe(struct platform_device *pdev) | |||
309 | if (IS_ERR(dw_wdt.clk)) | 307 | if (IS_ERR(dw_wdt.clk)) |
310 | return PTR_ERR(dw_wdt.clk); | 308 | return PTR_ERR(dw_wdt.clk); |
311 | 309 | ||
312 | ret = clk_enable(dw_wdt.clk); | 310 | ret = clk_prepare_enable(dw_wdt.clk); |
313 | if (ret) | 311 | if (ret) |
314 | return ret; | 312 | return ret; |
315 | 313 | ||
@@ -326,7 +324,7 @@ static int dw_wdt_drv_probe(struct platform_device *pdev) | |||
326 | return 0; | 324 | return 0; |
327 | 325 | ||
328 | out_disable_clk: | 326 | out_disable_clk: |
329 | clk_disable(dw_wdt.clk); | 327 | clk_disable_unprepare(dw_wdt.clk); |
330 | 328 | ||
331 | return ret; | 329 | return ret; |
332 | } | 330 | } |
@@ -335,20 +333,27 @@ static int dw_wdt_drv_remove(struct platform_device *pdev) | |||
335 | { | 333 | { |
336 | misc_deregister(&dw_wdt_miscdev); | 334 | misc_deregister(&dw_wdt_miscdev); |
337 | 335 | ||
338 | clk_disable(dw_wdt.clk); | 336 | clk_disable_unprepare(dw_wdt.clk); |
339 | 337 | ||
340 | return 0; | 338 | return 0; |
341 | } | 339 | } |
342 | 340 | ||
341 | #ifdef CONFIG_OF | ||
342 | static const struct of_device_id dw_wdt_of_match[] = { | ||
343 | { .compatible = "snps,dw-wdt", }, | ||
344 | { /* sentinel */ } | ||
345 | }; | ||
346 | MODULE_DEVICE_TABLE(of, dw_wdt_of_match); | ||
347 | #endif | ||
348 | |||
343 | static struct platform_driver dw_wdt_driver = { | 349 | static struct platform_driver dw_wdt_driver = { |
344 | .probe = dw_wdt_drv_probe, | 350 | .probe = dw_wdt_drv_probe, |
345 | .remove = dw_wdt_drv_remove, | 351 | .remove = dw_wdt_drv_remove, |
346 | .driver = { | 352 | .driver = { |
347 | .name = "dw_wdt", | 353 | .name = "dw_wdt", |
348 | .owner = THIS_MODULE, | 354 | .owner = THIS_MODULE, |
349 | #ifdef CONFIG_PM | 355 | .of_match_table = of_match_ptr(dw_wdt_of_match), |
350 | .pm = &dw_wdt_pm_ops, | 356 | .pm = &dw_wdt_pm_ops, |
351 | #endif /* CONFIG_PM */ | ||
352 | }, | 357 | }, |
353 | }; | 358 | }; |
354 | 359 | ||
@@ -357,4 +362,3 @@ module_platform_driver(dw_wdt_driver); | |||
357 | MODULE_AUTHOR("Jamie Iles"); | 362 | MODULE_AUTHOR("Jamie Iles"); |
358 | MODULE_DESCRIPTION("Synopsys DesignWare Watchdog Driver"); | 363 | MODULE_DESCRIPTION("Synopsys DesignWare Watchdog Driver"); |
359 | MODULE_LICENSE("GPL"); | 364 | MODULE_LICENSE("GPL"); |
360 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c index e0574844c313..833e81311848 100644 --- a/drivers/watchdog/ep93xx_wdt.c +++ b/drivers/watchdog/ep93xx_wdt.c | |||
@@ -179,4 +179,3 @@ MODULE_AUTHOR("Ray Lehtiniemi <rayl@mail.com>," | |||
179 | MODULE_DESCRIPTION("EP93xx Watchdog"); | 179 | MODULE_DESCRIPTION("EP93xx Watchdog"); |
180 | MODULE_LICENSE("GPL"); | 180 | MODULE_LICENSE("GPL"); |
181 | MODULE_VERSION(WDT_VERSION); | 181 | MODULE_VERSION(WDT_VERSION); |
182 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c index cd31b8a2a729..23ee53240c4c 100644 --- a/drivers/watchdog/eurotechwdt.c +++ b/drivers/watchdog/eurotechwdt.c | |||
@@ -477,4 +477,3 @@ module_exit(eurwdt_exit); | |||
477 | MODULE_AUTHOR("Rodolfo Giometti"); | 477 | MODULE_AUTHOR("Rodolfo Giometti"); |
478 | MODULE_DESCRIPTION("Driver for Eurotech CPU-1220/1410 on board watchdog"); | 478 | MODULE_DESCRIPTION("Driver for Eurotech CPU-1220/1410 on board watchdog"); |
479 | MODULE_LICENSE("GPL"); | 479 | MODULE_LICENSE("GPL"); |
480 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/gef_wdt.c b/drivers/watchdog/gef_wdt.c index 3755833430dc..25beb30878d7 100644 --- a/drivers/watchdog/gef_wdt.c +++ b/drivers/watchdog/gef_wdt.c | |||
@@ -331,5 +331,4 @@ module_exit(gef_wdt_exit); | |||
331 | MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com>"); | 331 | MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com>"); |
332 | MODULE_DESCRIPTION("GE watchdog driver"); | 332 | MODULE_DESCRIPTION("GE watchdog driver"); |
333 | MODULE_LICENSE("GPL"); | 333 | MODULE_LICENSE("GPL"); |
334 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
335 | MODULE_ALIAS("platform:gef_wdt"); | 334 | MODULE_ALIAS("platform:gef_wdt"); |
diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c index fcd599d4e225..4a6ae84b42bc 100644 --- a/drivers/watchdog/geodewdt.c +++ b/drivers/watchdog/geodewdt.c | |||
@@ -297,4 +297,3 @@ module_exit(geodewdt_exit); | |||
297 | MODULE_AUTHOR("Advanced Micro Devices, Inc"); | 297 | MODULE_AUTHOR("Advanced Micro Devices, Inc"); |
298 | MODULE_DESCRIPTION("Geode GX/LX Watchdog Driver"); | 298 | MODULE_DESCRIPTION("Geode GX/LX Watchdog Driver"); |
299 | MODULE_LICENSE("GPL"); | 299 | MODULE_LICENSE("GPL"); |
300 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 19f3c3fc65f4..45b979d9dd13 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
@@ -881,7 +881,6 @@ MODULE_AUTHOR("Tom Mingarelli"); | |||
881 | MODULE_DESCRIPTION("hp watchdog driver"); | 881 | MODULE_DESCRIPTION("hp watchdog driver"); |
882 | MODULE_LICENSE("GPL"); | 882 | MODULE_LICENSE("GPL"); |
883 | MODULE_VERSION(HPWDT_VERSION); | 883 | MODULE_VERSION(HPWDT_VERSION); |
884 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
885 | 884 | ||
886 | module_param(soft_margin, int, 0); | 885 | module_param(soft_margin, int, 0); |
887 | MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds"); | 886 | MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds"); |
diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c index 2b2ea13d03ea..a72fe9361ddf 100644 --- a/drivers/watchdog/i6300esb.c +++ b/drivers/watchdog/i6300esb.c | |||
@@ -497,4 +497,3 @@ module_pci_driver(esb_driver); | |||
497 | MODULE_AUTHOR("Ross Biro and David Härdeman"); | 497 | MODULE_AUTHOR("Ross Biro and David Härdeman"); |
498 | MODULE_DESCRIPTION("Watchdog driver for Intel 6300ESB chipsets"); | 498 | MODULE_DESCRIPTION("Watchdog driver for Intel 6300ESB chipsets"); |
499 | MODULE_LICENSE("GPL"); | 499 | MODULE_LICENSE("GPL"); |
500 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index 6130321da387..04f8af65acfd 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c | |||
@@ -56,8 +56,6 @@ | |||
56 | #include <linux/types.h> /* For standard types (like size_t) */ | 56 | #include <linux/types.h> /* For standard types (like size_t) */ |
57 | #include <linux/errno.h> /* For the -ENODEV/... values */ | 57 | #include <linux/errno.h> /* For the -ENODEV/... values */ |
58 | #include <linux/kernel.h> /* For printk/panic/... */ | 58 | #include <linux/kernel.h> /* For printk/panic/... */ |
59 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV | ||
60 | (WATCHDOG_MINOR) */ | ||
61 | #include <linux/watchdog.h> /* For the watchdog specific items */ | 59 | #include <linux/watchdog.h> /* For the watchdog specific items */ |
62 | #include <linux/init.h> /* For __init/__exit/... */ | 60 | #include <linux/init.h> /* For __init/__exit/... */ |
63 | #include <linux/fs.h> /* For file operations */ | 61 | #include <linux/fs.h> /* For file operations */ |
@@ -394,7 +392,7 @@ static int iTCO_wdt_probe(struct platform_device *dev) | |||
394 | { | 392 | { |
395 | int ret = -ENODEV; | 393 | int ret = -ENODEV; |
396 | unsigned long val32; | 394 | unsigned long val32; |
397 | struct lpc_ich_info *ich_info = dev->dev.platform_data; | 395 | struct lpc_ich_info *ich_info = dev_get_platdata(&dev->dev); |
398 | 396 | ||
399 | if (!ich_info) | 397 | if (!ich_info) |
400 | goto out; | 398 | goto out; |
@@ -582,5 +580,4 @@ MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>"); | |||
582 | MODULE_DESCRIPTION("Intel TCO WatchDog Timer Driver"); | 580 | MODULE_DESCRIPTION("Intel TCO WatchDog Timer Driver"); |
583 | MODULE_VERSION(DRV_VERSION); | 581 | MODULE_VERSION(DRV_VERSION); |
584 | MODULE_LICENSE("GPL"); | 582 | MODULE_LICENSE("GPL"); |
585 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
586 | MODULE_ALIAS("platform:" DRV_NAME); | 583 | MODULE_ALIAS("platform:" DRV_NAME); |
diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c index eb6b5cc98ec6..7ae36690c449 100644 --- a/drivers/watchdog/ib700wdt.c +++ b/drivers/watchdog/ib700wdt.c | |||
@@ -382,6 +382,5 @@ module_exit(ibwdt_exit); | |||
382 | MODULE_AUTHOR("Charles Howes <chowes@vsol.net>"); | 382 | MODULE_AUTHOR("Charles Howes <chowes@vsol.net>"); |
383 | MODULE_DESCRIPTION("IB700 SBC watchdog driver"); | 383 | MODULE_DESCRIPTION("IB700 SBC watchdog driver"); |
384 | MODULE_LICENSE("GPL"); | 384 | MODULE_LICENSE("GPL"); |
385 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
386 | 385 | ||
387 | /* end of ib700wdt.c */ | 386 | /* end of ib700wdt.c */ |
diff --git a/drivers/watchdog/ibmasr.c b/drivers/watchdog/ibmasr.c index bc3fb8fe89ab..db0a34460e57 100644 --- a/drivers/watchdog/ibmasr.c +++ b/drivers/watchdog/ibmasr.c | |||
@@ -419,4 +419,3 @@ MODULE_PARM_DESC(nowayout, | |||
419 | MODULE_DESCRIPTION("IBM Automatic Server Restart driver"); | 419 | MODULE_DESCRIPTION("IBM Automatic Server Restart driver"); |
420 | MODULE_AUTHOR("Andrey Panin"); | 420 | MODULE_AUTHOR("Andrey Panin"); |
421 | MODULE_LICENSE("GPL"); | 421 | MODULE_LICENSE("GPL"); |
422 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/ie6xx_wdt.c b/drivers/watchdog/ie6xx_wdt.c index e24ef6a6e064..70a240297c6d 100644 --- a/drivers/watchdog/ie6xx_wdt.c +++ b/drivers/watchdog/ie6xx_wdt.c | |||
@@ -344,5 +344,4 @@ module_exit(ie6xx_wdt_exit); | |||
344 | MODULE_AUTHOR("Alexander Stein <alexander.stein@systec-electronic.com>"); | 344 | MODULE_AUTHOR("Alexander Stein <alexander.stein@systec-electronic.com>"); |
345 | MODULE_DESCRIPTION("Intel Atom E6xx Watchdog Device Driver"); | 345 | MODULE_DESCRIPTION("Intel Atom E6xx Watchdog Device Driver"); |
346 | MODULE_LICENSE("GPL"); | 346 | MODULE_LICENSE("GPL"); |
347 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
348 | MODULE_ALIAS("platform:" DRIVER_NAME); | 347 | MODULE_ALIAS("platform:" DRIVER_NAME); |
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index 693ac3f4de5a..b4786bccc42c 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c | |||
@@ -322,6 +322,7 @@ static const struct of_device_id imx2_wdt_dt_ids[] = { | |||
322 | { .compatible = "fsl,imx21-wdt", }, | 322 | { .compatible = "fsl,imx21-wdt", }, |
323 | { /* sentinel */ } | 323 | { /* sentinel */ } |
324 | }; | 324 | }; |
325 | MODULE_DEVICE_TABLE(of, imx2_wdt_dt_ids); | ||
325 | 326 | ||
326 | static struct platform_driver imx2_wdt_driver = { | 327 | static struct platform_driver imx2_wdt_driver = { |
327 | .remove = __exit_p(imx2_wdt_remove), | 328 | .remove = __exit_p(imx2_wdt_remove), |
@@ -338,5 +339,4 @@ module_platform_driver_probe(imx2_wdt_driver, imx2_wdt_probe); | |||
338 | MODULE_AUTHOR("Wolfram Sang"); | 339 | MODULE_AUTHOR("Wolfram Sang"); |
339 | MODULE_DESCRIPTION("Watchdog driver for IMX2 and later"); | 340 | MODULE_DESCRIPTION("Watchdog driver for IMX2 and later"); |
340 | MODULE_LICENSE("GPL v2"); | 341 | MODULE_LICENSE("GPL v2"); |
341 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
342 | MODULE_ALIAS("platform:" DRIVER_NAME); | 342 | MODULE_ALIAS("platform:" DRIVER_NAME); |
diff --git a/drivers/watchdog/indydog.c b/drivers/watchdog/indydog.c index 6d90f7a2ce22..1b5c25a47b87 100644 --- a/drivers/watchdog/indydog.c +++ b/drivers/watchdog/indydog.c | |||
@@ -214,4 +214,3 @@ module_exit(watchdog_exit); | |||
214 | MODULE_AUTHOR("Guido Guenther <agx@sigxcpu.org>"); | 214 | MODULE_AUTHOR("Guido Guenther <agx@sigxcpu.org>"); |
215 | MODULE_DESCRIPTION("Hardware Watchdog Device for SGI IP22"); | 215 | MODULE_DESCRIPTION("Hardware Watchdog Device for SGI IP22"); |
216 | MODULE_LICENSE("GPL"); | 216 | MODULE_LICENSE("GPL"); |
217 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/intel_scu_watchdog.c b/drivers/watchdog/intel_scu_watchdog.c index 8ced25613956..e13e65e996aa 100644 --- a/drivers/watchdog/intel_scu_watchdog.c +++ b/drivers/watchdog/intel_scu_watchdog.c | |||
@@ -564,5 +564,4 @@ module_exit(intel_scu_watchdog_exit); | |||
564 | MODULE_AUTHOR("Intel Corporation"); | 564 | MODULE_AUTHOR("Intel Corporation"); |
565 | MODULE_DESCRIPTION("Intel SCU Watchdog Device Driver"); | 565 | MODULE_DESCRIPTION("Intel SCU Watchdog Device Driver"); |
566 | MODULE_LICENSE("GPL"); | 566 | MODULE_LICENSE("GPL"); |
567 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
568 | MODULE_VERSION(WDT_VER); | 567 | MODULE_VERSION(WDT_VER); |
diff --git a/drivers/watchdog/iop_wdt.c b/drivers/watchdog/iop_wdt.c index d964faf1a250..b16013ffacc2 100644 --- a/drivers/watchdog/iop_wdt.c +++ b/drivers/watchdog/iop_wdt.c | |||
@@ -259,4 +259,3 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); | |||
259 | MODULE_AUTHOR("Curt E Bruns <curt.e.bruns@intel.com>"); | 259 | MODULE_AUTHOR("Curt E Bruns <curt.e.bruns@intel.com>"); |
260 | MODULE_DESCRIPTION("iop watchdog timer driver"); | 260 | MODULE_DESCRIPTION("iop watchdog timer driver"); |
261 | MODULE_LICENSE("GPL"); | 261 | MODULE_LICENSE("GPL"); |
262 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c index f4cce6d66a55..41b3979a9d87 100644 --- a/drivers/watchdog/it8712f_wdt.c +++ b/drivers/watchdog/it8712f_wdt.c | |||
@@ -41,7 +41,6 @@ | |||
41 | MODULE_AUTHOR("Jorge Boncompte - DTI2 <jorge@dti2.net>"); | 41 | MODULE_AUTHOR("Jorge Boncompte - DTI2 <jorge@dti2.net>"); |
42 | MODULE_DESCRIPTION("IT8712F Watchdog Driver"); | 42 | MODULE_DESCRIPTION("IT8712F Watchdog Driver"); |
43 | MODULE_LICENSE("GPL"); | 43 | MODULE_LICENSE("GPL"); |
44 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
45 | 44 | ||
46 | static int max_units = 255; | 45 | static int max_units = 255; |
47 | static int margin = 60; /* in seconds */ | 46 | static int margin = 60; /* in seconds */ |
diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c index d3dcc6988b5f..e2bba68ae71e 100644 --- a/drivers/watchdog/it87_wdt.c +++ b/drivers/watchdog/it87_wdt.c | |||
@@ -772,4 +772,3 @@ module_exit(it87_wdt_exit); | |||
772 | MODULE_AUTHOR("Oliver Schuster"); | 772 | MODULE_AUTHOR("Oliver Schuster"); |
773 | MODULE_DESCRIPTION("Hardware Watchdog Device Driver for IT87xx EC-LPC I/O"); | 773 | MODULE_DESCRIPTION("Hardware Watchdog Device Driver for IT87xx EC-LPC I/O"); |
774 | MODULE_LICENSE("GPL"); | 774 | MODULE_LICENSE("GPL"); |
775 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/ixp4xx_wdt.c b/drivers/watchdog/ixp4xx_wdt.c index 5580b4fff7fe..f20cc53ff719 100644 --- a/drivers/watchdog/ixp4xx_wdt.c +++ b/drivers/watchdog/ixp4xx_wdt.c | |||
@@ -208,5 +208,3 @@ module_param(nowayout, bool, 0); | |||
208 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); | 208 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); |
209 | 209 | ||
210 | MODULE_LICENSE("GPL"); | 210 | MODULE_LICENSE("GPL"); |
211 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
212 | |||
diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c index d1afdf684c18..2de486a7eea1 100644 --- a/drivers/watchdog/jz4740_wdt.c +++ b/drivers/watchdog/jz4740_wdt.c | |||
@@ -222,5 +222,4 @@ module_platform_driver(jz4740_wdt_driver); | |||
222 | MODULE_AUTHOR("Paul Cercueil <paul@crapouillou.net>"); | 222 | MODULE_AUTHOR("Paul Cercueil <paul@crapouillou.net>"); |
223 | MODULE_DESCRIPTION("jz4740 Watchdog Driver"); | 223 | MODULE_DESCRIPTION("jz4740 Watchdog Driver"); |
224 | MODULE_LICENSE("GPL"); | 224 | MODULE_LICENSE("GPL"); |
225 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
226 | MODULE_ALIAS("platform:jz4740-wdt"); | 225 | MODULE_ALIAS("platform:jz4740-wdt"); |
diff --git a/drivers/watchdog/kempld_wdt.c b/drivers/watchdog/kempld_wdt.c index 5c3d4df63e68..a1a3638c579c 100644 --- a/drivers/watchdog/kempld_wdt.c +++ b/drivers/watchdog/kempld_wdt.c | |||
@@ -67,7 +67,7 @@ enum { | |||
67 | PRESCALER_12, | 67 | PRESCALER_12, |
68 | }; | 68 | }; |
69 | 69 | ||
70 | const u32 kempld_prescaler[] = { | 70 | static const u32 kempld_prescaler[] = { |
71 | [PRESCALER_21] = (1 << 21) - 1, | 71 | [PRESCALER_21] = (1 << 21) - 1, |
72 | [PRESCALER_17] = (1 << 17) - 1, | 72 | [PRESCALER_17] = (1 << 17) - 1, |
73 | [PRESCALER_12] = (1 << 12) - 1, | 73 | [PRESCALER_12] = (1 << 12) - 1, |
@@ -361,7 +361,7 @@ static long kempld_wdt_ioctl(struct watchdog_device *wdd, unsigned int cmd, | |||
361 | ret = kempld_wdt_keepalive(wdd); | 361 | ret = kempld_wdt_keepalive(wdd); |
362 | break; | 362 | break; |
363 | case WDIOC_GETPRETIMEOUT: | 363 | case WDIOC_GETPRETIMEOUT: |
364 | ret = put_user(wdt_data->pretimeout, (int *)arg); | 364 | ret = put_user(wdt_data->pretimeout, (int __user *)arg); |
365 | break; | 365 | break; |
366 | } | 366 | } |
367 | 367 | ||
@@ -578,4 +578,3 @@ module_platform_driver(kempld_wdt_driver); | |||
578 | MODULE_DESCRIPTION("KEM PLD Watchdog Driver"); | 578 | MODULE_DESCRIPTION("KEM PLD Watchdog Driver"); |
579 | MODULE_AUTHOR("Michael Brunner <michael.brunner@kontron.com>"); | 579 | MODULE_AUTHOR("Michael Brunner <michael.brunner@kontron.com>"); |
580 | MODULE_LICENSE("GPL"); | 580 | MODULE_LICENSE("GPL"); |
581 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c index dce9ecffd44a..40ca5594a336 100644 --- a/drivers/watchdog/ks8695_wdt.c +++ b/drivers/watchdog/ks8695_wdt.c | |||
@@ -323,5 +323,4 @@ module_exit(ks8695_wdt_exit); | |||
323 | MODULE_AUTHOR("Andrew Victor"); | 323 | MODULE_AUTHOR("Andrew Victor"); |
324 | MODULE_DESCRIPTION("Watchdog driver for KS8695"); | 324 | MODULE_DESCRIPTION("Watchdog driver for KS8695"); |
325 | MODULE_LICENSE("GPL"); | 325 | MODULE_LICENSE("GPL"); |
326 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
327 | MODULE_ALIAS("platform:ks8695_wdt"); | 326 | MODULE_ALIAS("platform:ks8695_wdt"); |
diff --git a/drivers/watchdog/lantiq_wdt.c b/drivers/watchdog/lantiq_wdt.c index 088fd0c9d888..3b3148c764a3 100644 --- a/drivers/watchdog/lantiq_wdt.c +++ b/drivers/watchdog/lantiq_wdt.c | |||
@@ -249,4 +249,3 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); | |||
249 | MODULE_AUTHOR("John Crispin <blogic@openwrt.org>"); | 249 | MODULE_AUTHOR("John Crispin <blogic@openwrt.org>"); |
250 | MODULE_DESCRIPTION("Lantiq SoC Watchdog"); | 250 | MODULE_DESCRIPTION("Lantiq SoC Watchdog"); |
251 | MODULE_LICENSE("GPL"); | 251 | MODULE_LICENSE("GPL"); |
252 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/m54xx_wdt.c b/drivers/watchdog/m54xx_wdt.c index 173494a681e6..da6fa2b68074 100644 --- a/drivers/watchdog/m54xx_wdt.c +++ b/drivers/watchdog/m54xx_wdt.c | |||
@@ -223,4 +223,3 @@ module_param(nowayout, bool, 0); | |||
223 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); | 223 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); |
224 | 224 | ||
225 | MODULE_LICENSE("GPL"); | 225 | MODULE_LICENSE("GPL"); |
226 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c index bf84f788e592..9826b59ef734 100644 --- a/drivers/watchdog/machzwd.c +++ b/drivers/watchdog/machzwd.c | |||
@@ -92,7 +92,6 @@ static unsigned short zf_readw(unsigned char port) | |||
92 | MODULE_AUTHOR("Fernando Fuganti <fuganti@conectiva.com.br>"); | 92 | MODULE_AUTHOR("Fernando Fuganti <fuganti@conectiva.com.br>"); |
93 | MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver"); | 93 | MODULE_DESCRIPTION("MachZ ZF-Logic Watchdog driver"); |
94 | MODULE_LICENSE("GPL"); | 94 | MODULE_LICENSE("GPL"); |
95 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
96 | 95 | ||
97 | static bool nowayout = WATCHDOG_NOWAYOUT; | 96 | static bool nowayout = WATCHDOG_NOWAYOUT; |
98 | module_param(nowayout, bool, 0); | 97 | module_param(nowayout, bool, 0); |
diff --git a/drivers/watchdog/max63xx_wdt.c b/drivers/watchdog/max63xx_wdt.c index cc9d328086ed..6d4f3998e1f6 100644 --- a/drivers/watchdog/max63xx_wdt.c +++ b/drivers/watchdog/max63xx_wdt.c | |||
@@ -258,4 +258,3 @@ MODULE_PARM_DESC(nodelay, | |||
258 | "(max6373/74 only, default=0)"); | 258 | "(max6373/74 only, default=0)"); |
259 | 259 | ||
260 | MODULE_LICENSE("GPL"); | 260 | MODULE_LICENSE("GPL"); |
261 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c index 97d62ee50341..be86ea359eee 100644 --- a/drivers/watchdog/mixcomwd.c +++ b/drivers/watchdog/mixcomwd.c | |||
@@ -315,4 +315,3 @@ MODULE_AUTHOR("Gergely Madarasz <gorgo@itc.hu>"); | |||
315 | MODULE_DESCRIPTION("MixCom Watchdog driver"); | 315 | MODULE_DESCRIPTION("MixCom Watchdog driver"); |
316 | MODULE_VERSION(VERSION); | 316 | MODULE_VERSION(VERSION); |
317 | MODULE_LICENSE("GPL"); | 317 | MODULE_LICENSE("GPL"); |
318 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/moxart_wdt.c b/drivers/watchdog/moxart_wdt.c new file mode 100644 index 000000000000..4166e4d116a8 --- /dev/null +++ b/drivers/watchdog/moxart_wdt.c | |||
@@ -0,0 +1,165 @@ | |||
1 | /* | ||
2 | * MOXA ART SoCs watchdog driver. | ||
3 | * | ||
4 | * Copyright (C) 2013 Jonas Jensen | ||
5 | * | ||
6 | * Jonas Jensen <jonas.jensen@gmail.com> | ||
7 | * | ||
8 | * This file is licensed under the terms of the GNU General Public | ||
9 | * License version 2. This program is licensed "as is" without any | ||
10 | * warranty of any kind, whether express or implied. | ||
11 | */ | ||
12 | |||
13 | #include <linux/clk.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/err.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/platform_device.h> | ||
19 | #include <linux/watchdog.h> | ||
20 | #include <linux/moduleparam.h> | ||
21 | |||
22 | #define REG_COUNT 0x4 | ||
23 | #define REG_MODE 0x8 | ||
24 | #define REG_ENABLE 0xC | ||
25 | |||
26 | struct moxart_wdt_dev { | ||
27 | struct watchdog_device dev; | ||
28 | void __iomem *base; | ||
29 | unsigned int clock_frequency; | ||
30 | }; | ||
31 | |||
32 | static int heartbeat; | ||
33 | |||
34 | static int moxart_wdt_stop(struct watchdog_device *wdt_dev) | ||
35 | { | ||
36 | struct moxart_wdt_dev *moxart_wdt = watchdog_get_drvdata(wdt_dev); | ||
37 | |||
38 | writel(0, moxart_wdt->base + REG_ENABLE); | ||
39 | |||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | static int moxart_wdt_start(struct watchdog_device *wdt_dev) | ||
44 | { | ||
45 | struct moxart_wdt_dev *moxart_wdt = watchdog_get_drvdata(wdt_dev); | ||
46 | |||
47 | writel(moxart_wdt->clock_frequency * wdt_dev->timeout, | ||
48 | moxart_wdt->base + REG_COUNT); | ||
49 | writel(0x5ab9, moxart_wdt->base + REG_MODE); | ||
50 | writel(0x03, moxart_wdt->base + REG_ENABLE); | ||
51 | |||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | static int moxart_wdt_set_timeout(struct watchdog_device *wdt_dev, | ||
56 | unsigned int timeout) | ||
57 | { | ||
58 | wdt_dev->timeout = timeout; | ||
59 | |||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | static const struct watchdog_info moxart_wdt_info = { | ||
64 | .identity = "moxart-wdt", | ||
65 | .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | | ||
66 | WDIOF_MAGICCLOSE, | ||
67 | }; | ||
68 | |||
69 | static const struct watchdog_ops moxart_wdt_ops = { | ||
70 | .owner = THIS_MODULE, | ||
71 | .start = moxart_wdt_start, | ||
72 | .stop = moxart_wdt_stop, | ||
73 | .set_timeout = moxart_wdt_set_timeout, | ||
74 | }; | ||
75 | |||
76 | static int moxart_wdt_probe(struct platform_device *pdev) | ||
77 | { | ||
78 | struct moxart_wdt_dev *moxart_wdt; | ||
79 | struct device *dev = &pdev->dev; | ||
80 | struct device_node *node = dev->of_node; | ||
81 | struct resource *res; | ||
82 | struct clk *clk; | ||
83 | int err; | ||
84 | unsigned int max_timeout; | ||
85 | bool nowayout = WATCHDOG_NOWAYOUT; | ||
86 | |||
87 | moxart_wdt = devm_kzalloc(dev, sizeof(*moxart_wdt), GFP_KERNEL); | ||
88 | if (!moxart_wdt) | ||
89 | return -ENOMEM; | ||
90 | |||
91 | platform_set_drvdata(pdev, moxart_wdt); | ||
92 | |||
93 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
94 | moxart_wdt->base = devm_ioremap_resource(dev, res); | ||
95 | if (IS_ERR(moxart_wdt->base)) | ||
96 | return PTR_ERR(moxart_wdt->base); | ||
97 | |||
98 | clk = of_clk_get(node, 0); | ||
99 | if (IS_ERR(clk)) { | ||
100 | pr_err("%s: of_clk_get failed\n", __func__); | ||
101 | return PTR_ERR(clk); | ||
102 | } | ||
103 | |||
104 | moxart_wdt->clock_frequency = clk_get_rate(clk); | ||
105 | if (moxart_wdt->clock_frequency == 0) { | ||
106 | pr_err("%s: incorrect clock frequency\n", __func__); | ||
107 | return -EINVAL; | ||
108 | } | ||
109 | |||
110 | max_timeout = UINT_MAX / moxart_wdt->clock_frequency; | ||
111 | |||
112 | moxart_wdt->dev.info = &moxart_wdt_info; | ||
113 | moxart_wdt->dev.ops = &moxart_wdt_ops; | ||
114 | moxart_wdt->dev.timeout = max_timeout; | ||
115 | moxart_wdt->dev.min_timeout = 1; | ||
116 | moxart_wdt->dev.max_timeout = max_timeout; | ||
117 | moxart_wdt->dev.parent = dev; | ||
118 | |||
119 | watchdog_init_timeout(&moxart_wdt->dev, heartbeat, dev); | ||
120 | watchdog_set_nowayout(&moxart_wdt->dev, nowayout); | ||
121 | |||
122 | watchdog_set_drvdata(&moxart_wdt->dev, moxart_wdt); | ||
123 | |||
124 | err = watchdog_register_device(&moxart_wdt->dev); | ||
125 | if (err) | ||
126 | return err; | ||
127 | |||
128 | dev_dbg(dev, "Watchdog enabled (heartbeat=%d sec, nowayout=%d)\n", | ||
129 | moxart_wdt->dev.timeout, nowayout); | ||
130 | |||
131 | return 0; | ||
132 | } | ||
133 | |||
134 | static int moxart_wdt_remove(struct platform_device *pdev) | ||
135 | { | ||
136 | struct moxart_wdt_dev *moxart_wdt = platform_get_drvdata(pdev); | ||
137 | |||
138 | moxart_wdt_stop(&moxart_wdt->dev); | ||
139 | watchdog_unregister_device(&moxart_wdt->dev); | ||
140 | |||
141 | return 0; | ||
142 | } | ||
143 | |||
144 | static const struct of_device_id moxart_watchdog_match[] = { | ||
145 | { .compatible = "moxa,moxart-watchdog" }, | ||
146 | { }, | ||
147 | }; | ||
148 | |||
149 | static struct platform_driver moxart_wdt_driver = { | ||
150 | .probe = moxart_wdt_probe, | ||
151 | .remove = moxart_wdt_remove, | ||
152 | .driver = { | ||
153 | .name = "moxart-watchdog", | ||
154 | .owner = THIS_MODULE, | ||
155 | .of_match_table = moxart_watchdog_match, | ||
156 | }, | ||
157 | }; | ||
158 | module_platform_driver(moxart_wdt_driver); | ||
159 | |||
160 | module_param(heartbeat, int, 0); | ||
161 | MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds"); | ||
162 | |||
163 | MODULE_DESCRIPTION("MOXART watchdog driver"); | ||
164 | MODULE_LICENSE("GPL"); | ||
165 | MODULE_AUTHOR("Jonas Jensen <jonas.jensen@gmail.com>"); | ||
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c index d0ebebae607c..d82152077fd9 100644 --- a/drivers/watchdog/mpc8xxx_wdt.c +++ b/drivers/watchdog/mpc8xxx_wdt.c | |||
@@ -330,4 +330,3 @@ MODULE_AUTHOR("Dave Updegraff, Kumar Gala"); | |||
330 | MODULE_DESCRIPTION("Driver for watchdog timer in MPC8xx/MPC83xx/MPC86xx " | 330 | MODULE_DESCRIPTION("Driver for watchdog timer in MPC8xx/MPC83xx/MPC86xx " |
331 | "uProcessors"); | 331 | "uProcessors"); |
332 | MODULE_LICENSE("GPL"); | 332 | MODULE_LICENSE("GPL"); |
333 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c index b4341110ad4f..edb31ffd7927 100644 --- a/drivers/watchdog/mtx-1_wdt.c +++ b/drivers/watchdog/mtx-1_wdt.c | |||
@@ -257,5 +257,4 @@ module_platform_driver(mtx1_wdt_driver); | |||
257 | MODULE_AUTHOR("Michael Stickel, Florian Fainelli"); | 257 | MODULE_AUTHOR("Michael Stickel, Florian Fainelli"); |
258 | MODULE_DESCRIPTION("Driver for the MTX-1 watchdog"); | 258 | MODULE_DESCRIPTION("Driver for the MTX-1 watchdog"); |
259 | MODULE_LICENSE("GPL"); | 259 | MODULE_LICENSE("GPL"); |
260 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
261 | MODULE_ALIAS("platform:mtx1-wdt"); | 260 | MODULE_ALIAS("platform:mtx1-wdt"); |
diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c index e4cf98019265..f9fa58409396 100644 --- a/drivers/watchdog/mv64x60_wdt.c +++ b/drivers/watchdog/mv64x60_wdt.c | |||
@@ -255,7 +255,7 @@ static struct miscdevice mv64x60_wdt_miscdev = { | |||
255 | 255 | ||
256 | static int mv64x60_wdt_probe(struct platform_device *dev) | 256 | static int mv64x60_wdt_probe(struct platform_device *dev) |
257 | { | 257 | { |
258 | struct mv64x60_wdt_pdata *pdata = dev->dev.platform_data; | 258 | struct mv64x60_wdt_pdata *pdata = dev_get_platdata(&dev->dev); |
259 | struct resource *r; | 259 | struct resource *r; |
260 | int timeout = 10; | 260 | int timeout = 10; |
261 | 261 | ||
@@ -323,5 +323,4 @@ module_exit(mv64x60_wdt_exit); | |||
323 | MODULE_AUTHOR("James Chapman <jchapman@katalix.com>"); | 323 | MODULE_AUTHOR("James Chapman <jchapman@katalix.com>"); |
324 | MODULE_DESCRIPTION("MV64x60 watchdog driver"); | 324 | MODULE_DESCRIPTION("MV64x60 watchdog driver"); |
325 | MODULE_LICENSE("GPL"); | 325 | MODULE_LICENSE("GPL"); |
326 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
327 | MODULE_ALIAS("platform:" MV64x60_WDT_NAME); | 326 | MODULE_ALIAS("platform:" MV64x60_WDT_NAME); |
diff --git a/drivers/watchdog/nuc900_wdt.c b/drivers/watchdog/nuc900_wdt.c index b15b6efd91a1..a0d893b0930e 100644 --- a/drivers/watchdog/nuc900_wdt.c +++ b/drivers/watchdog/nuc900_wdt.c | |||
@@ -307,5 +307,4 @@ module_platform_driver(nuc900wdt_driver); | |||
307 | MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); | 307 | MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); |
308 | MODULE_DESCRIPTION("Watchdog driver for NUC900"); | 308 | MODULE_DESCRIPTION("Watchdog driver for NUC900"); |
309 | MODULE_LICENSE("GPL"); | 309 | MODULE_LICENSE("GPL"); |
310 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
311 | MODULE_ALIAS("platform:nuc900-wdt"); | 310 | MODULE_ALIAS("platform:nuc900-wdt"); |
diff --git a/drivers/watchdog/nv_tco.c b/drivers/watchdog/nv_tco.c index 59cf19eeea07..231e5b9d5c8e 100644 --- a/drivers/watchdog/nv_tco.c +++ b/drivers/watchdog/nv_tco.c | |||
@@ -513,4 +513,3 @@ module_exit(nv_tco_cleanup_module); | |||
513 | MODULE_AUTHOR("Mike Waychison"); | 513 | MODULE_AUTHOR("Mike Waychison"); |
514 | MODULE_DESCRIPTION("TCO timer driver for NV chipsets"); | 514 | MODULE_DESCRIPTION("TCO timer driver for NV chipsets"); |
515 | MODULE_LICENSE("GPL"); | 515 | MODULE_LICENSE("GPL"); |
516 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 4dd281f2c33f..fb57103c8ebc 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c | |||
@@ -405,4 +405,3 @@ module_platform_driver(xwdt_driver); | |||
405 | MODULE_AUTHOR("Alejandro Cabrera <aldaya@gmail.com>"); | 405 | MODULE_AUTHOR("Alejandro Cabrera <aldaya@gmail.com>"); |
406 | MODULE_DESCRIPTION("Xilinx Watchdog driver"); | 406 | MODULE_DESCRIPTION("Xilinx Watchdog driver"); |
407 | MODULE_LICENSE("GPL v2"); | 407 | MODULE_LICENSE("GPL v2"); |
408 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index af88ffd1068f..09cf0135e8ac 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
@@ -68,14 +68,14 @@ static void omap_wdt_reload(struct omap_wdt_dev *wdev) | |||
68 | void __iomem *base = wdev->base; | 68 | void __iomem *base = wdev->base; |
69 | 69 | ||
70 | /* wait for posted write to complete */ | 70 | /* wait for posted write to complete */ |
71 | while ((__raw_readl(base + OMAP_WATCHDOG_WPS)) & 0x08) | 71 | while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x08) |
72 | cpu_relax(); | 72 | cpu_relax(); |
73 | 73 | ||
74 | wdev->wdt_trgr_pattern = ~wdev->wdt_trgr_pattern; | 74 | wdev->wdt_trgr_pattern = ~wdev->wdt_trgr_pattern; |
75 | __raw_writel(wdev->wdt_trgr_pattern, (base + OMAP_WATCHDOG_TGR)); | 75 | writel_relaxed(wdev->wdt_trgr_pattern, (base + OMAP_WATCHDOG_TGR)); |
76 | 76 | ||
77 | /* wait for posted write to complete */ | 77 | /* wait for posted write to complete */ |
78 | while ((__raw_readl(base + OMAP_WATCHDOG_WPS)) & 0x08) | 78 | while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x08) |
79 | cpu_relax(); | 79 | cpu_relax(); |
80 | /* reloaded WCRR from WLDR */ | 80 | /* reloaded WCRR from WLDR */ |
81 | } | 81 | } |
@@ -85,12 +85,12 @@ static void omap_wdt_enable(struct omap_wdt_dev *wdev) | |||
85 | void __iomem *base = wdev->base; | 85 | void __iomem *base = wdev->base; |
86 | 86 | ||
87 | /* Sequence to enable the watchdog */ | 87 | /* Sequence to enable the watchdog */ |
88 | __raw_writel(0xBBBB, base + OMAP_WATCHDOG_SPR); | 88 | writel_relaxed(0xBBBB, base + OMAP_WATCHDOG_SPR); |
89 | while ((__raw_readl(base + OMAP_WATCHDOG_WPS)) & 0x10) | 89 | while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x10) |
90 | cpu_relax(); | 90 | cpu_relax(); |
91 | 91 | ||
92 | __raw_writel(0x4444, base + OMAP_WATCHDOG_SPR); | 92 | writel_relaxed(0x4444, base + OMAP_WATCHDOG_SPR); |
93 | while ((__raw_readl(base + OMAP_WATCHDOG_WPS)) & 0x10) | 93 | while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x10) |
94 | cpu_relax(); | 94 | cpu_relax(); |
95 | } | 95 | } |
96 | 96 | ||
@@ -99,12 +99,12 @@ static void omap_wdt_disable(struct omap_wdt_dev *wdev) | |||
99 | void __iomem *base = wdev->base; | 99 | void __iomem *base = wdev->base; |
100 | 100 | ||
101 | /* sequence required to disable watchdog */ | 101 | /* sequence required to disable watchdog */ |
102 | __raw_writel(0xAAAA, base + OMAP_WATCHDOG_SPR); /* TIMER_MODE */ | 102 | writel_relaxed(0xAAAA, base + OMAP_WATCHDOG_SPR); /* TIMER_MODE */ |
103 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x10) | 103 | while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x10) |
104 | cpu_relax(); | 104 | cpu_relax(); |
105 | 105 | ||
106 | __raw_writel(0x5555, base + OMAP_WATCHDOG_SPR); /* TIMER_MODE */ | 106 | writel_relaxed(0x5555, base + OMAP_WATCHDOG_SPR); /* TIMER_MODE */ |
107 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x10) | 107 | while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x10) |
108 | cpu_relax(); | 108 | cpu_relax(); |
109 | } | 109 | } |
110 | 110 | ||
@@ -115,11 +115,11 @@ static void omap_wdt_set_timer(struct omap_wdt_dev *wdev, | |||
115 | void __iomem *base = wdev->base; | 115 | void __iomem *base = wdev->base; |
116 | 116 | ||
117 | /* just count up at 32 KHz */ | 117 | /* just count up at 32 KHz */ |
118 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04) | 118 | while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x04) |
119 | cpu_relax(); | 119 | cpu_relax(); |
120 | 120 | ||
121 | __raw_writel(pre_margin, base + OMAP_WATCHDOG_LDR); | 121 | writel_relaxed(pre_margin, base + OMAP_WATCHDOG_LDR); |
122 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x04) | 122 | while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x04) |
123 | cpu_relax(); | 123 | cpu_relax(); |
124 | } | 124 | } |
125 | 125 | ||
@@ -135,11 +135,11 @@ static int omap_wdt_start(struct watchdog_device *wdog) | |||
135 | pm_runtime_get_sync(wdev->dev); | 135 | pm_runtime_get_sync(wdev->dev); |
136 | 136 | ||
137 | /* initialize prescaler */ | 137 | /* initialize prescaler */ |
138 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01) | 138 | while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x01) |
139 | cpu_relax(); | 139 | cpu_relax(); |
140 | 140 | ||
141 | __raw_writel((1 << 5) | (PTV << 2), base + OMAP_WATCHDOG_CNTRL); | 141 | writel_relaxed((1 << 5) | (PTV << 2), base + OMAP_WATCHDOG_CNTRL); |
142 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01) | 142 | while (readl_relaxed(base + OMAP_WATCHDOG_WPS) & 0x01) |
143 | cpu_relax(); | 143 | cpu_relax(); |
144 | 144 | ||
145 | omap_wdt_set_timer(wdev, wdog->timeout); | 145 | omap_wdt_set_timer(wdev, wdog->timeout); |
@@ -205,7 +205,7 @@ static const struct watchdog_ops omap_wdt_ops = { | |||
205 | 205 | ||
206 | static int omap_wdt_probe(struct platform_device *pdev) | 206 | static int omap_wdt_probe(struct platform_device *pdev) |
207 | { | 207 | { |
208 | struct omap_wd_timer_platform_data *pdata = pdev->dev.platform_data; | 208 | struct omap_wd_timer_platform_data *pdata = dev_get_platdata(&pdev->dev); |
209 | struct watchdog_device *omap_wdt; | 209 | struct watchdog_device *omap_wdt; |
210 | struct resource *res, *mem; | 210 | struct resource *res, *mem; |
211 | struct omap_wdt_dev *wdev; | 211 | struct omap_wdt_dev *wdev; |
@@ -275,7 +275,7 @@ static int omap_wdt_probe(struct platform_device *pdev) | |||
275 | } | 275 | } |
276 | 276 | ||
277 | pr_info("OMAP Watchdog Timer Rev 0x%02x: initial timeout %d sec\n", | 277 | pr_info("OMAP Watchdog Timer Rev 0x%02x: initial timeout %d sec\n", |
278 | __raw_readl(wdev->base + OMAP_WATCHDOG_REV) & 0xFF, | 278 | readl_relaxed(wdev->base + OMAP_WATCHDOG_REV) & 0xFF, |
279 | omap_wdt->timeout); | 279 | omap_wdt->timeout); |
280 | 280 | ||
281 | pm_runtime_put_sync(wdev->dev); | 281 | pm_runtime_put_sync(wdev->dev); |
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 4ea5fcccac02..44edca66d564 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c | |||
@@ -207,7 +207,7 @@ static struct platform_driver orion_wdt_driver = { | |||
207 | .driver = { | 207 | .driver = { |
208 | .owner = THIS_MODULE, | 208 | .owner = THIS_MODULE, |
209 | .name = "orion_wdt", | 209 | .name = "orion_wdt", |
210 | .of_match_table = of_match_ptr(orion_wdt_of_match_table), | 210 | .of_match_table = orion_wdt_of_match_table, |
211 | }, | 211 | }, |
212 | }; | 212 | }; |
213 | 213 | ||
@@ -225,4 +225,3 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | |||
225 | 225 | ||
226 | MODULE_LICENSE("GPL"); | 226 | MODULE_LICENSE("GPL"); |
227 | MODULE_ALIAS("platform:orion_wdt"); | 227 | MODULE_ALIAS("platform:orion_wdt"); |
228 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c index 5afb89b48650..5211d56b3681 100644 --- a/drivers/watchdog/pc87413_wdt.c +++ b/drivers/watchdog/pc87413_wdt.c | |||
@@ -580,8 +580,6 @@ MODULE_AUTHOR("Sven Anders <anders@anduras.de>, " | |||
580 | MODULE_DESCRIPTION("PC87413 WDT driver"); | 580 | MODULE_DESCRIPTION("PC87413 WDT driver"); |
581 | MODULE_LICENSE("GPL"); | 581 | MODULE_LICENSE("GPL"); |
582 | 582 | ||
583 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
584 | |||
585 | module_param(io, int, 0); | 583 | module_param(io, int, 0); |
586 | MODULE_PARM_DESC(io, MODNAME " I/O port (default: " | 584 | MODULE_PARM_DESC(io, MODNAME " I/O port (default: " |
587 | __MODULE_STRING(IO_DEFAULT) ")."); | 585 | __MODULE_STRING(IO_DEFAULT) ")."); |
diff --git a/drivers/watchdog/pcwd.c b/drivers/watchdog/pcwd.c index 33e49a7f889f..e936f15dc7c7 100644 --- a/drivers/watchdog/pcwd.c +++ b/drivers/watchdog/pcwd.c | |||
@@ -61,7 +61,7 @@ | |||
61 | #include <linux/delay.h> /* For mdelay function */ | 61 | #include <linux/delay.h> /* For mdelay function */ |
62 | #include <linux/timer.h> /* For timer related operations */ | 62 | #include <linux/timer.h> /* For timer related operations */ |
63 | #include <linux/jiffies.h> /* For jiffies stuff */ | 63 | #include <linux/jiffies.h> /* For jiffies stuff */ |
64 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */ | 64 | #include <linux/miscdevice.h> /* For struct miscdevice */ |
65 | #include <linux/watchdog.h> /* For the watchdog specific items */ | 65 | #include <linux/watchdog.h> /* For the watchdog specific items */ |
66 | #include <linux/reboot.h> /* For kernel_power_off() */ | 66 | #include <linux/reboot.h> /* For kernel_power_off() */ |
67 | #include <linux/init.h> /* For __init/__exit/... */ | 67 | #include <linux/init.h> /* For __init/__exit/... */ |
@@ -1011,5 +1011,3 @@ MODULE_AUTHOR("Ken Hollis <kenji@bitgate.com>, " | |||
1011 | MODULE_DESCRIPTION("Berkshire ISA-PC Watchdog driver"); | 1011 | MODULE_DESCRIPTION("Berkshire ISA-PC Watchdog driver"); |
1012 | MODULE_VERSION(WATCHDOG_VERSION); | 1012 | MODULE_VERSION(WATCHDOG_VERSION); |
1013 | MODULE_LICENSE("GPL"); | 1013 | MODULE_LICENSE("GPL"); |
1014 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
1015 | MODULE_ALIAS_MISCDEV(TEMP_MINOR); | ||
diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c index 7890f84edf76..b4864f254b48 100644 --- a/drivers/watchdog/pcwd_pci.c +++ b/drivers/watchdog/pcwd_pci.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <linux/errno.h> /* For the -ENODEV/... values */ | 40 | #include <linux/errno.h> /* For the -ENODEV/... values */ |
41 | #include <linux/kernel.h> /* For printk/panic/... */ | 41 | #include <linux/kernel.h> /* For printk/panic/... */ |
42 | #include <linux/delay.h> /* For mdelay function */ | 42 | #include <linux/delay.h> /* For mdelay function */ |
43 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */ | 43 | #include <linux/miscdevice.h> /* For struct miscdevice */ |
44 | #include <linux/watchdog.h> /* For the watchdog specific items */ | 44 | #include <linux/watchdog.h> /* For the watchdog specific items */ |
45 | #include <linux/notifier.h> /* For notifier support */ | 45 | #include <linux/notifier.h> /* For notifier support */ |
46 | #include <linux/reboot.h> /* For reboot_notifier stuff */ | 46 | #include <linux/reboot.h> /* For reboot_notifier stuff */ |
@@ -820,5 +820,3 @@ module_pci_driver(pcipcwd_driver); | |||
820 | MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>"); | 820 | MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>"); |
821 | MODULE_DESCRIPTION("Berkshire PCI-PC Watchdog driver"); | 821 | MODULE_DESCRIPTION("Berkshire PCI-PC Watchdog driver"); |
822 | MODULE_LICENSE("GPL"); | 822 | MODULE_LICENSE("GPL"); |
823 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
824 | MODULE_ALIAS_MISCDEV(TEMP_MINOR); | ||
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index 7b14d1847927..b731b5d129be 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <linux/errno.h> /* For the -ENODEV/... values */ | 32 | #include <linux/errno.h> /* For the -ENODEV/... values */ |
33 | #include <linux/kernel.h> /* For printk/panic/... */ | 33 | #include <linux/kernel.h> /* For printk/panic/... */ |
34 | #include <linux/delay.h> /* For mdelay function */ | 34 | #include <linux/delay.h> /* For mdelay function */ |
35 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */ | 35 | #include <linux/miscdevice.h> /* For struct miscdevice */ |
36 | #include <linux/watchdog.h> /* For the watchdog specific items */ | 36 | #include <linux/watchdog.h> /* For the watchdog specific items */ |
37 | #include <linux/notifier.h> /* For notifier support */ | 37 | #include <linux/notifier.h> /* For notifier support */ |
38 | #include <linux/reboot.h> /* For reboot_notifier stuff */ | 38 | #include <linux/reboot.h> /* For reboot_notifier stuff */ |
@@ -72,8 +72,6 @@ do { \ | |||
72 | MODULE_AUTHOR(DRIVER_AUTHOR); | 72 | MODULE_AUTHOR(DRIVER_AUTHOR); |
73 | MODULE_DESCRIPTION(DRIVER_DESC); | 73 | MODULE_DESCRIPTION(DRIVER_DESC); |
74 | MODULE_LICENSE(DRIVER_LICENSE); | 74 | MODULE_LICENSE(DRIVER_LICENSE); |
75 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
76 | MODULE_ALIAS_MISCDEV(TEMP_MINOR); | ||
77 | 75 | ||
78 | /* Module Parameters */ | 76 | /* Module Parameters */ |
79 | module_param(debug, int, 0); | 77 | module_param(debug, int, 0); |
@@ -235,13 +233,17 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, | |||
235 | unsigned char cmd, unsigned char *msb, unsigned char *lsb) | 233 | unsigned char cmd, unsigned char *msb, unsigned char *lsb) |
236 | { | 234 | { |
237 | int got_response, count; | 235 | int got_response, count; |
238 | unsigned char buf[6]; | 236 | unsigned char *buf; |
239 | 237 | ||
240 | /* We will not send any commands if the USB PCWD device does | 238 | /* We will not send any commands if the USB PCWD device does |
241 | * not exist */ | 239 | * not exist */ |
242 | if ((!usb_pcwd) || (!usb_pcwd->exists)) | 240 | if ((!usb_pcwd) || (!usb_pcwd->exists)) |
243 | return -1; | 241 | return -1; |
244 | 242 | ||
243 | buf = kmalloc(6, GFP_KERNEL); | ||
244 | if (buf == NULL) | ||
245 | return 0; | ||
246 | |||
245 | /* The USB PC Watchdog uses a 6 byte report format. | 247 | /* The USB PC Watchdog uses a 6 byte report format. |
246 | * The board currently uses only 3 of the six bytes of the report. */ | 248 | * The board currently uses only 3 of the six bytes of the report. */ |
247 | buf[0] = cmd; /* Byte 0 = CMD */ | 249 | buf[0] = cmd; /* Byte 0 = CMD */ |
@@ -256,8 +258,8 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, | |||
256 | 258 | ||
257 | if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0), | 259 | if (usb_control_msg(usb_pcwd->udev, usb_sndctrlpipe(usb_pcwd->udev, 0), |
258 | HID_REQ_SET_REPORT, HID_DT_REPORT, | 260 | HID_REQ_SET_REPORT, HID_DT_REPORT, |
259 | 0x0200, usb_pcwd->interface_number, buf, sizeof(buf), | 261 | 0x0200, usb_pcwd->interface_number, buf, 6, |
260 | USB_COMMAND_TIMEOUT) != sizeof(buf)) { | 262 | USB_COMMAND_TIMEOUT) != 6) { |
261 | dbg("usb_pcwd_send_command: error in usb_control_msg for " | 263 | dbg("usb_pcwd_send_command: error in usb_control_msg for " |
262 | "cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb); | 264 | "cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb); |
263 | } | 265 | } |
@@ -277,6 +279,8 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, | |||
277 | *lsb = usb_pcwd->cmd_data_lsb; | 279 | *lsb = usb_pcwd->cmd_data_lsb; |
278 | } | 280 | } |
279 | 281 | ||
282 | kfree(buf); | ||
283 | |||
280 | return got_response; | 284 | return got_response; |
281 | } | 285 | } |
282 | 286 | ||
diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c index 329bc60ad7a2..0cdfee266690 100644 --- a/drivers/watchdog/pika_wdt.c +++ b/drivers/watchdog/pika_wdt.c | |||
@@ -299,5 +299,3 @@ module_exit(pikawdt_exit); | |||
299 | MODULE_AUTHOR("Sean MacLennan <smaclennan@pikatech.com>"); | 299 | MODULE_AUTHOR("Sean MacLennan <smaclennan@pikatech.com>"); |
300 | MODULE_DESCRIPTION("PIKA FPGA based Watchdog Timer"); | 300 | MODULE_DESCRIPTION("PIKA FPGA based Watchdog Timer"); |
301 | MODULE_LICENSE("GPL"); | 301 | MODULE_LICENSE("GPL"); |
302 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
303 | |||
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index b30bd430f591..1bdcc313e1d9 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c | |||
@@ -233,5 +233,4 @@ MODULE_PARM_DESC(nowayout, | |||
233 | "Set to 1 to keep watchdog running after device release"); | 233 | "Set to 1 to keep watchdog running after device release"); |
234 | 234 | ||
235 | MODULE_LICENSE("GPL"); | 235 | MODULE_LICENSE("GPL"); |
236 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
237 | MODULE_ALIAS("platform:pnx4008-watchdog"); | 236 | MODULE_ALIAS("platform:pnx4008-watchdog"); |
diff --git a/drivers/watchdog/pnx833x_wdt.c b/drivers/watchdog/pnx833x_wdt.c index 1b62a7dfcc95..882fdcb46ad1 100644 --- a/drivers/watchdog/pnx833x_wdt.c +++ b/drivers/watchdog/pnx833x_wdt.c | |||
@@ -278,4 +278,3 @@ module_exit(watchdog_exit); | |||
278 | MODULE_AUTHOR("Daniel Laird/Andre McCurdy"); | 278 | MODULE_AUTHOR("Daniel Laird/Andre McCurdy"); |
279 | MODULE_DESCRIPTION("Hardware Watchdog Device for PNX833x"); | 279 | MODULE_DESCRIPTION("Hardware Watchdog Device for PNX833x"); |
280 | MODULE_LICENSE("GPL"); | 280 | MODULE_LICENSE("GPL"); |
281 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c index 9cf6bc7a234f..71e78ef4b736 100644 --- a/drivers/watchdog/rc32434_wdt.c +++ b/drivers/watchdog/rc32434_wdt.c | |||
@@ -25,8 +25,7 @@ | |||
25 | #include <linux/errno.h> /* For the -ENODEV/... values */ | 25 | #include <linux/errno.h> /* For the -ENODEV/... values */ |
26 | #include <linux/kernel.h> /* For printk/panic/... */ | 26 | #include <linux/kernel.h> /* For printk/panic/... */ |
27 | #include <linux/fs.h> /* For file operations */ | 27 | #include <linux/fs.h> /* For file operations */ |
28 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV | 28 | #include <linux/miscdevice.h> /* For struct miscdevice */ |
29 | (WATCHDOG_MINOR) */ | ||
30 | #include <linux/watchdog.h> /* For the watchdog specific items */ | 29 | #include <linux/watchdog.h> /* For the watchdog specific items */ |
31 | #include <linux/init.h> /* For __init/__exit/... */ | 30 | #include <linux/init.h> /* For __init/__exit/... */ |
32 | #include <linux/platform_device.h> /* For platform_driver framework */ | 31 | #include <linux/platform_device.h> /* For platform_driver framework */ |
@@ -329,4 +328,3 @@ MODULE_AUTHOR("Ondrej Zajicek <santiago@crfreenet.org>," | |||
329 | "Florian Fainelli <florian@openwrt.org>"); | 328 | "Florian Fainelli <florian@openwrt.org>"); |
330 | MODULE_DESCRIPTION("Driver for the IDT RC32434 SoC watchdog"); | 329 | MODULE_DESCRIPTION("Driver for the IDT RC32434 SoC watchdog"); |
331 | MODULE_LICENSE("GPL"); | 330 | MODULE_LICENSE("GPL"); |
332 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c index b0f116c2fd53..082d06262959 100644 --- a/drivers/watchdog/rdc321x_wdt.c +++ b/drivers/watchdog/rdc321x_wdt.c | |||
@@ -231,7 +231,7 @@ static int rdc321x_wdt_probe(struct platform_device *pdev) | |||
231 | struct resource *r; | 231 | struct resource *r; |
232 | struct rdc321x_wdt_pdata *pdata; | 232 | struct rdc321x_wdt_pdata *pdata; |
233 | 233 | ||
234 | pdata = pdev->dev.platform_data; | 234 | pdata = dev_get_platdata(&pdev->dev); |
235 | if (!pdata) { | 235 | if (!pdata) { |
236 | dev_err(&pdev->dev, "no platform data supplied\n"); | 236 | dev_err(&pdev->dev, "no platform data supplied\n"); |
237 | return -ENODEV; | 237 | return -ENODEV; |
@@ -298,4 +298,3 @@ module_platform_driver(rdc321x_wdt_driver); | |||
298 | MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); | 298 | MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); |
299 | MODULE_DESCRIPTION("RDC321x watchdog driver"); | 299 | MODULE_DESCRIPTION("RDC321x watchdog driver"); |
300 | MODULE_LICENSE("GPL"); | 300 | MODULE_LICENSE("GPL"); |
301 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/rt2880_wdt.c b/drivers/watchdog/rt2880_wdt.c new file mode 100644 index 000000000000..53d37fea183e --- /dev/null +++ b/drivers/watchdog/rt2880_wdt.c | |||
@@ -0,0 +1,207 @@ | |||
1 | /* | ||
2 | * Ralink RT288x/RT3xxx/MT76xx built-in hardware watchdog timer | ||
3 | * | ||
4 | * Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org> | ||
5 | * Copyright (C) 2013 John Crispin <blogic@openwrt.org> | ||
6 | * | ||
7 | * This driver was based on: drivers/watchdog/softdog.c | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License version 2 as published | ||
11 | * by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #include <linux/clk.h> | ||
15 | #include <linux/reset.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/kernel.h> | ||
18 | #include <linux/watchdog.h> | ||
19 | #include <linux/miscdevice.h> | ||
20 | #include <linux/moduleparam.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | |||
23 | #include <asm/mach-ralink/ralink_regs.h> | ||
24 | |||
25 | #define SYSC_RSTSTAT 0x38 | ||
26 | #define WDT_RST_CAUSE BIT(1) | ||
27 | |||
28 | #define RALINK_WDT_TIMEOUT 30 | ||
29 | #define RALINK_WDT_PRESCALE 65536 | ||
30 | |||
31 | #define TIMER_REG_TMR1LOAD 0x00 | ||
32 | #define TIMER_REG_TMR1CTL 0x08 | ||
33 | |||
34 | #define TMRSTAT_TMR1RST BIT(5) | ||
35 | |||
36 | #define TMR1CTL_ENABLE BIT(7) | ||
37 | #define TMR1CTL_MODE_SHIFT 4 | ||
38 | #define TMR1CTL_MODE_MASK 0x3 | ||
39 | #define TMR1CTL_MODE_FREE_RUNNING 0x0 | ||
40 | #define TMR1CTL_MODE_PERIODIC 0x1 | ||
41 | #define TMR1CTL_MODE_TIMEOUT 0x2 | ||
42 | #define TMR1CTL_MODE_WDT 0x3 | ||
43 | #define TMR1CTL_PRESCALE_MASK 0xf | ||
44 | #define TMR1CTL_PRESCALE_65536 0xf | ||
45 | |||
46 | static struct clk *rt288x_wdt_clk; | ||
47 | static unsigned long rt288x_wdt_freq; | ||
48 | static void __iomem *rt288x_wdt_base; | ||
49 | |||
50 | static bool nowayout = WATCHDOG_NOWAYOUT; | ||
51 | module_param(nowayout, bool, 0); | ||
52 | MODULE_PARM_DESC(nowayout, | ||
53 | "Watchdog cannot be stopped once started (default=" | ||
54 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | ||
55 | |||
56 | static inline void rt_wdt_w32(unsigned reg, u32 val) | ||
57 | { | ||
58 | iowrite32(val, rt288x_wdt_base + reg); | ||
59 | } | ||
60 | |||
61 | static inline u32 rt_wdt_r32(unsigned reg) | ||
62 | { | ||
63 | return ioread32(rt288x_wdt_base + reg); | ||
64 | } | ||
65 | |||
66 | static int rt288x_wdt_ping(struct watchdog_device *w) | ||
67 | { | ||
68 | rt_wdt_w32(TIMER_REG_TMR1LOAD, w->timeout * rt288x_wdt_freq); | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | |||
73 | static int rt288x_wdt_start(struct watchdog_device *w) | ||
74 | { | ||
75 | u32 t; | ||
76 | |||
77 | t = rt_wdt_r32(TIMER_REG_TMR1CTL); | ||
78 | t &= ~(TMR1CTL_MODE_MASK << TMR1CTL_MODE_SHIFT | | ||
79 | TMR1CTL_PRESCALE_MASK); | ||
80 | t |= (TMR1CTL_MODE_WDT << TMR1CTL_MODE_SHIFT | | ||
81 | TMR1CTL_PRESCALE_65536); | ||
82 | rt_wdt_w32(TIMER_REG_TMR1CTL, t); | ||
83 | |||
84 | rt288x_wdt_ping(w); | ||
85 | |||
86 | t = rt_wdt_r32(TIMER_REG_TMR1CTL); | ||
87 | t |= TMR1CTL_ENABLE; | ||
88 | rt_wdt_w32(TIMER_REG_TMR1CTL, t); | ||
89 | |||
90 | return 0; | ||
91 | } | ||
92 | |||
93 | static int rt288x_wdt_stop(struct watchdog_device *w) | ||
94 | { | ||
95 | u32 t; | ||
96 | |||
97 | rt288x_wdt_ping(w); | ||
98 | |||
99 | t = rt_wdt_r32(TIMER_REG_TMR1CTL); | ||
100 | t &= ~TMR1CTL_ENABLE; | ||
101 | rt_wdt_w32(TIMER_REG_TMR1CTL, t); | ||
102 | |||
103 | return 0; | ||
104 | } | ||
105 | |||
106 | static int rt288x_wdt_set_timeout(struct watchdog_device *w, unsigned int t) | ||
107 | { | ||
108 | w->timeout = t; | ||
109 | rt288x_wdt_ping(w); | ||
110 | |||
111 | return 0; | ||
112 | } | ||
113 | |||
114 | static int rt288x_wdt_bootcause(void) | ||
115 | { | ||
116 | if (rt_sysc_r32(SYSC_RSTSTAT) & WDT_RST_CAUSE) | ||
117 | return WDIOF_CARDRESET; | ||
118 | |||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | static struct watchdog_info rt288x_wdt_info = { | ||
123 | .identity = "Ralink Watchdog", | ||
124 | .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, | ||
125 | }; | ||
126 | |||
127 | static struct watchdog_ops rt288x_wdt_ops = { | ||
128 | .owner = THIS_MODULE, | ||
129 | .start = rt288x_wdt_start, | ||
130 | .stop = rt288x_wdt_stop, | ||
131 | .ping = rt288x_wdt_ping, | ||
132 | .set_timeout = rt288x_wdt_set_timeout, | ||
133 | }; | ||
134 | |||
135 | static struct watchdog_device rt288x_wdt_dev = { | ||
136 | .info = &rt288x_wdt_info, | ||
137 | .ops = &rt288x_wdt_ops, | ||
138 | .min_timeout = 1, | ||
139 | }; | ||
140 | |||
141 | static int rt288x_wdt_probe(struct platform_device *pdev) | ||
142 | { | ||
143 | struct resource *res; | ||
144 | int ret; | ||
145 | |||
146 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
147 | rt288x_wdt_base = devm_ioremap_resource(&pdev->dev, res); | ||
148 | if (IS_ERR(rt288x_wdt_base)) | ||
149 | return PTR_ERR(rt288x_wdt_base); | ||
150 | |||
151 | rt288x_wdt_clk = devm_clk_get(&pdev->dev, NULL); | ||
152 | if (IS_ERR(rt288x_wdt_clk)) | ||
153 | return PTR_ERR(rt288x_wdt_clk); | ||
154 | |||
155 | device_reset(&pdev->dev); | ||
156 | |||
157 | rt288x_wdt_freq = clk_get_rate(rt288x_wdt_clk) / RALINK_WDT_PRESCALE; | ||
158 | |||
159 | rt288x_wdt_dev.dev = &pdev->dev; | ||
160 | rt288x_wdt_dev.bootstatus = rt288x_wdt_bootcause(); | ||
161 | |||
162 | rt288x_wdt_dev.max_timeout = (0xfffful / rt288x_wdt_freq); | ||
163 | rt288x_wdt_dev.timeout = rt288x_wdt_dev.max_timeout; | ||
164 | |||
165 | watchdog_set_nowayout(&rt288x_wdt_dev, nowayout); | ||
166 | |||
167 | ret = watchdog_register_device(&rt288x_wdt_dev); | ||
168 | if (!ret) | ||
169 | dev_info(&pdev->dev, "Initialized\n"); | ||
170 | |||
171 | return 0; | ||
172 | } | ||
173 | |||
174 | static int rt288x_wdt_remove(struct platform_device *pdev) | ||
175 | { | ||
176 | watchdog_unregister_device(&rt288x_wdt_dev); | ||
177 | |||
178 | return 0; | ||
179 | } | ||
180 | |||
181 | static void rt288x_wdt_shutdown(struct platform_device *pdev) | ||
182 | { | ||
183 | rt288x_wdt_stop(&rt288x_wdt_dev); | ||
184 | } | ||
185 | |||
186 | static const struct of_device_id rt288x_wdt_match[] = { | ||
187 | { .compatible = "ralink,rt2880-wdt" }, | ||
188 | {}, | ||
189 | }; | ||
190 | MODULE_DEVICE_TABLE(of, rt288x_wdt_match); | ||
191 | |||
192 | static struct platform_driver rt288x_wdt_driver = { | ||
193 | .probe = rt288x_wdt_probe, | ||
194 | .remove = rt288x_wdt_remove, | ||
195 | .shutdown = rt288x_wdt_shutdown, | ||
196 | .driver = { | ||
197 | .name = KBUILD_MODNAME, | ||
198 | .owner = THIS_MODULE, | ||
199 | .of_match_table = rt288x_wdt_match, | ||
200 | }, | ||
201 | }; | ||
202 | |||
203 | module_platform_driver(rt288x_wdt_driver); | ||
204 | |||
205 | MODULE_DESCRIPTION("MediaTek/Ralink RT288x/RT3xxx hardware watchdog driver"); | ||
206 | MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org"); | ||
207 | MODULE_LICENSE("GPL v2"); | ||
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 23aad7c6bf5d..7d8fd041ee25 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/moduleparam.h> | 29 | #include <linux/moduleparam.h> |
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/timer.h> | 31 | #include <linux/timer.h> |
32 | #include <linux/miscdevice.h> /* for MODULE_ALIAS_MISCDEV */ | ||
33 | #include <linux/watchdog.h> | 32 | #include <linux/watchdog.h> |
34 | #include <linux/init.h> | 33 | #include <linux/init.h> |
35 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
@@ -539,5 +538,4 @@ MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>, " | |||
539 | "Dimitry Andric <dimitry.andric@tomtom.com>"); | 538 | "Dimitry Andric <dimitry.andric@tomtom.com>"); |
540 | MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver"); | 539 | MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver"); |
541 | MODULE_LICENSE("GPL"); | 540 | MODULE_LICENSE("GPL"); |
542 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
543 | MODULE_ALIAS("platform:s3c2410-wdt"); | 541 | MODULE_ALIAS("platform:s3c2410-wdt"); |
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index ccd6b29e21bf..e1d39a1e9628 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c | |||
@@ -193,4 +193,3 @@ module_param(margin, int, 0); | |||
193 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); | 193 | MODULE_PARM_DESC(margin, "Watchdog margin in seconds (default 60s)"); |
194 | 194 | ||
195 | MODULE_LICENSE("GPL"); | 195 | MODULE_LICENSE("GPL"); |
196 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/sb_wdog.c b/drivers/watchdog/sb_wdog.c index ea5d84a1fdad..3abae50773b8 100644 --- a/drivers/watchdog/sb_wdog.c +++ b/drivers/watchdog/sb_wdog.c | |||
@@ -341,7 +341,6 @@ MODULE_PARM_DESC(timeout, | |||
341 | "Watchdog timeout in microseconds (max/default 8388607 or 8.3ish secs)"); | 341 | "Watchdog timeout in microseconds (max/default 8388607 or 8.3ish secs)"); |
342 | 342 | ||
343 | MODULE_LICENSE("GPL"); | 343 | MODULE_LICENSE("GPL"); |
344 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
345 | 344 | ||
346 | /* | 345 | /* |
347 | * example code that can be put in a platform code area to utilize the | 346 | * example code that can be put in a platform code area to utilize the |
diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c index 63632ec87c7e..2eef58a0cf05 100644 --- a/drivers/watchdog/sbc60xxwdt.c +++ b/drivers/watchdog/sbc60xxwdt.c | |||
@@ -387,4 +387,3 @@ module_exit(sbc60xxwdt_unload); | |||
387 | MODULE_AUTHOR("Jakob Oestergaard <jakob@unthought.net>"); | 387 | MODULE_AUTHOR("Jakob Oestergaard <jakob@unthought.net>"); |
388 | MODULE_DESCRIPTION("60xx Single Board Computer Watchdog Timer driver"); | 388 | MODULE_DESCRIPTION("60xx Single Board Computer Watchdog Timer driver"); |
389 | MODULE_LICENSE("GPL"); | 389 | MODULE_LICENSE("GPL"); |
390 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/sbc7240_wdt.c b/drivers/watchdog/sbc7240_wdt.c index 719edc8fdeb3..5f268add17ce 100644 --- a/drivers/watchdog/sbc7240_wdt.c +++ b/drivers/watchdog/sbc7240_wdt.c | |||
@@ -309,5 +309,3 @@ MODULE_AUTHOR("Gilles Gigan"); | |||
309 | MODULE_DESCRIPTION("Watchdog device driver for single board" | 309 | MODULE_DESCRIPTION("Watchdog device driver for single board" |
310 | " computers EPIC Nano 7240 from iEi"); | 310 | " computers EPIC Nano 7240 from iEi"); |
311 | MODULE_LICENSE("GPL"); | 311 | MODULE_LICENSE("GPL"); |
312 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
313 | |||
diff --git a/drivers/watchdog/sbc8360.c b/drivers/watchdog/sbc8360.c index d4781e05f017..da60560ca446 100644 --- a/drivers/watchdog/sbc8360.c +++ b/drivers/watchdog/sbc8360.c | |||
@@ -404,6 +404,5 @@ MODULE_AUTHOR("Ian E. Morgan <imorgan@webcon.ca>"); | |||
404 | MODULE_DESCRIPTION("SBC8360 watchdog driver"); | 404 | MODULE_DESCRIPTION("SBC8360 watchdog driver"); |
405 | MODULE_LICENSE("GPL"); | 405 | MODULE_LICENSE("GPL"); |
406 | MODULE_VERSION("1.01"); | 406 | MODULE_VERSION("1.01"); |
407 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
408 | 407 | ||
409 | /* end of sbc8360.c */ | 408 | /* end of sbc8360.c */ |
diff --git a/drivers/watchdog/sbc_epx_c3.c b/drivers/watchdog/sbc_epx_c3.c index 0c3e9f66ef77..a1c502e0d8ec 100644 --- a/drivers/watchdog/sbc_epx_c3.c +++ b/drivers/watchdog/sbc_epx_c3.c | |||
@@ -220,4 +220,3 @@ MODULE_DESCRIPTION("Hardware Watchdog Device for Winsystems EPX-C3 SBC. " | |||
220 | "so only use it if you are *sure* you are running on this specific " | 220 | "so only use it if you are *sure* you are running on this specific " |
221 | "SBC system from Winsystems! It writes to IO ports 0x1ee and 0x1ef!"); | 221 | "SBC system from Winsystems! It writes to IO ports 0x1ee and 0x1ef!"); |
222 | MODULE_LICENSE("GPL"); | 222 | MODULE_LICENSE("GPL"); |
223 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c index 90d5527ca886..a517d8bae757 100644 --- a/drivers/watchdog/sbc_fitpc2_wdt.c +++ b/drivers/watchdog/sbc_fitpc2_wdt.c | |||
@@ -263,5 +263,3 @@ module_param(nowayout, bool, 0); | |||
263 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); | 263 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started"); |
264 | 264 | ||
265 | MODULE_LICENSE("GPL"); | 265 | MODULE_LICENSE("GPL"); |
266 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
267 | |||
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c index 3fb83b0c28c2..3b9fff9dcf65 100644 --- a/drivers/watchdog/sc1200wdt.c +++ b/drivers/watchdog/sc1200wdt.c | |||
@@ -476,4 +476,3 @@ MODULE_AUTHOR("Zwane Mwaikambo <zwane@commfireservices.com>"); | |||
476 | MODULE_DESCRIPTION( | 476 | MODULE_DESCRIPTION( |
477 | "Driver for National Semiconductor PC87307/PC97307 watchdog component"); | 477 | "Driver for National Semiconductor PC87307/PC97307 watchdog component"); |
478 | MODULE_LICENSE("GPL"); | 478 | MODULE_LICENSE("GPL"); |
479 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c index 707e027e5002..f353e18b1a82 100644 --- a/drivers/watchdog/sc520_wdt.c +++ b/drivers/watchdog/sc520_wdt.c | |||
@@ -433,4 +433,3 @@ MODULE_AUTHOR("Scott and Bill Jennings"); | |||
433 | MODULE_DESCRIPTION( | 433 | MODULE_DESCRIPTION( |
434 | "Driver for watchdog timer in AMD \"Elan\" SC520 uProcessor"); | 434 | "Driver for watchdog timer in AMD \"Elan\" SC520 uProcessor"); |
435 | MODULE_LICENSE("GPL"); | 435 | MODULE_LICENSE("GPL"); |
436 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/sch311x_wdt.c b/drivers/watchdog/sch311x_wdt.c index af7b136b1874..b96127ea3de1 100644 --- a/drivers/watchdog/sch311x_wdt.c +++ b/drivers/watchdog/sch311x_wdt.c | |||
@@ -26,8 +26,7 @@ | |||
26 | #include <linux/types.h> /* For standard types (like size_t) */ | 26 | #include <linux/types.h> /* For standard types (like size_t) */ |
27 | #include <linux/errno.h> /* For the -ENODEV/... values */ | 27 | #include <linux/errno.h> /* For the -ENODEV/... values */ |
28 | #include <linux/kernel.h> /* For printk/... */ | 28 | #include <linux/kernel.h> /* For printk/... */ |
29 | #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV | 29 | #include <linux/miscdevice.h> /* For struct miscdevice */ |
30 | (WATCHDOG_MINOR) */ | ||
31 | #include <linux/watchdog.h> /* For the watchdog specific items */ | 30 | #include <linux/watchdog.h> /* For the watchdog specific items */ |
32 | #include <linux/init.h> /* For __init/__exit/... */ | 31 | #include <linux/init.h> /* For __init/__exit/... */ |
33 | #include <linux/fs.h> /* For file operations */ | 32 | #include <linux/fs.h> /* For file operations */ |
@@ -545,5 +544,3 @@ module_exit(sch311x_wdt_exit); | |||
545 | MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>"); | 544 | MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>"); |
546 | MODULE_DESCRIPTION("SMSC SCH311x WatchDog Timer Driver"); | 545 | MODULE_DESCRIPTION("SMSC SCH311x WatchDog Timer Driver"); |
547 | MODULE_LICENSE("GPL"); | 546 | MODULE_LICENSE("GPL"); |
548 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
549 | |||
diff --git a/drivers/watchdog/scx200_wdt.c b/drivers/watchdog/scx200_wdt.c index 8ae7c282d465..836377cf9271 100644 --- a/drivers/watchdog/scx200_wdt.c +++ b/drivers/watchdog/scx200_wdt.c | |||
@@ -37,7 +37,6 @@ | |||
37 | MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); | 37 | MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); |
38 | MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver"); | 38 | MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver"); |
39 | MODULE_LICENSE("GPL"); | 39 | MODULE_LICENSE("GPL"); |
40 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
41 | 40 | ||
42 | static int margin = 60; /* in seconds */ | 41 | static int margin = 60; /* in seconds */ |
43 | module_param(margin, int, 0); | 42 | module_param(margin, int, 0); |
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c index 5bca79457768..f9b8e06f3558 100644 --- a/drivers/watchdog/shwdt.c +++ b/drivers/watchdog/shwdt.c | |||
@@ -343,7 +343,6 @@ MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>"); | |||
343 | MODULE_DESCRIPTION("SuperH watchdog driver"); | 343 | MODULE_DESCRIPTION("SuperH watchdog driver"); |
344 | MODULE_LICENSE("GPL"); | 344 | MODULE_LICENSE("GPL"); |
345 | MODULE_ALIAS("platform:" DRV_NAME); | 345 | MODULE_ALIAS("platform:" DRV_NAME); |
346 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
347 | 346 | ||
348 | module_param(clock_division_ratio, int, 0); | 347 | module_param(clock_division_ratio, int, 0); |
349 | MODULE_PARM_DESC(clock_division_ratio, | 348 | MODULE_PARM_DESC(clock_division_ratio, |
diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c new file mode 100644 index 000000000000..ced3edc95957 --- /dev/null +++ b/drivers/watchdog/sirfsoc_wdt.c | |||
@@ -0,0 +1,226 @@ | |||
1 | /* | ||
2 | * Watchdog driver for CSR SiRFprimaII and SiRFatlasVI | ||
3 | * | ||
4 | * Copyright (c) 2013 Cambridge Silicon Radio Limited, a CSR plc group company. | ||
5 | * | ||
6 | * Licensed under GPLv2 or later. | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/watchdog.h> | ||
11 | #include <linux/platform_device.h> | ||
12 | #include <linux/moduleparam.h> | ||
13 | #include <linux/of.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <linux/uaccess.h> | ||
16 | |||
17 | #define CLOCK_FREQ 1000000 | ||
18 | |||
19 | #define SIRFSOC_TIMER_COUNTER_LO 0x0000 | ||
20 | #define SIRFSOC_TIMER_MATCH_0 0x0008 | ||
21 | #define SIRFSOC_TIMER_INT_EN 0x0024 | ||
22 | #define SIRFSOC_TIMER_WATCHDOG_EN 0x0028 | ||
23 | #define SIRFSOC_TIMER_LATCH 0x0030 | ||
24 | #define SIRFSOC_TIMER_LATCHED_LO 0x0034 | ||
25 | |||
26 | #define SIRFSOC_TIMER_WDT_INDEX 5 | ||
27 | |||
28 | #define SIRFSOC_WDT_MIN_TIMEOUT 30 /* 30 secs */ | ||
29 | #define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60) /* 10 mins */ | ||
30 | #define SIRFSOC_WDT_DEFAULT_TIMEOUT 30 /* 30 secs */ | ||
31 | |||
32 | static unsigned int timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT; | ||
33 | static bool nowayout = WATCHDOG_NOWAYOUT; | ||
34 | |||
35 | module_param(timeout, uint, 0); | ||
36 | module_param(nowayout, bool, 0); | ||
37 | |||
38 | MODULE_PARM_DESC(timeout, "Default watchdog timeout (in seconds)"); | ||
39 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" | ||
40 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | ||
41 | |||
42 | static unsigned int sirfsoc_wdt_gettimeleft(struct watchdog_device *wdd) | ||
43 | { | ||
44 | u32 counter, match; | ||
45 | void __iomem *wdt_base; | ||
46 | int time_left; | ||
47 | |||
48 | wdt_base = watchdog_get_drvdata(wdd); | ||
49 | counter = readl(wdt_base + SIRFSOC_TIMER_COUNTER_LO); | ||
50 | match = readl(wdt_base + | ||
51 | SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2)); | ||
52 | |||
53 | time_left = match - counter; | ||
54 | |||
55 | return time_left / CLOCK_FREQ; | ||
56 | } | ||
57 | |||
58 | static int sirfsoc_wdt_updatetimeout(struct watchdog_device *wdd) | ||
59 | { | ||
60 | u32 counter, timeout_ticks; | ||
61 | void __iomem *wdt_base; | ||
62 | |||
63 | timeout_ticks = wdd->timeout * CLOCK_FREQ; | ||
64 | wdt_base = watchdog_get_drvdata(wdd); | ||
65 | |||
66 | /* Enable the latch before reading the LATCH_LO register */ | ||
67 | writel(1, wdt_base + SIRFSOC_TIMER_LATCH); | ||
68 | |||
69 | /* Set the TO value */ | ||
70 | counter = readl(wdt_base + SIRFSOC_TIMER_LATCHED_LO); | ||
71 | |||
72 | counter += timeout_ticks; | ||
73 | |||
74 | writel(counter, wdt_base + | ||
75 | SIRFSOC_TIMER_MATCH_0 + (SIRFSOC_TIMER_WDT_INDEX << 2)); | ||
76 | |||
77 | return 0; | ||
78 | } | ||
79 | |||
80 | static int sirfsoc_wdt_enable(struct watchdog_device *wdd) | ||
81 | { | ||
82 | void __iomem *wdt_base = watchdog_get_drvdata(wdd); | ||
83 | sirfsoc_wdt_updatetimeout(wdd); | ||
84 | |||
85 | /* | ||
86 | * NOTE: If interrupt is not enabled | ||
87 | * then WD-Reset doesn't get generated at all. | ||
88 | */ | ||
89 | writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN) | ||
90 | | (1 << SIRFSOC_TIMER_WDT_INDEX), | ||
91 | wdt_base + SIRFSOC_TIMER_INT_EN); | ||
92 | writel(1, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN); | ||
93 | |||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | static int sirfsoc_wdt_disable(struct watchdog_device *wdd) | ||
98 | { | ||
99 | void __iomem *wdt_base = watchdog_get_drvdata(wdd); | ||
100 | |||
101 | writel(0, wdt_base + SIRFSOC_TIMER_WATCHDOG_EN); | ||
102 | writel(readl(wdt_base + SIRFSOC_TIMER_INT_EN) | ||
103 | & (~(1 << SIRFSOC_TIMER_WDT_INDEX)), | ||
104 | wdt_base + SIRFSOC_TIMER_INT_EN); | ||
105 | |||
106 | return 0; | ||
107 | } | ||
108 | |||
109 | static int sirfsoc_wdt_settimeout(struct watchdog_device *wdd, unsigned int to) | ||
110 | { | ||
111 | wdd->timeout = to; | ||
112 | sirfsoc_wdt_updatetimeout(wdd); | ||
113 | |||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | #define OPTIONS (WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE) | ||
118 | |||
119 | static const struct watchdog_info sirfsoc_wdt_ident = { | ||
120 | .options = OPTIONS, | ||
121 | .firmware_version = 0, | ||
122 | .identity = "SiRFSOC Watchdog", | ||
123 | }; | ||
124 | |||
125 | static struct watchdog_ops sirfsoc_wdt_ops = { | ||
126 | .owner = THIS_MODULE, | ||
127 | .start = sirfsoc_wdt_enable, | ||
128 | .stop = sirfsoc_wdt_disable, | ||
129 | .get_timeleft = sirfsoc_wdt_gettimeleft, | ||
130 | .ping = sirfsoc_wdt_updatetimeout, | ||
131 | .set_timeout = sirfsoc_wdt_settimeout, | ||
132 | }; | ||
133 | |||
134 | static struct watchdog_device sirfsoc_wdd = { | ||
135 | .info = &sirfsoc_wdt_ident, | ||
136 | .ops = &sirfsoc_wdt_ops, | ||
137 | .timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT, | ||
138 | .min_timeout = SIRFSOC_WDT_MIN_TIMEOUT, | ||
139 | .max_timeout = SIRFSOC_WDT_MAX_TIMEOUT, | ||
140 | }; | ||
141 | |||
142 | static int sirfsoc_wdt_probe(struct platform_device *pdev) | ||
143 | { | ||
144 | struct resource *res; | ||
145 | int ret; | ||
146 | void __iomem *base; | ||
147 | |||
148 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
149 | base = devm_ioremap_resource(&pdev->dev, res); | ||
150 | if (IS_ERR(base)) | ||
151 | return PTR_ERR(base); | ||
152 | |||
153 | watchdog_set_drvdata(&sirfsoc_wdd, base); | ||
154 | |||
155 | watchdog_init_timeout(&sirfsoc_wdd, timeout, &pdev->dev); | ||
156 | watchdog_set_nowayout(&sirfsoc_wdd, nowayout); | ||
157 | |||
158 | ret = watchdog_register_device(&sirfsoc_wdd); | ||
159 | if (ret) | ||
160 | return ret; | ||
161 | |||
162 | platform_set_drvdata(pdev, &sirfsoc_wdd); | ||
163 | |||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | static void sirfsoc_wdt_shutdown(struct platform_device *pdev) | ||
168 | { | ||
169 | struct watchdog_device *wdd = platform_get_drvdata(pdev); | ||
170 | |||
171 | sirfsoc_wdt_disable(wdd); | ||
172 | } | ||
173 | |||
174 | static int sirfsoc_wdt_remove(struct platform_device *pdev) | ||
175 | { | ||
176 | sirfsoc_wdt_shutdown(pdev); | ||
177 | return 0; | ||
178 | } | ||
179 | |||
180 | #ifdef CONFIG_PM_SLEEP | ||
181 | static int sirfsoc_wdt_suspend(struct device *dev) | ||
182 | { | ||
183 | return 0; | ||
184 | } | ||
185 | |||
186 | static int sirfsoc_wdt_resume(struct device *dev) | ||
187 | { | ||
188 | struct watchdog_device *wdd = dev_get_drvdata(dev); | ||
189 | |||
190 | /* | ||
191 | * NOTE: Since timer controller registers settings are saved | ||
192 | * and restored back by the timer-prima2.c, so we need not | ||
193 | * update WD settings except refreshing timeout. | ||
194 | */ | ||
195 | sirfsoc_wdt_updatetimeout(wdd); | ||
196 | |||
197 | return 0; | ||
198 | } | ||
199 | #endif | ||
200 | |||
201 | static SIMPLE_DEV_PM_OPS(sirfsoc_wdt_pm_ops, | ||
202 | sirfsoc_wdt_suspend, sirfsoc_wdt_resume); | ||
203 | |||
204 | static const struct of_device_id sirfsoc_wdt_of_match[] = { | ||
205 | { .compatible = "sirf,prima2-tick"}, | ||
206 | {}, | ||
207 | }; | ||
208 | MODULE_DEVICE_TABLE(of, sirfsoc_wdt_of_match); | ||
209 | |||
210 | static struct platform_driver sirfsoc_wdt_driver = { | ||
211 | .driver = { | ||
212 | .name = "sirfsoc-wdt", | ||
213 | .owner = THIS_MODULE, | ||
214 | .pm = &sirfsoc_wdt_pm_ops, | ||
215 | .of_match_table = of_match_ptr(sirfsoc_wdt_of_match), | ||
216 | }, | ||
217 | .probe = sirfsoc_wdt_probe, | ||
218 | .remove = sirfsoc_wdt_remove, | ||
219 | .shutdown = sirfsoc_wdt_shutdown, | ||
220 | }; | ||
221 | module_platform_driver(sirfsoc_wdt_driver); | ||
222 | |||
223 | MODULE_DESCRIPTION("SiRF SoC watchdog driver"); | ||
224 | MODULE_AUTHOR("Xianglong Du <Xianglong.Du@csr.com>"); | ||
225 | MODULE_LICENSE("GPL v2"); | ||
226 | MODULE_ALIAS("platform:sirfsoc-wdt"); | ||
diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c index 6d665f9c1d58..445ea1ad1fa9 100644 --- a/drivers/watchdog/smsc37b787_wdt.c +++ b/drivers/watchdog/smsc37b787_wdt.c | |||
@@ -603,8 +603,6 @@ MODULE_DESCRIPTION("Driver for SMsC 37B787 watchdog component (Version " | |||
603 | VERSION ")"); | 603 | VERSION ")"); |
604 | MODULE_LICENSE("GPL"); | 604 | MODULE_LICENSE("GPL"); |
605 | 605 | ||
606 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
607 | |||
608 | #ifdef SMSC_SUPPORT_MINUTES | 606 | #ifdef SMSC_SUPPORT_MINUTES |
609 | module_param(unit, int, 0); | 607 | module_param(unit, int, 0); |
610 | MODULE_PARM_DESC(unit, | 608 | MODULE_PARM_DESC(unit, |
diff --git a/drivers/watchdog/softdog.c b/drivers/watchdog/softdog.c index b68b1e519d53..ef2638fee4a8 100644 --- a/drivers/watchdog/softdog.c +++ b/drivers/watchdog/softdog.c | |||
@@ -207,4 +207,3 @@ module_exit(watchdog_exit); | |||
207 | MODULE_AUTHOR("Alan Cox"); | 207 | MODULE_AUTHOR("Alan Cox"); |
208 | MODULE_DESCRIPTION("Software Watchdog Device Driver"); | 208 | MODULE_DESCRIPTION("Software Watchdog Device Driver"); |
209 | MODULE_LICENSE("GPL"); | 209 | MODULE_LICENSE("GPL"); |
210 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index 0e9d8c479c35..ce63a1bbf395 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c | |||
@@ -580,4 +580,3 @@ module_exit(sp5100_tco_cleanup_module); | |||
580 | MODULE_AUTHOR("Priyanka Gupta"); | 580 | MODULE_AUTHOR("Priyanka Gupta"); |
581 | MODULE_DESCRIPTION("TCO timer driver for SP5100/SB800 chipset"); | 581 | MODULE_DESCRIPTION("TCO timer driver for SP5100/SB800 chipset"); |
582 | MODULE_LICENSE("GPL"); | 582 | MODULE_LICENSE("GPL"); |
583 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 58df98aec122..3f786ce0a6f2 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c | |||
@@ -268,7 +268,6 @@ static int sp805_wdt_remove(struct amba_device *adev) | |||
268 | struct sp805_wdt *wdt = amba_get_drvdata(adev); | 268 | struct sp805_wdt *wdt = amba_get_drvdata(adev); |
269 | 269 | ||
270 | watchdog_unregister_device(&wdt->wdd); | 270 | watchdog_unregister_device(&wdt->wdd); |
271 | amba_set_drvdata(adev, NULL); | ||
272 | watchdog_set_drvdata(&wdt->wdd, NULL); | 271 | watchdog_set_drvdata(&wdt->wdd, NULL); |
273 | 272 | ||
274 | return 0; | 273 | return 0; |
diff --git a/drivers/watchdog/stmp3xxx_rtc_wdt.c b/drivers/watchdog/stmp3xxx_rtc_wdt.c index c97e98dcde62..d667f6b51d35 100644 --- a/drivers/watchdog/stmp3xxx_rtc_wdt.c +++ b/drivers/watchdog/stmp3xxx_rtc_wdt.c | |||
@@ -30,7 +30,7 @@ MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat period in seconds from 1 to " | |||
30 | static int wdt_start(struct watchdog_device *wdd) | 30 | static int wdt_start(struct watchdog_device *wdd) |
31 | { | 31 | { |
32 | struct device *dev = watchdog_get_drvdata(wdd); | 32 | struct device *dev = watchdog_get_drvdata(wdd); |
33 | struct stmp3xxx_wdt_pdata *pdata = dev->platform_data; | 33 | struct stmp3xxx_wdt_pdata *pdata = dev_get_platdata(dev); |
34 | 34 | ||
35 | pdata->wdt_set_timeout(dev->parent, wdd->timeout * WDOG_TICK_RATE); | 35 | pdata->wdt_set_timeout(dev->parent, wdd->timeout * WDOG_TICK_RATE); |
36 | return 0; | 36 | return 0; |
@@ -39,7 +39,7 @@ static int wdt_start(struct watchdog_device *wdd) | |||
39 | static int wdt_stop(struct watchdog_device *wdd) | 39 | static int wdt_stop(struct watchdog_device *wdd) |
40 | { | 40 | { |
41 | struct device *dev = watchdog_get_drvdata(wdd); | 41 | struct device *dev = watchdog_get_drvdata(wdd); |
42 | struct stmp3xxx_wdt_pdata *pdata = dev->platform_data; | 42 | struct stmp3xxx_wdt_pdata *pdata = dev_get_platdata(dev); |
43 | 43 | ||
44 | pdata->wdt_set_timeout(dev->parent, 0); | 44 | pdata->wdt_set_timeout(dev->parent, 0); |
45 | return 0; | 45 | return 0; |
@@ -108,4 +108,3 @@ module_platform_driver(stmp3xxx_wdt_driver); | |||
108 | MODULE_DESCRIPTION("STMP3XXX RTC Watchdog Driver"); | 108 | MODULE_DESCRIPTION("STMP3XXX RTC Watchdog Driver"); |
109 | MODULE_LICENSE("GPL v2"); | 109 | MODULE_LICENSE("GPL v2"); |
110 | MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>"); | 110 | MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>"); |
111 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c index f6caa77151c7..76332d893e12 100644 --- a/drivers/watchdog/sunxi_wdt.c +++ b/drivers/watchdog/sunxi_wdt.c | |||
@@ -217,7 +217,7 @@ static struct platform_driver sunxi_wdt_driver = { | |||
217 | .driver = { | 217 | .driver = { |
218 | .owner = THIS_MODULE, | 218 | .owner = THIS_MODULE, |
219 | .name = DRV_NAME, | 219 | .name = DRV_NAME, |
220 | .of_match_table = of_match_ptr(sunxi_wdt_dt_ids) | 220 | .of_match_table = sunxi_wdt_dt_ids, |
221 | }, | 221 | }, |
222 | }; | 222 | }; |
223 | 223 | ||
diff --git a/drivers/watchdog/ts72xx_wdt.c b/drivers/watchdog/ts72xx_wdt.c index c9b0c627fe7e..09d4831aa61f 100644 --- a/drivers/watchdog/ts72xx_wdt.c +++ b/drivers/watchdog/ts72xx_wdt.c | |||
@@ -192,7 +192,7 @@ static int ts72xx_wdt_open(struct inode *inode, struct file *file) | |||
192 | dev_err(&wdt->pdev->dev, | 192 | dev_err(&wdt->pdev->dev, |
193 | "failed to convert timeout (%d) to register value\n", | 193 | "failed to convert timeout (%d) to register value\n", |
194 | timeout); | 194 | timeout); |
195 | return -EINVAL; | 195 | return regval; |
196 | } | 196 | } |
197 | 197 | ||
198 | if (mutex_lock_interruptible(&wdt->lock)) | 198 | if (mutex_lock_interruptible(&wdt->lock)) |
@@ -305,7 +305,8 @@ static long ts72xx_wdt_ioctl(struct file *file, unsigned int cmd, | |||
305 | 305 | ||
306 | switch (cmd) { | 306 | switch (cmd) { |
307 | case WDIOC_GETSUPPORT: | 307 | case WDIOC_GETSUPPORT: |
308 | error = copy_to_user(argp, &winfo, sizeof(winfo)); | 308 | if (copy_to_user(argp, &winfo, sizeof(winfo))) |
309 | error = -EFAULT; | ||
309 | break; | 310 | break; |
310 | 311 | ||
311 | case WDIOC_GETSTATUS: | 312 | case WDIOC_GETSTATUS: |
@@ -320,10 +321,9 @@ static long ts72xx_wdt_ioctl(struct file *file, unsigned int cmd, | |||
320 | case WDIOC_SETOPTIONS: { | 321 | case WDIOC_SETOPTIONS: { |
321 | int options; | 322 | int options; |
322 | 323 | ||
323 | if (get_user(options, p)) { | 324 | error = get_user(options, p); |
324 | error = -EFAULT; | 325 | if (error) |
325 | break; | 326 | break; |
326 | } | ||
327 | 327 | ||
328 | error = -EINVAL; | 328 | error = -EINVAL; |
329 | 329 | ||
@@ -341,30 +341,26 @@ static long ts72xx_wdt_ioctl(struct file *file, unsigned int cmd, | |||
341 | 341 | ||
342 | case WDIOC_SETTIMEOUT: { | 342 | case WDIOC_SETTIMEOUT: { |
343 | int new_timeout; | 343 | int new_timeout; |
344 | int regval; | ||
344 | 345 | ||
345 | if (get_user(new_timeout, p)) { | 346 | error = get_user(new_timeout, p); |
346 | error = -EFAULT; | ||
347 | } else { | ||
348 | int regval; | ||
349 | |||
350 | regval = timeout_to_regval(new_timeout); | ||
351 | if (regval < 0) { | ||
352 | error = -EINVAL; | ||
353 | } else { | ||
354 | ts72xx_wdt_stop(wdt); | ||
355 | wdt->regval = regval; | ||
356 | ts72xx_wdt_start(wdt); | ||
357 | } | ||
358 | } | ||
359 | if (error) | 347 | if (error) |
360 | break; | 348 | break; |
361 | 349 | ||
350 | regval = timeout_to_regval(new_timeout); | ||
351 | if (regval < 0) { | ||
352 | error = regval; | ||
353 | break; | ||
354 | } | ||
355 | ts72xx_wdt_stop(wdt); | ||
356 | wdt->regval = regval; | ||
357 | ts72xx_wdt_start(wdt); | ||
358 | |||
362 | /*FALLTHROUGH*/ | 359 | /*FALLTHROUGH*/ |
363 | } | 360 | } |
364 | 361 | ||
365 | case WDIOC_GETTIMEOUT: | 362 | case WDIOC_GETTIMEOUT: |
366 | if (put_user(regval_to_timeout(wdt->regval), p)) | 363 | error = put_user(regval_to_timeout(wdt->regval), p); |
367 | error = -EFAULT; | ||
368 | break; | 364 | break; |
369 | 365 | ||
370 | default: | 366 | default: |
diff --git a/drivers/watchdog/txx9wdt.c b/drivers/watchdog/txx9wdt.c index 88f23c5cfddb..0fd0e8ae62a8 100644 --- a/drivers/watchdog/txx9wdt.c +++ b/drivers/watchdog/txx9wdt.c | |||
@@ -176,5 +176,4 @@ module_platform_driver_probe(txx9wdt_driver, txx9wdt_probe); | |||
176 | 176 | ||
177 | MODULE_DESCRIPTION("TXx9 Watchdog Driver"); | 177 | MODULE_DESCRIPTION("TXx9 Watchdog Driver"); |
178 | MODULE_LICENSE("GPL"); | 178 | MODULE_LICENSE("GPL"); |
179 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
180 | MODULE_ALIAS("platform:txx9wdt"); | 179 | MODULE_ALIAS("platform:txx9wdt"); |
diff --git a/drivers/watchdog/ux500_wdt.c b/drivers/watchdog/ux500_wdt.c index a614d84121c3..e029b5768f2c 100644 --- a/drivers/watchdog/ux500_wdt.c +++ b/drivers/watchdog/ux500_wdt.c | |||
@@ -88,7 +88,7 @@ static struct watchdog_device ux500_wdt = { | |||
88 | static int ux500_wdt_probe(struct platform_device *pdev) | 88 | static int ux500_wdt_probe(struct platform_device *pdev) |
89 | { | 89 | { |
90 | int ret; | 90 | int ret; |
91 | struct ux500_wdt_data *pdata = pdev->dev.platform_data; | 91 | struct ux500_wdt_data *pdata = dev_get_platdata(&pdev->dev); |
92 | 92 | ||
93 | if (pdata) { | 93 | if (pdata) { |
94 | if (pdata->timeout > 0) | 94 | if (pdata->timeout > 0) |
@@ -167,5 +167,4 @@ module_platform_driver(ux500_wdt_driver); | |||
167 | MODULE_AUTHOR("Jonas Aaberg <jonas.aberg@stericsson.com>"); | 167 | MODULE_AUTHOR("Jonas Aaberg <jonas.aberg@stericsson.com>"); |
168 | MODULE_DESCRIPTION("Ux500 Watchdog Driver"); | 168 | MODULE_DESCRIPTION("Ux500 Watchdog Driver"); |
169 | MODULE_LICENSE("GPL"); | 169 | MODULE_LICENSE("GPL"); |
170 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
171 | MODULE_ALIAS("platform:ux500_wdt"); | 170 | MODULE_ALIAS("platform:ux500_wdt"); |
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c index 92f1326f0cfc..e24b21082874 100644 --- a/drivers/watchdog/w83627hf_wdt.c +++ b/drivers/watchdog/w83627hf_wdt.c | |||
@@ -1,6 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * w83627hf/thf WDT driver | 2 | * w83627hf/thf WDT driver |
3 | * | 3 | * |
4 | * (c) Copyright 2013 Guenter Roeck | ||
5 | * converted to watchdog infrastructure | ||
6 | * | ||
4 | * (c) Copyright 2007 Vlad Drukker <vlad@storewiz.com> | 7 | * (c) Copyright 2007 Vlad Drukker <vlad@storewiz.com> |
5 | * added support for W83627THF. | 8 | * added support for W83627THF. |
6 | * | 9 | * |
@@ -31,31 +34,22 @@ | |||
31 | #include <linux/module.h> | 34 | #include <linux/module.h> |
32 | #include <linux/moduleparam.h> | 35 | #include <linux/moduleparam.h> |
33 | #include <linux/types.h> | 36 | #include <linux/types.h> |
34 | #include <linux/miscdevice.h> | ||
35 | #include <linux/watchdog.h> | 37 | #include <linux/watchdog.h> |
36 | #include <linux/fs.h> | ||
37 | #include <linux/ioport.h> | 38 | #include <linux/ioport.h> |
38 | #include <linux/notifier.h> | 39 | #include <linux/notifier.h> |
39 | #include <linux/reboot.h> | 40 | #include <linux/reboot.h> |
40 | #include <linux/init.h> | 41 | #include <linux/init.h> |
41 | #include <linux/spinlock.h> | ||
42 | #include <linux/io.h> | 42 | #include <linux/io.h> |
43 | #include <linux/uaccess.h> | ||
44 | |||
45 | 43 | ||
46 | #define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" | 44 | #define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" |
47 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 45 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
48 | 46 | ||
49 | static unsigned long wdt_is_open; | ||
50 | static char expect_close; | ||
51 | static DEFINE_SPINLOCK(io_lock); | ||
52 | |||
53 | /* You must set this - there is no sane way to probe for this board. */ | 47 | /* You must set this - there is no sane way to probe for this board. */ |
54 | static int wdt_io = 0x2E; | 48 | static int wdt_io = 0x2E; |
55 | module_param(wdt_io, int, 0); | 49 | module_param(wdt_io, int, 0); |
56 | MODULE_PARM_DESC(wdt_io, "w83627hf/thf WDT io port (default 0x2E)"); | 50 | MODULE_PARM_DESC(wdt_io, "w83627hf/thf WDT io port (default 0x2E)"); |
57 | 51 | ||
58 | static int timeout = WATCHDOG_TIMEOUT; /* in seconds */ | 52 | static int timeout; /* in seconds */ |
59 | module_param(timeout, int, 0); | 53 | module_param(timeout, int, 0); |
60 | MODULE_PARM_DESC(timeout, | 54 | MODULE_PARM_DESC(timeout, |
61 | "Watchdog timeout in seconds. 1 <= timeout <= 255, default=" | 55 | "Watchdog timeout in seconds. 1 <= timeout <= 255, default=" |
@@ -76,236 +70,147 @@ MODULE_PARM_DESC(nowayout, | |||
76 | (same as EFER) */ | 70 | (same as EFER) */ |
77 | #define WDT_EFDR (WDT_EFIR+1) /* Extended Function Data Register */ | 71 | #define WDT_EFDR (WDT_EFIR+1) /* Extended Function Data Register */ |
78 | 72 | ||
79 | static void w83627hf_select_wd_register(void) | 73 | #define W83627HF_LD_WDT 0x08 |
74 | |||
75 | static void superio_outb(int reg, int val) | ||
80 | { | 76 | { |
81 | unsigned char c; | 77 | outb(reg, WDT_EFER); |
78 | outb(val, WDT_EFDR); | ||
79 | } | ||
80 | |||
81 | static inline int superio_inb(int reg) | ||
82 | { | ||
83 | outb(reg, WDT_EFER); | ||
84 | return inb(WDT_EFDR); | ||
85 | } | ||
86 | |||
87 | static int superio_enter(void) | ||
88 | { | ||
89 | if (!request_muxed_region(wdt_io, 2, WATCHDOG_NAME)) | ||
90 | return -EBUSY; | ||
91 | |||
82 | outb_p(0x87, WDT_EFER); /* Enter extended function mode */ | 92 | outb_p(0x87, WDT_EFER); /* Enter extended function mode */ |
83 | outb_p(0x87, WDT_EFER); /* Again according to manual */ | 93 | outb_p(0x87, WDT_EFER); /* Again according to manual */ |
84 | 94 | ||
85 | outb(0x20, WDT_EFER); /* check chip version */ | 95 | return 0; |
86 | c = inb(WDT_EFDR); | 96 | } |
87 | if (c == 0x82) { /* W83627THF */ | ||
88 | outb_p(0x2b, WDT_EFER); /* select GPIO3 */ | ||
89 | c = ((inb_p(WDT_EFDR) & 0xf7) | 0x04); /* select WDT0 */ | ||
90 | outb_p(0x2b, WDT_EFER); | ||
91 | outb_p(c, WDT_EFDR); /* set GPIO3 to WDT0 */ | ||
92 | } else if (c == 0x88 || c == 0xa0) { /* W83627EHF / W83627DHG */ | ||
93 | outb_p(0x2d, WDT_EFER); /* select GPIO5 */ | ||
94 | c = inb_p(WDT_EFDR) & ~0x01; /* PIN77 -> WDT0# */ | ||
95 | outb_p(0x2d, WDT_EFER); | ||
96 | outb_p(c, WDT_EFDR); /* set GPIO5 to WDT0 */ | ||
97 | } | ||
98 | 97 | ||
99 | outb_p(0x07, WDT_EFER); /* point to logical device number reg */ | 98 | static void superio_select(int ld) |
100 | outb_p(0x08, WDT_EFDR); /* select logical device 8 (GPIO2) */ | 99 | { |
101 | outb_p(0x30, WDT_EFER); /* select CR30 */ | 100 | superio_outb(0x07, ld); |
102 | outb_p(0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */ | ||
103 | } | 101 | } |
104 | 102 | ||
105 | static void w83627hf_unselect_wd_register(void) | 103 | static void superio_exit(void) |
106 | { | 104 | { |
107 | outb_p(0xAA, WDT_EFER); /* Leave extended function mode */ | 105 | outb_p(0xAA, WDT_EFER); /* Leave extended function mode */ |
106 | release_region(wdt_io, 2); | ||
108 | } | 107 | } |
109 | 108 | ||
110 | /* tyan motherboards seem to set F5 to 0x4C ? | 109 | /* tyan motherboards seem to set F5 to 0x4C ? |
111 | * So explicitly init to appropriate value. */ | 110 | * So explicitly init to appropriate value. */ |
112 | 111 | ||
113 | static void w83627hf_init(void) | 112 | static int w83627hf_init(struct watchdog_device *wdog) |
114 | { | 113 | { |
114 | int ret; | ||
115 | unsigned char t; | 115 | unsigned char t; |
116 | 116 | ||
117 | w83627hf_select_wd_register(); | 117 | ret = superio_enter(); |
118 | if (ret) | ||
119 | return ret; | ||
120 | |||
121 | superio_select(W83627HF_LD_WDT); | ||
122 | t = superio_inb(0x20); /* check chip version */ | ||
123 | if (t == 0x82) { /* W83627THF */ | ||
124 | t = (superio_inb(0x2b) & 0xf7); | ||
125 | superio_outb(0x2b, t | 0x04); /* set GPIO3 to WDT0 */ | ||
126 | } else if (t == 0x88 || t == 0xa0) { /* W83627EHF / W83627DHG */ | ||
127 | t = superio_inb(0x2d); | ||
128 | superio_outb(0x2d, t & ~0x01); /* set GPIO5 to WDT0 */ | ||
129 | } | ||
130 | |||
131 | /* set CR30 bit 0 to activate GPIO2 */ | ||
132 | t = superio_inb(0x30); | ||
133 | if (!(t & 0x01)) | ||
134 | superio_outb(0x30, t | 0x01); | ||
118 | 135 | ||
119 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ | 136 | t = superio_inb(0xF6); |
120 | t = inb_p(WDT_EFDR); /* read CRF6 */ | ||
121 | if (t != 0) { | 137 | if (t != 0) { |
122 | pr_info("Watchdog already running. Resetting timeout to %d sec\n", | 138 | pr_info("Watchdog already running. Resetting timeout to %d sec\n", |
123 | timeout); | 139 | wdog->timeout); |
124 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ | 140 | superio_outb(0xF6, wdog->timeout); |
125 | } | 141 | } |
126 | 142 | ||
127 | outb_p(0xF5, WDT_EFER); /* Select CRF5 */ | 143 | /* set second mode & disable keyboard turning off watchdog */ |
128 | t = inb_p(WDT_EFDR); /* read CRF5 */ | 144 | t = superio_inb(0xF5) & ~0x0C; |
129 | t &= ~0x0C; /* set second mode & disable keyboard | 145 | /* enable the WDTO# output low pulse to the KBRST# pin */ |
130 | turning off watchdog */ | 146 | t |= 0x02; |
131 | t |= 0x02; /* enable the WDTO# output low pulse | 147 | superio_outb(0xF5, t); |
132 | to the KBRST# pin (PIN60) */ | ||
133 | outb_p(t, WDT_EFDR); /* Write back to CRF5 */ | ||
134 | |||
135 | outb_p(0xF7, WDT_EFER); /* Select CRF7 */ | ||
136 | t = inb_p(WDT_EFDR); /* read CRF7 */ | ||
137 | t &= ~0xC0; /* disable keyboard & mouse turning off | ||
138 | watchdog */ | ||
139 | outb_p(t, WDT_EFDR); /* Write back to CRF7 */ | ||
140 | |||
141 | w83627hf_unselect_wd_register(); | ||
142 | } | ||
143 | |||
144 | static void wdt_set_time(int timeout) | ||
145 | { | ||
146 | spin_lock(&io_lock); | ||
147 | |||
148 | w83627hf_select_wd_register(); | ||
149 | 148 | ||
150 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ | 149 | /* disable keyboard & mouse turning off watchdog */ |
151 | outb_p(timeout, WDT_EFDR); /* Write Timeout counter to CRF6 */ | 150 | t = superio_inb(0xF7) & ~0xC0; |
151 | superio_outb(0xF7, t); | ||
152 | 152 | ||
153 | w83627hf_unselect_wd_register(); | 153 | superio_exit(); |
154 | 154 | ||
155 | spin_unlock(&io_lock); | ||
156 | } | ||
157 | |||
158 | static int wdt_ping(void) | ||
159 | { | ||
160 | wdt_set_time(timeout); | ||
161 | return 0; | 155 | return 0; |
162 | } | 156 | } |
163 | 157 | ||
164 | static int wdt_disable(void) | 158 | static int wdt_set_time(unsigned int timeout) |
165 | { | 159 | { |
166 | wdt_set_time(0); | 160 | int ret; |
167 | return 0; | 161 | |
168 | } | 162 | ret = superio_enter(); |
163 | if (ret) | ||
164 | return ret; | ||
165 | |||
166 | superio_select(W83627HF_LD_WDT); | ||
167 | superio_outb(0xF6, timeout); | ||
168 | superio_exit(); | ||
169 | 169 | ||
170 | static int wdt_set_heartbeat(int t) | ||
171 | { | ||
172 | if (t < 1 || t > 255) | ||
173 | return -EINVAL; | ||
174 | timeout = t; | ||
175 | return 0; | 170 | return 0; |
176 | } | 171 | } |
177 | 172 | ||
178 | static int wdt_get_time(void) | 173 | static int wdt_start(struct watchdog_device *wdog) |
179 | { | 174 | { |
180 | int timeleft; | 175 | return wdt_set_time(wdog->timeout); |
181 | |||
182 | spin_lock(&io_lock); | ||
183 | |||
184 | w83627hf_select_wd_register(); | ||
185 | |||
186 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ | ||
187 | timeleft = inb_p(WDT_EFDR); /* Read Timeout counter to CRF6 */ | ||
188 | |||
189 | w83627hf_unselect_wd_register(); | ||
190 | |||
191 | spin_unlock(&io_lock); | ||
192 | |||
193 | return timeleft; | ||
194 | } | 176 | } |
195 | 177 | ||
196 | static ssize_t wdt_write(struct file *file, const char __user *buf, | 178 | static int wdt_stop(struct watchdog_device *wdog) |
197 | size_t count, loff_t *ppos) | ||
198 | { | 179 | { |
199 | if (count) { | 180 | return wdt_set_time(0); |
200 | if (!nowayout) { | ||
201 | size_t i; | ||
202 | |||
203 | expect_close = 0; | ||
204 | |||
205 | for (i = 0; i != count; i++) { | ||
206 | char c; | ||
207 | if (get_user(c, buf + i)) | ||
208 | return -EFAULT; | ||
209 | if (c == 'V') | ||
210 | expect_close = 42; | ||
211 | } | ||
212 | } | ||
213 | wdt_ping(); | ||
214 | } | ||
215 | return count; | ||
216 | } | 181 | } |
217 | 182 | ||
218 | static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 183 | static int wdt_set_timeout(struct watchdog_device *wdog, unsigned int timeout) |
219 | { | 184 | { |
220 | void __user *argp = (void __user *)arg; | 185 | wdog->timeout = timeout; |
221 | int __user *p = argp; | 186 | |
222 | int timeval; | ||
223 | static const struct watchdog_info ident = { | ||
224 | .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | | ||
225 | WDIOF_MAGICCLOSE, | ||
226 | .firmware_version = 1, | ||
227 | .identity = "W83627HF WDT", | ||
228 | }; | ||
229 | |||
230 | switch (cmd) { | ||
231 | case WDIOC_GETSUPPORT: | ||
232 | if (copy_to_user(argp, &ident, sizeof(ident))) | ||
233 | return -EFAULT; | ||
234 | break; | ||
235 | case WDIOC_GETSTATUS: | ||
236 | case WDIOC_GETBOOTSTATUS: | ||
237 | return put_user(0, p); | ||
238 | case WDIOC_SETOPTIONS: | ||
239 | { | ||
240 | int options, retval = -EINVAL; | ||
241 | |||
242 | if (get_user(options, p)) | ||
243 | return -EFAULT; | ||
244 | if (options & WDIOS_DISABLECARD) { | ||
245 | wdt_disable(); | ||
246 | retval = 0; | ||
247 | } | ||
248 | if (options & WDIOS_ENABLECARD) { | ||
249 | wdt_ping(); | ||
250 | retval = 0; | ||
251 | } | ||
252 | return retval; | ||
253 | } | ||
254 | case WDIOC_KEEPALIVE: | ||
255 | wdt_ping(); | ||
256 | break; | ||
257 | case WDIOC_SETTIMEOUT: | ||
258 | if (get_user(timeval, p)) | ||
259 | return -EFAULT; | ||
260 | if (wdt_set_heartbeat(timeval)) | ||
261 | return -EINVAL; | ||
262 | wdt_ping(); | ||
263 | /* Fall */ | ||
264 | case WDIOC_GETTIMEOUT: | ||
265 | return put_user(timeout, p); | ||
266 | case WDIOC_GETTIMELEFT: | ||
267 | timeval = wdt_get_time(); | ||
268 | return put_user(timeval, p); | ||
269 | default: | ||
270 | return -ENOTTY; | ||
271 | } | ||
272 | return 0; | 187 | return 0; |
273 | } | 188 | } |
274 | 189 | ||
275 | static int wdt_open(struct inode *inode, struct file *file) | 190 | static unsigned int wdt_get_time(struct watchdog_device *wdog) |
276 | { | 191 | { |
277 | if (test_and_set_bit(0, &wdt_is_open)) | 192 | unsigned int timeleft; |
278 | return -EBUSY; | 193 | int ret; |
279 | /* | ||
280 | * Activate | ||
281 | */ | ||
282 | 194 | ||
283 | wdt_ping(); | 195 | ret = superio_enter(); |
284 | return nonseekable_open(inode, file); | 196 | if (ret) |
285 | } | 197 | return 0; |
286 | 198 | ||
287 | static int wdt_close(struct inode *inode, struct file *file) | 199 | superio_select(W83627HF_LD_WDT); |
288 | { | 200 | timeleft = superio_inb(0xF6); |
289 | if (expect_close == 42) | 201 | superio_exit(); |
290 | wdt_disable(); | 202 | |
291 | else { | 203 | return timeleft; |
292 | pr_crit("Unexpected close, not stopping watchdog!\n"); | ||
293 | wdt_ping(); | ||
294 | } | ||
295 | expect_close = 0; | ||
296 | clear_bit(0, &wdt_is_open); | ||
297 | return 0; | ||
298 | } | 204 | } |
299 | 205 | ||
300 | /* | 206 | /* |
301 | * Notifier for system down | 207 | * Notifier for system down |
302 | */ | 208 | */ |
303 | |||
304 | static int wdt_notify_sys(struct notifier_block *this, unsigned long code, | 209 | static int wdt_notify_sys(struct notifier_block *this, unsigned long code, |
305 | void *unused) | 210 | void *unused) |
306 | { | 211 | { |
307 | if (code == SYS_DOWN || code == SYS_HALT) | 212 | if (code == SYS_DOWN || code == SYS_HALT) |
308 | wdt_disable(); /* Turn the WDT off */ | 213 | wdt_set_time(0); /* Turn the WDT off */ |
309 | 214 | ||
310 | return NOTIFY_DONE; | 215 | return NOTIFY_DONE; |
311 | } | 216 | } |
@@ -314,19 +219,25 @@ static int wdt_notify_sys(struct notifier_block *this, unsigned long code, | |||
314 | * Kernel Interfaces | 219 | * Kernel Interfaces |
315 | */ | 220 | */ |
316 | 221 | ||
317 | static const struct file_operations wdt_fops = { | 222 | static struct watchdog_info wdt_info = { |
318 | .owner = THIS_MODULE, | 223 | .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING | WDIOF_MAGICCLOSE, |
319 | .llseek = no_llseek, | 224 | .identity = "W83627HF Watchdog", |
320 | .write = wdt_write, | ||
321 | .unlocked_ioctl = wdt_ioctl, | ||
322 | .open = wdt_open, | ||
323 | .release = wdt_close, | ||
324 | }; | 225 | }; |
325 | 226 | ||
326 | static struct miscdevice wdt_miscdev = { | 227 | static struct watchdog_ops wdt_ops = { |
327 | .minor = WATCHDOG_MINOR, | 228 | .owner = THIS_MODULE, |
328 | .name = "watchdog", | 229 | .start = wdt_start, |
329 | .fops = &wdt_fops, | 230 | .stop = wdt_stop, |
231 | .set_timeout = wdt_set_timeout, | ||
232 | .get_timeleft = wdt_get_time, | ||
233 | }; | ||
234 | |||
235 | static struct watchdog_device wdt_dev = { | ||
236 | .info = &wdt_info, | ||
237 | .ops = &wdt_ops, | ||
238 | .timeout = WATCHDOG_TIMEOUT, | ||
239 | .min_timeout = 1, | ||
240 | .max_timeout = 255, | ||
330 | }; | 241 | }; |
331 | 242 | ||
332 | /* | 243 | /* |
@@ -344,50 +255,39 @@ static int __init wdt_init(void) | |||
344 | 255 | ||
345 | pr_info("WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising\n"); | 256 | pr_info("WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising\n"); |
346 | 257 | ||
347 | if (wdt_set_heartbeat(timeout)) { | 258 | watchdog_init_timeout(&wdt_dev, timeout, NULL); |
348 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 259 | watchdog_set_nowayout(&wdt_dev, nowayout); |
349 | pr_info("timeout value must be 1 <= timeout <= 255, using %d\n", | ||
350 | WATCHDOG_TIMEOUT); | ||
351 | } | ||
352 | 260 | ||
353 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { | 261 | ret = w83627hf_init(&wdt_dev); |
354 | pr_err("I/O address 0x%04x already in use\n", wdt_io); | 262 | if (ret) { |
355 | ret = -EIO; | 263 | pr_err("failed to initialize watchdog (err=%d)\n", ret); |
356 | goto out; | 264 | return ret; |
357 | } | 265 | } |
358 | 266 | ||
359 | w83627hf_init(); | ||
360 | |||
361 | ret = register_reboot_notifier(&wdt_notifier); | 267 | ret = register_reboot_notifier(&wdt_notifier); |
362 | if (ret != 0) { | 268 | if (ret != 0) { |
363 | pr_err("cannot register reboot notifier (err=%d)\n", ret); | 269 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
364 | goto unreg_regions; | 270 | return ret; |
365 | } | 271 | } |
366 | 272 | ||
367 | ret = misc_register(&wdt_miscdev); | 273 | ret = watchdog_register_device(&wdt_dev); |
368 | if (ret != 0) { | 274 | if (ret) |
369 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", | ||
370 | WATCHDOG_MINOR, ret); | ||
371 | goto unreg_reboot; | 275 | goto unreg_reboot; |
372 | } | ||
373 | 276 | ||
374 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", | 277 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
375 | timeout, nowayout); | 278 | wdt_dev.timeout, nowayout); |
376 | 279 | ||
377 | out: | ||
378 | return ret; | 280 | return ret; |
281 | |||
379 | unreg_reboot: | 282 | unreg_reboot: |
380 | unregister_reboot_notifier(&wdt_notifier); | 283 | unregister_reboot_notifier(&wdt_notifier); |
381 | unreg_regions: | 284 | return ret; |
382 | release_region(wdt_io, 1); | ||
383 | goto out; | ||
384 | } | 285 | } |
385 | 286 | ||
386 | static void __exit wdt_exit(void) | 287 | static void __exit wdt_exit(void) |
387 | { | 288 | { |
388 | misc_deregister(&wdt_miscdev); | 289 | watchdog_unregister_device(&wdt_dev); |
389 | unregister_reboot_notifier(&wdt_notifier); | 290 | unregister_reboot_notifier(&wdt_notifier); |
390 | release_region(wdt_io, 1); | ||
391 | } | 291 | } |
392 | 292 | ||
393 | module_init(wdt_init); | 293 | module_init(wdt_init); |
@@ -396,4 +296,3 @@ module_exit(wdt_exit); | |||
396 | MODULE_LICENSE("GPL"); | 296 | MODULE_LICENSE("GPL"); |
397 | MODULE_AUTHOR("Pádraig Brady <P@draigBrady.com>"); | 297 | MODULE_AUTHOR("Pádraig Brady <P@draigBrady.com>"); |
398 | MODULE_DESCRIPTION("w83627hf/thf WDT driver"); | 298 | MODULE_DESCRIPTION("w83627hf/thf WDT driver"); |
399 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/w83697hf_wdt.c b/drivers/watchdog/w83697hf_wdt.c index cd9f3c1e1af4..aaf2995d37f4 100644 --- a/drivers/watchdog/w83697hf_wdt.c +++ b/drivers/watchdog/w83697hf_wdt.c | |||
@@ -458,4 +458,3 @@ MODULE_LICENSE("GPL"); | |||
458 | MODULE_AUTHOR("Marcus Junker <junker@anduras.de>, " | 458 | MODULE_AUTHOR("Marcus Junker <junker@anduras.de>, " |
459 | "Samuel Tardieu <sam@rfc1149.net>"); | 459 | "Samuel Tardieu <sam@rfc1149.net>"); |
460 | MODULE_DESCRIPTION("w83697hf/hg WDT driver"); | 460 | MODULE_DESCRIPTION("w83697hf/hg WDT driver"); |
461 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/w83697ug_wdt.c b/drivers/watchdog/w83697ug_wdt.c index 274be0bfaf24..ff58cb74671f 100644 --- a/drivers/watchdog/w83697ug_wdt.c +++ b/drivers/watchdog/w83697ug_wdt.c | |||
@@ -395,4 +395,3 @@ module_exit(wdt_exit); | |||
395 | MODULE_LICENSE("GPL"); | 395 | MODULE_LICENSE("GPL"); |
396 | MODULE_AUTHOR("Flemming Frandsen <ff@nrvissing.net>"); | 396 | MODULE_AUTHOR("Flemming Frandsen <ff@nrvissing.net>"); |
397 | MODULE_DESCRIPTION("w83697ug/uf WDT driver"); | 397 | MODULE_DESCRIPTION("w83697ug/uf WDT driver"); |
398 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c index 7874ae06232b..f0483c75ed32 100644 --- a/drivers/watchdog/w83877f_wdt.c +++ b/drivers/watchdog/w83877f_wdt.c | |||
@@ -406,4 +406,3 @@ module_exit(w83877f_wdt_unload); | |||
406 | MODULE_AUTHOR("Scott and Bill Jennings"); | 406 | MODULE_AUTHOR("Scott and Bill Jennings"); |
407 | MODULE_DESCRIPTION("Driver for watchdog timer in w83877f chip"); | 407 | MODULE_DESCRIPTION("Driver for watchdog timer in w83877f chip"); |
408 | MODULE_LICENSE("GPL"); | 408 | MODULE_LICENSE("GPL"); |
409 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c index 5d2c902825c2..91bf55a20024 100644 --- a/drivers/watchdog/w83977f_wdt.c +++ b/drivers/watchdog/w83977f_wdt.c | |||
@@ -527,4 +527,3 @@ module_exit(w83977f_wdt_exit); | |||
527 | MODULE_AUTHOR("Jose Goncalves <jose.goncalves@inov.pt>"); | 527 | MODULE_AUTHOR("Jose Goncalves <jose.goncalves@inov.pt>"); |
528 | MODULE_DESCRIPTION("Driver for watchdog timer in W83977F I/O chip"); | 528 | MODULE_DESCRIPTION("Driver for watchdog timer in W83977F I/O chip"); |
529 | MODULE_LICENSE("GPL"); | 529 | MODULE_LICENSE("GPL"); |
530 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/wafer5823wdt.c b/drivers/watchdog/wafer5823wdt.c index 25aba6e00a23..db0da7ea4fd8 100644 --- a/drivers/watchdog/wafer5823wdt.c +++ b/drivers/watchdog/wafer5823wdt.c | |||
@@ -322,6 +322,5 @@ module_exit(wafwdt_exit); | |||
322 | MODULE_AUTHOR("Justin Cormack"); | 322 | MODULE_AUTHOR("Justin Cormack"); |
323 | MODULE_DESCRIPTION("ICP Wafer 5823 Single Board Computer WDT driver"); | 323 | MODULE_DESCRIPTION("ICP Wafer 5823 Single Board Computer WDT driver"); |
324 | MODULE_LICENSE("GPL"); | 324 | MODULE_LICENSE("GPL"); |
325 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
326 | 325 | ||
327 | /* end of wafer5823wdt.c */ | 326 | /* end of wafer5823wdt.c */ |
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c index 05d18b4c661b..461336c4519f 100644 --- a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c | |||
@@ -77,7 +77,7 @@ int watchdog_init_timeout(struct watchdog_device *wdd, | |||
77 | 77 | ||
78 | watchdog_check_min_max_timeout(wdd); | 78 | watchdog_check_min_max_timeout(wdd); |
79 | 79 | ||
80 | /* try to get the tiemout module parameter first */ | 80 | /* try to get the timeout module parameter first */ |
81 | if (!watchdog_timeout_invalid(wdd, timeout_parm)) { | 81 | if (!watchdog_timeout_invalid(wdd, timeout_parm)) { |
82 | wdd->timeout = timeout_parm; | 82 | wdd->timeout = timeout_parm; |
83 | return ret; | 83 | return ret; |
diff --git a/drivers/watchdog/wdrtas.c b/drivers/watchdog/wdrtas.c index 3045debd5411..0240c60d14e3 100644 --- a/drivers/watchdog/wdrtas.c +++ b/drivers/watchdog/wdrtas.c | |||
@@ -48,8 +48,6 @@ | |||
48 | MODULE_AUTHOR("Utz Bacher <utz.bacher@de.ibm.com>"); | 48 | MODULE_AUTHOR("Utz Bacher <utz.bacher@de.ibm.com>"); |
49 | MODULE_DESCRIPTION("RTAS watchdog driver"); | 49 | MODULE_DESCRIPTION("RTAS watchdog driver"); |
50 | MODULE_LICENSE("GPL"); | 50 | MODULE_LICENSE("GPL"); |
51 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
52 | MODULE_ALIAS_MISCDEV(TEMP_MINOR); | ||
53 | 51 | ||
54 | static bool wdrtas_nowayout = WATCHDOG_NOWAYOUT; | 52 | static bool wdrtas_nowayout = WATCHDOG_NOWAYOUT; |
55 | static atomic_t wdrtas_miscdev_open = ATOMIC_INIT(0); | 53 | static atomic_t wdrtas_miscdev_open = ATOMIC_INIT(0); |
diff --git a/drivers/watchdog/wdt.c b/drivers/watchdog/wdt.c index ee4333c01109..e0206b5b7d89 100644 --- a/drivers/watchdog/wdt.c +++ b/drivers/watchdog/wdt.c | |||
@@ -664,6 +664,4 @@ module_exit(wdt_exit); | |||
664 | 664 | ||
665 | MODULE_AUTHOR("Alan Cox"); | 665 | MODULE_AUTHOR("Alan Cox"); |
666 | MODULE_DESCRIPTION("Driver for ISA ICS watchdog cards (WDT500/501)"); | 666 | MODULE_DESCRIPTION("Driver for ISA ICS watchdog cards (WDT500/501)"); |
667 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
668 | MODULE_ALIAS_MISCDEV(TEMP_MINOR); | ||
669 | MODULE_LICENSE("GPL"); | 667 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/watchdog/wdt285.c b/drivers/watchdog/wdt285.c index 5eec74053882..7355ddd0b207 100644 --- a/drivers/watchdog/wdt285.c +++ b/drivers/watchdog/wdt285.c | |||
@@ -224,7 +224,6 @@ static void __exit footbridge_watchdog_exit(void) | |||
224 | MODULE_AUTHOR("Phil Blundell <pb@nexus.co.uk>"); | 224 | MODULE_AUTHOR("Phil Blundell <pb@nexus.co.uk>"); |
225 | MODULE_DESCRIPTION("Footbridge watchdog driver"); | 225 | MODULE_DESCRIPTION("Footbridge watchdog driver"); |
226 | MODULE_LICENSE("GPL"); | 226 | MODULE_LICENSE("GPL"); |
227 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
228 | 227 | ||
229 | module_param(soft_margin, int, 0); | 228 | module_param(soft_margin, int, 0); |
230 | MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds"); | 229 | MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds"); |
diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c index 65a402344933..a8e6f87f60c9 100644 --- a/drivers/watchdog/wdt977.c +++ b/drivers/watchdog/wdt977.c | |||
@@ -507,4 +507,3 @@ module_exit(wd977_exit); | |||
507 | MODULE_AUTHOR("Woody Suwalski <woodys@xandros.com>"); | 507 | MODULE_AUTHOR("Woody Suwalski <woodys@xandros.com>"); |
508 | MODULE_DESCRIPTION("W83977AF Watchdog driver"); | 508 | MODULE_DESCRIPTION("W83977AF Watchdog driver"); |
509 | MODULE_LICENSE("GPL"); | 509 | MODULE_LICENSE("GPL"); |
510 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
diff --git a/drivers/watchdog/wdt_pci.c b/drivers/watchdog/wdt_pci.c index 36a54c0e32dd..ee89ba4dea63 100644 --- a/drivers/watchdog/wdt_pci.c +++ b/drivers/watchdog/wdt_pci.c | |||
@@ -744,5 +744,3 @@ module_pci_driver(wdtpci_driver); | |||
744 | MODULE_AUTHOR("JP Nollmann, Alan Cox"); | 744 | MODULE_AUTHOR("JP Nollmann, Alan Cox"); |
745 | MODULE_DESCRIPTION("Driver for the ICS PCI-WDT500/501 watchdog cards"); | 745 | MODULE_DESCRIPTION("Driver for the ICS PCI-WDT500/501 watchdog cards"); |
746 | MODULE_LICENSE("GPL"); | 746 | MODULE_LICENSE("GPL"); |
747 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
748 | MODULE_ALIAS_MISCDEV(TEMP_MINOR); | ||
diff --git a/drivers/watchdog/wm831x_wdt.c b/drivers/watchdog/wm831x_wdt.c index d4e47eda4182..e243bd01c774 100644 --- a/drivers/watchdog/wm831x_wdt.c +++ b/drivers/watchdog/wm831x_wdt.c | |||
@@ -184,7 +184,7 @@ static const struct watchdog_ops wm831x_wdt_ops = { | |||
184 | static int wm831x_wdt_probe(struct platform_device *pdev) | 184 | static int wm831x_wdt_probe(struct platform_device *pdev) |
185 | { | 185 | { |
186 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 186 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
187 | struct wm831x_pdata *chip_pdata; | 187 | struct wm831x_pdata *chip_pdata = dev_get_platdata(pdev->dev.parent); |
188 | struct wm831x_watchdog_pdata *pdata; | 188 | struct wm831x_watchdog_pdata *pdata; |
189 | struct wm831x_wdt_drvdata *driver_data; | 189 | struct wm831x_wdt_drvdata *driver_data; |
190 | struct watchdog_device *wm831x_wdt; | 190 | struct watchdog_device *wm831x_wdt; |
@@ -231,12 +231,10 @@ static int wm831x_wdt_probe(struct platform_device *pdev) | |||
231 | wm831x_wdt->timeout = wm831x_wdt_cfgs[i].time; | 231 | wm831x_wdt->timeout = wm831x_wdt_cfgs[i].time; |
232 | 232 | ||
233 | /* Apply any configuration */ | 233 | /* Apply any configuration */ |
234 | if (pdev->dev.parent->platform_data) { | 234 | if (chip_pdata) |
235 | chip_pdata = pdev->dev.parent->platform_data; | ||
236 | pdata = chip_pdata->watchdog; | 235 | pdata = chip_pdata->watchdog; |
237 | } else { | 236 | else |
238 | pdata = NULL; | 237 | pdata = NULL; |
239 | } | ||
240 | 238 | ||
241 | if (pdata) { | 239 | if (pdata) { |
242 | reg &= ~(WM831X_WDOG_SECACT_MASK | WM831X_WDOG_PRIMACT_MASK | | 240 | reg &= ~(WM831X_WDOG_SECACT_MASK | WM831X_WDOG_PRIMACT_MASK | |
diff --git a/drivers/watchdog/xen_wdt.c b/drivers/watchdog/xen_wdt.c index 92ad33d0cb71..7a42dffd39e5 100644 --- a/drivers/watchdog/xen_wdt.c +++ b/drivers/watchdog/xen_wdt.c | |||
@@ -362,4 +362,3 @@ MODULE_AUTHOR("Jan Beulich <jbeulich@novell.com>"); | |||
362 | MODULE_DESCRIPTION("Xen WatchDog Timer Driver"); | 362 | MODULE_DESCRIPTION("Xen WatchDog Timer Driver"); |
363 | MODULE_VERSION(DRV_VERSION); | 363 | MODULE_VERSION(DRV_VERSION); |
364 | MODULE_LICENSE("GPL"); | 364 | MODULE_LICENSE("GPL"); |
365 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||