diff options
Diffstat (limited to 'drivers/watchdog')
60 files changed, 924 insertions, 638 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index ad1bb9382a96..7f809fd4a57f 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
| @@ -76,6 +76,16 @@ config DA9052_WATCHDOG | |||
| 76 | Alternatively say M to compile the driver as a module, | 76 | Alternatively say M to compile the driver as a module, |
| 77 | which will be called da9052_wdt. | 77 | which will be called da9052_wdt. |
| 78 | 78 | ||
| 79 | config DA9055_WATCHDOG | ||
| 80 | tristate "Dialog Semiconductor DA9055 Watchdog" | ||
| 81 | depends on MFD_DA9055 | ||
| 82 | help | ||
| 83 | If you say yes here you get support for watchdog on the Dialog | ||
| 84 | Semiconductor DA9055 PMIC. | ||
| 85 | |||
| 86 | This driver can also be built as a module. If so, the module | ||
| 87 | will be called da9055_wdt. | ||
| 88 | |||
| 79 | config WM831X_WATCHDOG | 89 | config WM831X_WATCHDOG |
| 80 | tristate "WM831x watchdog" | 90 | tristate "WM831x watchdog" |
| 81 | depends on MFD_WM831X | 91 | depends on MFD_WM831X |
| @@ -232,6 +242,7 @@ config EP93XX_WATCHDOG | |||
| 232 | config OMAP_WATCHDOG | 242 | config OMAP_WATCHDOG |
| 233 | tristate "OMAP Watchdog" | 243 | tristate "OMAP Watchdog" |
| 234 | depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS | 244 | depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS |
| 245 | select WATCHDOG_CORE | ||
| 235 | help | 246 | help |
| 236 | Support for TI OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog. Say 'Y' | 247 | Support for TI OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog. Say 'Y' |
| 237 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. | 248 | here to enable the OMAP1610/OMAP1710/OMAP2420/OMAP3430/OMAP4430 watchdog timer. |
| @@ -300,6 +311,7 @@ config COH901327_WATCHDOG | |||
| 300 | config TWL4030_WATCHDOG | 311 | config TWL4030_WATCHDOG |
| 301 | tristate "TWL4030 Watchdog" | 312 | tristate "TWL4030 Watchdog" |
| 302 | depends on TWL4030_CORE | 313 | depends on TWL4030_CORE |
| 314 | select WATCHDOG_CORE | ||
| 303 | help | 315 | help |
| 304 | Support for TI TWL4030 watchdog. Say 'Y' here to enable the | 316 | Support for TI TWL4030 watchdog. Say 'Y' here to enable the |
| 305 | watchdog timer support for TWL4030 chips. | 317 | watchdog timer support for TWL4030 chips. |
| @@ -342,7 +354,7 @@ config MAX63XX_WATCHDOG | |||
| 342 | 354 | ||
| 343 | config IMX2_WDT | 355 | config IMX2_WDT |
| 344 | tristate "IMX2+ Watchdog" | 356 | tristate "IMX2+ Watchdog" |
| 345 | depends on IMX_HAVE_PLATFORM_IMX2_WDT | 357 | depends on ARCH_MXC |
| 346 | help | 358 | help |
| 347 | This is the driver for the hardware watchdog | 359 | This is the driver for the hardware watchdog |
| 348 | on the Freescale IMX2 and later processors. | 360 | on the Freescale IMX2 and later processors. |
| @@ -431,7 +443,7 @@ config ALIM7101_WDT | |||
| 431 | 443 | ||
| 432 | config F71808E_WDT | 444 | config F71808E_WDT |
| 433 | tristate "Fintek F71808E, F71862FG, F71869, F71882FG and F71889FG Watchdog" | 445 | tristate "Fintek F71808E, F71862FG, F71869, F71882FG and F71889FG Watchdog" |
| 434 | depends on X86 && EXPERIMENTAL | 446 | depends on X86 |
| 435 | help | 447 | help |
| 436 | This is the driver for the hardware watchdog on the Fintek | 448 | This is the driver for the hardware watchdog on the Fintek |
| 437 | F71808E, F71862FG, F71869, F71882FG and F71889FG Super I/O controllers. | 449 | F71808E, F71862FG, F71869, F71882FG and F71889FG Super I/O controllers. |
| @@ -622,7 +634,7 @@ config IT8712F_WDT | |||
| 622 | 634 | ||
| 623 | config IT87_WDT | 635 | config IT87_WDT |
| 624 | tristate "IT87 Watchdog Timer" | 636 | tristate "IT87 Watchdog Timer" |
| 625 | depends on X86 && EXPERIMENTAL | 637 | depends on X86 |
| 626 | ---help--- | 638 | ---help--- |
| 627 | This is the driver for the hardware watchdog on the ITE IT8702, | 639 | This is the driver for the hardware watchdog on the ITE IT8702, |
| 628 | IT8712, IT8716, IT8718, IT8720, IT8721, IT8726 and IT8728 | 640 | IT8712, IT8716, IT8718, IT8720, IT8721, IT8726 and IT8728 |
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile index 572b39bed06a..97bbdb3a4648 100644 --- a/drivers/watchdog/Makefile +++ b/drivers/watchdog/Makefile | |||
| @@ -164,6 +164,7 @@ obj-$(CONFIG_XEN_WDT) += xen_wdt.o | |||
| 164 | 164 | ||
| 165 | # Architecture Independent | 165 | # Architecture Independent |
| 166 | obj-$(CONFIG_DA9052_WATCHDOG) += da9052_wdt.o | 166 | obj-$(CONFIG_DA9052_WATCHDOG) += da9052_wdt.o |
| 167 | obj-$(CONFIG_DA9055_WATCHDOG) += da9055_wdt.o | ||
| 167 | obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o | 168 | obj-$(CONFIG_WM831X_WATCHDOG) += wm831x_wdt.o |
| 168 | obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o | 169 | obj-$(CONFIG_WM8350_WATCHDOG) += wm8350_wdt.o |
| 169 | obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o | 170 | obj-$(CONFIG_MAX63XX_WATCHDOG) += max63xx_wdt.o |
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index 4397881c83f4..24a517777fa0 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c | |||
| @@ -240,7 +240,7 @@ static struct miscdevice acq_miscdev = { | |||
| 240 | * Init & exit routines | 240 | * Init & exit routines |
| 241 | */ | 241 | */ |
| 242 | 242 | ||
| 243 | static int __devinit acq_probe(struct platform_device *dev) | 243 | static int acq_probe(struct platform_device *dev) |
| 244 | { | 244 | { |
| 245 | int ret; | 245 | int ret; |
| 246 | 246 | ||
| @@ -275,7 +275,7 @@ out: | |||
| 275 | return ret; | 275 | return ret; |
| 276 | } | 276 | } |
| 277 | 277 | ||
| 278 | static int __devexit acq_remove(struct platform_device *dev) | 278 | static int acq_remove(struct platform_device *dev) |
| 279 | { | 279 | { |
| 280 | misc_deregister(&acq_miscdev); | 280 | misc_deregister(&acq_miscdev); |
| 281 | release_region(wdt_start, 1); | 281 | release_region(wdt_start, 1); |
| @@ -293,7 +293,7 @@ static void acq_shutdown(struct platform_device *dev) | |||
| 293 | 293 | ||
| 294 | static struct platform_driver acquirewdt_driver = { | 294 | static struct platform_driver acquirewdt_driver = { |
| 295 | .probe = acq_probe, | 295 | .probe = acq_probe, |
| 296 | .remove = __devexit_p(acq_remove), | 296 | .remove = acq_remove, |
| 297 | .shutdown = acq_shutdown, | 297 | .shutdown = acq_shutdown, |
| 298 | .driver = { | 298 | .driver = { |
| 299 | .owner = THIS_MODULE, | 299 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c index 64ae9e9fed94..cc6702fc5268 100644 --- a/drivers/watchdog/advantechwdt.c +++ b/drivers/watchdog/advantechwdt.c | |||
| @@ -238,7 +238,7 @@ static struct miscdevice advwdt_miscdev = { | |||
| 238 | * Init & exit routines | 238 | * Init & exit routines |
| 239 | */ | 239 | */ |
| 240 | 240 | ||
| 241 | static int __devinit advwdt_probe(struct platform_device *dev) | 241 | static int advwdt_probe(struct platform_device *dev) |
| 242 | { | 242 | { |
| 243 | int ret; | 243 | int ret; |
| 244 | 244 | ||
| @@ -282,7 +282,7 @@ unreg_stop: | |||
| 282 | goto out; | 282 | goto out; |
| 283 | } | 283 | } |
| 284 | 284 | ||
| 285 | static int __devexit advwdt_remove(struct platform_device *dev) | 285 | static int advwdt_remove(struct platform_device *dev) |
| 286 | { | 286 | { |
| 287 | misc_deregister(&advwdt_miscdev); | 287 | misc_deregister(&advwdt_miscdev); |
| 288 | release_region(wdt_start, 1); | 288 | release_region(wdt_start, 1); |
| @@ -300,7 +300,7 @@ static void advwdt_shutdown(struct platform_device *dev) | |||
| 300 | 300 | ||
| 301 | static struct platform_driver advwdt_driver = { | 301 | static struct platform_driver advwdt_driver = { |
| 302 | .probe = advwdt_probe, | 302 | .probe = advwdt_probe, |
| 303 | .remove = __devexit_p(advwdt_remove), | 303 | .remove = advwdt_remove, |
| 304 | .shutdown = advwdt_shutdown, | 304 | .shutdown = advwdt_shutdown, |
| 305 | .driver = { | 305 | .driver = { |
| 306 | .owner = THIS_MODULE, | 306 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c index dc30dbd21cf1..3003e2a9580b 100644 --- a/drivers/watchdog/ar7_wdt.c +++ b/drivers/watchdog/ar7_wdt.c | |||
| @@ -274,7 +274,7 @@ static struct miscdevice ar7_wdt_miscdev = { | |||
| 274 | .fops = &ar7_wdt_fops, | 274 | .fops = &ar7_wdt_fops, |
| 275 | }; | 275 | }; |
| 276 | 276 | ||
| 277 | static int __devinit ar7_wdt_probe(struct platform_device *pdev) | 277 | static int ar7_wdt_probe(struct platform_device *pdev) |
| 278 | { | 278 | { |
| 279 | int rc; | 279 | int rc; |
| 280 | 280 | ||
| @@ -314,7 +314,7 @@ out: | |||
| 314 | return rc; | 314 | return rc; |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | static int __devexit ar7_wdt_remove(struct platform_device *pdev) | 317 | static int ar7_wdt_remove(struct platform_device *pdev) |
| 318 | { | 318 | { |
| 319 | misc_deregister(&ar7_wdt_miscdev); | 319 | misc_deregister(&ar7_wdt_miscdev); |
| 320 | clk_put(vbus_clk); | 320 | clk_put(vbus_clk); |
| @@ -330,7 +330,7 @@ static void ar7_wdt_shutdown(struct platform_device *pdev) | |||
| 330 | 330 | ||
| 331 | static struct platform_driver ar7_wdt_driver = { | 331 | static struct platform_driver ar7_wdt_driver = { |
| 332 | .probe = ar7_wdt_probe, | 332 | .probe = ar7_wdt_probe, |
| 333 | .remove = __devexit_p(ar7_wdt_remove), | 333 | .remove = ar7_wdt_remove, |
| 334 | .shutdown = ar7_wdt_shutdown, | 334 | .shutdown = ar7_wdt_shutdown, |
| 335 | .driver = { | 335 | .driver = { |
| 336 | .owner = THIS_MODULE, | 336 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c index 7ef99a169e3b..89831ed24a4f 100644 --- a/drivers/watchdog/at91rm9200_wdt.c +++ b/drivers/watchdog/at91rm9200_wdt.c | |||
| @@ -199,7 +199,7 @@ static struct miscdevice at91wdt_miscdev = { | |||
| 199 | .fops = &at91wdt_fops, | 199 | .fops = &at91wdt_fops, |
| 200 | }; | 200 | }; |
| 201 | 201 | ||
| 202 | static int __devinit at91wdt_probe(struct platform_device *pdev) | 202 | static int at91wdt_probe(struct platform_device *pdev) |
| 203 | { | 203 | { |
| 204 | int res; | 204 | int res; |
| 205 | 205 | ||
| @@ -216,7 +216,7 @@ static int __devinit at91wdt_probe(struct platform_device *pdev) | |||
| 216 | return 0; | 216 | return 0; |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | static int __devexit at91wdt_remove(struct platform_device *pdev) | 219 | static int at91wdt_remove(struct platform_device *pdev) |
| 220 | { | 220 | { |
| 221 | int res; | 221 | int res; |
| 222 | 222 | ||
| @@ -254,7 +254,7 @@ static int at91wdt_resume(struct platform_device *pdev) | |||
| 254 | 254 | ||
| 255 | static struct platform_driver at91wdt_driver = { | 255 | static struct platform_driver at91wdt_driver = { |
| 256 | .probe = at91wdt_probe, | 256 | .probe = at91wdt_probe, |
| 257 | .remove = __devexit_p(at91wdt_remove), | 257 | .remove = at91wdt_remove, |
| 258 | .shutdown = at91wdt_shutdown, | 258 | .shutdown = at91wdt_shutdown, |
| 259 | .suspend = at91wdt_suspend, | 259 | .suspend = at91wdt_suspend, |
| 260 | .resume = at91wdt_resume, | 260 | .resume = at91wdt_resume, |
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c index 05e1be85fdee..dc42e44b6bc1 100644 --- a/drivers/watchdog/at91sam9_wdt.c +++ b/drivers/watchdog/at91sam9_wdt.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/timer.h> | 32 | #include <linux/timer.h> |
| 33 | #include <linux/bitops.h> | 33 | #include <linux/bitops.h> |
| 34 | #include <linux/uaccess.h> | 34 | #include <linux/uaccess.h> |
| 35 | #include <linux/of.h> | ||
| 35 | 36 | ||
| 36 | #include "at91sam9_wdt.h" | 37 | #include "at91sam9_wdt.h" |
| 37 | 38 | ||
| @@ -302,11 +303,21 @@ static int __exit at91wdt_remove(struct platform_device *pdev) | |||
| 302 | return res; | 303 | return res; |
| 303 | } | 304 | } |
| 304 | 305 | ||
| 306 | #if defined(CONFIG_OF) | ||
| 307 | static const struct of_device_id at91_wdt_dt_ids[] __initconst = { | ||
| 308 | { .compatible = "atmel,at91sam9260-wdt" }, | ||
| 309 | { /* sentinel */ } | ||
| 310 | }; | ||
| 311 | |||
| 312 | MODULE_DEVICE_TABLE(of, at91_wdt_dt_ids); | ||
| 313 | #endif | ||
| 314 | |||
| 305 | static struct platform_driver at91wdt_driver = { | 315 | static struct platform_driver at91wdt_driver = { |
| 306 | .remove = __exit_p(at91wdt_remove), | 316 | .remove = __exit_p(at91wdt_remove), |
| 307 | .driver = { | 317 | .driver = { |
| 308 | .name = "at91_wdt", | 318 | .name = "at91_wdt", |
| 309 | .owner = THIS_MODULE, | 319 | .owner = THIS_MODULE, |
| 320 | .of_match_table = of_match_ptr(at91_wdt_dt_ids), | ||
| 310 | }, | 321 | }, |
| 311 | }; | 322 | }; |
| 312 | 323 | ||
diff --git a/drivers/watchdog/ath79_wdt.c b/drivers/watchdog/ath79_wdt.c index 1f9371f49c40..38a999e60c0d 100644 --- a/drivers/watchdog/ath79_wdt.c +++ b/drivers/watchdog/ath79_wdt.c | |||
| @@ -224,7 +224,7 @@ static struct miscdevice ath79_wdt_miscdev = { | |||
| 224 | .fops = &ath79_wdt_fops, | 224 | .fops = &ath79_wdt_fops, |
| 225 | }; | 225 | }; |
| 226 | 226 | ||
| 227 | static int __devinit ath79_wdt_probe(struct platform_device *pdev) | 227 | static int ath79_wdt_probe(struct platform_device *pdev) |
| 228 | { | 228 | { |
| 229 | u32 ctrl; | 229 | u32 ctrl; |
| 230 | int err; | 230 | int err; |
| @@ -270,7 +270,7 @@ err_clk_put: | |||
| 270 | return err; | 270 | return err; |
| 271 | } | 271 | } |
| 272 | 272 | ||
| 273 | static int __devexit ath79_wdt_remove(struct platform_device *pdev) | 273 | static int ath79_wdt_remove(struct platform_device *pdev) |
| 274 | { | 274 | { |
| 275 | misc_deregister(&ath79_wdt_miscdev); | 275 | misc_deregister(&ath79_wdt_miscdev); |
| 276 | clk_disable(wdt_clk); | 276 | clk_disable(wdt_clk); |
| @@ -284,7 +284,8 @@ static void ath97_wdt_shutdown(struct platform_device *pdev) | |||
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | static struct platform_driver ath79_wdt_driver = { | 286 | static struct platform_driver ath79_wdt_driver = { |
| 287 | .remove = __devexit_p(ath79_wdt_remove), | 287 | .probe = ath79_wdt_probe, |
| 288 | .remove = ath79_wdt_remove, | ||
| 288 | .shutdown = ath97_wdt_shutdown, | 289 | .shutdown = ath97_wdt_shutdown, |
| 289 | .driver = { | 290 | .driver = { |
| 290 | .name = DRIVER_NAME, | 291 | .name = DRIVER_NAME, |
| @@ -292,17 +293,7 @@ static struct platform_driver ath79_wdt_driver = { | |||
| 292 | }, | 293 | }, |
| 293 | }; | 294 | }; |
| 294 | 295 | ||
| 295 | static int __init ath79_wdt_init(void) | 296 | module_platform_driver(ath79_wdt_driver); |
| 296 | { | ||
| 297 | return platform_driver_probe(&ath79_wdt_driver, ath79_wdt_probe); | ||
| 298 | } | ||
| 299 | module_init(ath79_wdt_init); | ||
| 300 | |||
| 301 | static void __exit ath79_wdt_exit(void) | ||
| 302 | { | ||
| 303 | platform_driver_unregister(&ath79_wdt_driver); | ||
| 304 | } | ||
| 305 | module_exit(ath79_wdt_exit); | ||
| 306 | 297 | ||
| 307 | MODULE_DESCRIPTION("Atheros AR71XX/AR724X/AR913X hardware watchdog driver"); | 298 | MODULE_DESCRIPTION("Atheros AR71XX/AR724X/AR913X hardware watchdog driver"); |
| 308 | MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org"); | 299 | MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org"); |
diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index 551880bfd629..b2b80d4ac818 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c | |||
| @@ -236,7 +236,7 @@ static struct miscdevice bcm63xx_wdt_miscdev = { | |||
| 236 | }; | 236 | }; |
| 237 | 237 | ||
| 238 | 238 | ||
| 239 | static int __devinit bcm63xx_wdt_probe(struct platform_device *pdev) | 239 | static int bcm63xx_wdt_probe(struct platform_device *pdev) |
| 240 | { | 240 | { |
| 241 | int ret; | 241 | int ret; |
| 242 | struct resource *r; | 242 | struct resource *r; |
| @@ -286,7 +286,7 @@ unmap: | |||
| 286 | return ret; | 286 | return ret; |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | static int __devexit bcm63xx_wdt_remove(struct platform_device *pdev) | 289 | static int bcm63xx_wdt_remove(struct platform_device *pdev) |
| 290 | { | 290 | { |
| 291 | if (!nowayout) | 291 | if (!nowayout) |
| 292 | bcm63xx_wdt_pause(); | 292 | bcm63xx_wdt_pause(); |
| @@ -304,7 +304,7 @@ static void bcm63xx_wdt_shutdown(struct platform_device *pdev) | |||
| 304 | 304 | ||
| 305 | static struct platform_driver bcm63xx_wdt_driver = { | 305 | static struct platform_driver bcm63xx_wdt_driver = { |
| 306 | .probe = bcm63xx_wdt_probe, | 306 | .probe = bcm63xx_wdt_probe, |
| 307 | .remove = __devexit_p(bcm63xx_wdt_remove), | 307 | .remove = bcm63xx_wdt_remove, |
| 308 | .shutdown = bcm63xx_wdt_shutdown, | 308 | .shutdown = bcm63xx_wdt_shutdown, |
| 309 | .driver = { | 309 | .driver = { |
| 310 | .owner = THIS_MODULE, | 310 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c index 38bc383e0677..5d36d6fb4969 100644 --- a/drivers/watchdog/bfin_wdt.c +++ b/drivers/watchdog/bfin_wdt.c | |||
| @@ -356,7 +356,7 @@ static const struct watchdog_info bfin_wdt_info = { | |||
| 356 | * Registers the misc device. Actual device | 356 | * Registers the misc device. Actual device |
| 357 | * initialization is handled by bfin_wdt_open(). | 357 | * initialization is handled by bfin_wdt_open(). |
| 358 | */ | 358 | */ |
| 359 | static int __devinit bfin_wdt_probe(struct platform_device *pdev) | 359 | static int bfin_wdt_probe(struct platform_device *pdev) |
| 360 | { | 360 | { |
| 361 | int ret; | 361 | int ret; |
| 362 | 362 | ||
| @@ -379,7 +379,7 @@ static int __devinit bfin_wdt_probe(struct platform_device *pdev) | |||
| 379 | * Unregisters the misc device. Actual device | 379 | * Unregisters the misc device. Actual device |
| 380 | * deinitialization is handled by bfin_wdt_close(). | 380 | * deinitialization is handled by bfin_wdt_close(). |
| 381 | */ | 381 | */ |
| 382 | static int __devexit bfin_wdt_remove(struct platform_device *pdev) | 382 | static int bfin_wdt_remove(struct platform_device *pdev) |
| 383 | { | 383 | { |
| 384 | misc_deregister(&bfin_wdt_miscdev); | 384 | misc_deregister(&bfin_wdt_miscdev); |
| 385 | return 0; | 385 | return 0; |
| @@ -401,7 +401,7 @@ static struct platform_device *bfin_wdt_device; | |||
| 401 | 401 | ||
| 402 | static struct platform_driver bfin_wdt_driver = { | 402 | static struct platform_driver bfin_wdt_driver = { |
| 403 | .probe = bfin_wdt_probe, | 403 | .probe = bfin_wdt_probe, |
| 404 | .remove = __devexit_p(bfin_wdt_remove), | 404 | .remove = bfin_wdt_remove, |
| 405 | .shutdown = bfin_wdt_shutdown, | 405 | .shutdown = bfin_wdt_shutdown, |
| 406 | .suspend = bfin_wdt_suspend, | 406 | .suspend = bfin_wdt_suspend, |
| 407 | .resume = bfin_wdt_resume, | 407 | .resume = bfin_wdt_resume, |
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c index 5b06d31ab6a9..c0bc92d8e438 100644 --- a/drivers/watchdog/booke_wdt.c +++ b/drivers/watchdog/booke_wdt.c | |||
| @@ -212,7 +212,7 @@ static long booke_wdt_ioctl(struct file *file, | |||
| 212 | return 0; | 212 | return 0; |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | /* wdt_is_active stores wether or not the /dev/watchdog device is opened */ | 215 | /* wdt_is_active stores whether or not the /dev/watchdog device is opened */ |
| 216 | static unsigned long wdt_is_active; | 216 | static unsigned long wdt_is_active; |
| 217 | 217 | ||
| 218 | static int booke_wdt_open(struct inode *inode, struct file *file) | 218 | static int booke_wdt_open(struct inode *inode, struct file *file) |
diff --git a/drivers/watchdog/cpu5wdt.c b/drivers/watchdog/cpu5wdt.c index 7e888393de1f..f270bb7bc456 100644 --- a/drivers/watchdog/cpu5wdt.c +++ b/drivers/watchdog/cpu5wdt.c | |||
| @@ -215,7 +215,7 @@ static struct miscdevice cpu5wdt_misc = { | |||
| 215 | 215 | ||
| 216 | /* init/exit function */ | 216 | /* init/exit function */ |
| 217 | 217 | ||
| 218 | static int __devinit cpu5wdt_init(void) | 218 | static int cpu5wdt_init(void) |
| 219 | { | 219 | { |
| 220 | unsigned int val; | 220 | unsigned int val; |
| 221 | int err; | 221 | int err; |
| @@ -256,16 +256,17 @@ no_port: | |||
| 256 | return err; | 256 | return err; |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | static int __devinit cpu5wdt_init_module(void) | 259 | static int cpu5wdt_init_module(void) |
| 260 | { | 260 | { |
| 261 | return cpu5wdt_init(); | 261 | return cpu5wdt_init(); |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | static void __devexit cpu5wdt_exit(void) | 264 | static void cpu5wdt_exit(void) |
| 265 | { | 265 | { |
| 266 | if (cpu5wdt_device.queue) { | 266 | if (cpu5wdt_device.queue) { |
| 267 | cpu5wdt_device.queue = 0; | 267 | cpu5wdt_device.queue = 0; |
| 268 | wait_for_completion(&cpu5wdt_device.stop); | 268 | wait_for_completion(&cpu5wdt_device.stop); |
| 269 | del_timer(&cpu5wdt_device.timer); | ||
| 269 | } | 270 | } |
| 270 | 271 | ||
| 271 | misc_deregister(&cpu5wdt_misc); | 272 | misc_deregister(&cpu5wdt_misc); |
| @@ -274,7 +275,7 @@ static void __devexit cpu5wdt_exit(void) | |||
| 274 | 275 | ||
| 275 | } | 276 | } |
| 276 | 277 | ||
| 277 | static void __devexit cpu5wdt_exit_module(void) | 278 | static void cpu5wdt_exit_module(void) |
| 278 | { | 279 | { |
| 279 | cpu5wdt_exit(); | 280 | cpu5wdt_exit(); |
| 280 | } | 281 | } |
diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c index 95b1b954de1b..11d55ce5ca81 100644 --- a/drivers/watchdog/cpwd.c +++ b/drivers/watchdog/cpwd.c | |||
| @@ -528,7 +528,7 @@ static const struct file_operations cpwd_fops = { | |||
| 528 | .llseek = no_llseek, | 528 | .llseek = no_llseek, |
| 529 | }; | 529 | }; |
| 530 | 530 | ||
| 531 | static int __devinit cpwd_probe(struct platform_device *op) | 531 | static int cpwd_probe(struct platform_device *op) |
| 532 | { | 532 | { |
| 533 | struct device_node *options; | 533 | struct device_node *options; |
| 534 | const char *str_prop; | 534 | const char *str_prop; |
| @@ -640,7 +640,7 @@ out_free: | |||
| 640 | goto out; | 640 | goto out; |
| 641 | } | 641 | } |
| 642 | 642 | ||
| 643 | static int __devexit cpwd_remove(struct platform_device *op) | 643 | static int cpwd_remove(struct platform_device *op) |
| 644 | { | 644 | { |
| 645 | struct cpwd *p = dev_get_drvdata(&op->dev); | 645 | struct cpwd *p = dev_get_drvdata(&op->dev); |
| 646 | int i; | 646 | int i; |
| @@ -684,7 +684,7 @@ static struct platform_driver cpwd_driver = { | |||
| 684 | .of_match_table = cpwd_match, | 684 | .of_match_table = cpwd_match, |
| 685 | }, | 685 | }, |
| 686 | .probe = cpwd_probe, | 686 | .probe = cpwd_probe, |
| 687 | .remove = __devexit_p(cpwd_remove), | 687 | .remove = cpwd_remove, |
| 688 | }; | 688 | }; |
| 689 | 689 | ||
| 690 | module_platform_driver(cpwd_driver); | 690 | module_platform_driver(cpwd_driver); |
diff --git a/drivers/watchdog/da9052_wdt.c b/drivers/watchdog/da9052_wdt.c index f7abbaeebcaf..367445009c64 100644 --- a/drivers/watchdog/da9052_wdt.c +++ b/drivers/watchdog/da9052_wdt.c | |||
| @@ -53,10 +53,6 @@ static const struct { | |||
| 53 | 53 | ||
| 54 | static void da9052_wdt_release_resources(struct kref *r) | 54 | static void da9052_wdt_release_resources(struct kref *r) |
| 55 | { | 55 | { |
| 56 | struct da9052_wdt_data *driver_data = | ||
| 57 | container_of(r, struct da9052_wdt_data, kref); | ||
| 58 | |||
| 59 | kfree(driver_data); | ||
| 60 | } | 56 | } |
| 61 | 57 | ||
| 62 | static int da9052_wdt_set_timeout(struct watchdog_device *wdt_dev, | 58 | static int da9052_wdt_set_timeout(struct watchdog_device *wdt_dev, |
| @@ -179,7 +175,7 @@ static const struct watchdog_ops da9052_wdt_ops = { | |||
| 179 | }; | 175 | }; |
| 180 | 176 | ||
| 181 | 177 | ||
| 182 | static int __devinit da9052_wdt_probe(struct platform_device *pdev) | 178 | static int da9052_wdt_probe(struct platform_device *pdev) |
| 183 | { | 179 | { |
| 184 | struct da9052 *da9052 = dev_get_drvdata(pdev->dev.parent); | 180 | struct da9052 *da9052 = dev_get_drvdata(pdev->dev.parent); |
| 185 | struct da9052_wdt_data *driver_data; | 181 | struct da9052_wdt_data *driver_data; |
| @@ -224,7 +220,7 @@ err: | |||
| 224 | return ret; | 220 | return ret; |
| 225 | } | 221 | } |
| 226 | 222 | ||
| 227 | static int __devexit da9052_wdt_remove(struct platform_device *pdev) | 223 | static int da9052_wdt_remove(struct platform_device *pdev) |
| 228 | { | 224 | { |
| 229 | struct da9052_wdt_data *driver_data = dev_get_drvdata(&pdev->dev); | 225 | struct da9052_wdt_data *driver_data = dev_get_drvdata(&pdev->dev); |
| 230 | 226 | ||
| @@ -236,7 +232,7 @@ static int __devexit da9052_wdt_remove(struct platform_device *pdev) | |||
| 236 | 232 | ||
| 237 | static struct platform_driver da9052_wdt_driver = { | 233 | static struct platform_driver da9052_wdt_driver = { |
| 238 | .probe = da9052_wdt_probe, | 234 | .probe = da9052_wdt_probe, |
| 239 | .remove = __devexit_p(da9052_wdt_remove), | 235 | .remove = da9052_wdt_remove, |
| 240 | .driver = { | 236 | .driver = { |
| 241 | .name = "da9052-watchdog", | 237 | .name = "da9052-watchdog", |
| 242 | }, | 238 | }, |
diff --git a/drivers/watchdog/da9055_wdt.c b/drivers/watchdog/da9055_wdt.c new file mode 100644 index 000000000000..f5ad10546fc9 --- /dev/null +++ b/drivers/watchdog/da9055_wdt.c | |||
| @@ -0,0 +1,211 @@ | |||
| 1 | /* | ||
| 2 | * System monitoring driver for DA9055 PMICs. | ||
| 3 | * | ||
| 4 | * Copyright(c) 2012 Dialog Semiconductor Ltd. | ||
| 5 | * | ||
| 6 | * Author: David Dajun Chen <dchen@diasemi.com> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | */ | ||
| 14 | |||
| 15 | #include <linux/module.h> | ||
| 16 | #include <linux/types.h> | ||
| 17 | #include <linux/kernel.h> | ||
| 18 | #include <linux/slab.h> | ||
| 19 | #include <linux/platform_device.h> | ||
| 20 | #include <linux/watchdog.h> | ||
| 21 | #include <linux/delay.h> | ||
| 22 | |||
| 23 | #include <linux/mfd/da9055/core.h> | ||
| 24 | #include <linux/mfd/da9055/reg.h> | ||
| 25 | |||
| 26 | static bool nowayout = WATCHDOG_NOWAYOUT; | ||
| 27 | module_param(nowayout, bool, 0); | ||
| 28 | MODULE_PARM_DESC(nowayout, | ||
| 29 | "Watchdog cannot be stopped once started (default=" | ||
| 30 | __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | ||
| 31 | |||
| 32 | #define DA9055_DEF_TIMEOUT 4 | ||
| 33 | #define DA9055_TWDMIN 256 | ||
| 34 | |||
| 35 | struct da9055_wdt_data { | ||
| 36 | struct watchdog_device wdt; | ||
| 37 | struct da9055 *da9055; | ||
| 38 | struct kref kref; | ||
| 39 | }; | ||
| 40 | |||
| 41 | static const struct { | ||
| 42 | u8 reg_val; | ||
| 43 | int user_time; /* In seconds */ | ||
| 44 | } da9055_wdt_maps[] = { | ||
| 45 | { 0, 0 }, | ||
| 46 | { 1, 2 }, | ||
| 47 | { 2, 4 }, | ||
| 48 | { 3, 8 }, | ||
| 49 | { 4, 16 }, | ||
| 50 | { 5, 32 }, | ||
| 51 | { 5, 33 }, /* Actual time 32.768s so included both 32s and 33s */ | ||
| 52 | { 6, 65 }, | ||
| 53 | { 6, 66 }, /* Actual time 65.536s so include both, 65s and 66s */ | ||
| 54 | { 7, 131 }, | ||
| 55 | }; | ||
| 56 | |||
| 57 | static int da9055_wdt_set_timeout(struct watchdog_device *wdt_dev, | ||
| 58 | unsigned int timeout) | ||
| 59 | { | ||
| 60 | struct da9055_wdt_data *driver_data = watchdog_get_drvdata(wdt_dev); | ||
| 61 | struct da9055 *da9055 = driver_data->da9055; | ||
| 62 | int ret, i; | ||
| 63 | |||
| 64 | for (i = 0; i < ARRAY_SIZE(da9055_wdt_maps); i++) | ||
| 65 | if (da9055_wdt_maps[i].user_time == timeout) | ||
| 66 | break; | ||
| 67 | |||
| 68 | if (i == ARRAY_SIZE(da9055_wdt_maps)) | ||
| 69 | ret = -EINVAL; | ||
| 70 | else | ||
| 71 | ret = da9055_reg_update(da9055, DA9055_REG_CONTROL_B, | ||
| 72 | DA9055_TWDSCALE_MASK, | ||
| 73 | da9055_wdt_maps[i].reg_val << | ||
| 74 | DA9055_TWDSCALE_SHIFT); | ||
| 75 | if (ret < 0) { | ||
| 76 | dev_err(da9055->dev, | ||
| 77 | "Failed to update timescale bit, %d\n", ret); | ||
| 78 | return ret; | ||
| 79 | } | ||
| 80 | |||
| 81 | wdt_dev->timeout = timeout; | ||
| 82 | |||
| 83 | return 0; | ||
| 84 | } | ||
| 85 | |||
| 86 | static int da9055_wdt_ping(struct watchdog_device *wdt_dev) | ||
| 87 | { | ||
| 88 | struct da9055_wdt_data *driver_data = watchdog_get_drvdata(wdt_dev); | ||
| 89 | struct da9055 *da9055 = driver_data->da9055; | ||
| 90 | |||
| 91 | /* | ||
| 92 | * We have a minimum time for watchdog window called TWDMIN. A write | ||
| 93 | * to the watchdog before this elapsed time will cause an error. | ||
| 94 | */ | ||
| 95 | mdelay(DA9055_TWDMIN); | ||
| 96 | |||
| 97 | /* Reset the watchdog timer */ | ||
| 98 | return da9055_reg_update(da9055, DA9055_REG_CONTROL_E, | ||
| 99 | DA9055_WATCHDOG_MASK, 1); | ||
| 100 | } | ||
| 101 | |||
| 102 | static void da9055_wdt_release_resources(struct kref *r) | ||
| 103 | { | ||
| 104 | } | ||
| 105 | |||
| 106 | static void da9055_wdt_ref(struct watchdog_device *wdt_dev) | ||
| 107 | { | ||
| 108 | struct da9055_wdt_data *driver_data = watchdog_get_drvdata(wdt_dev); | ||
| 109 | |||
| 110 | kref_get(&driver_data->kref); | ||
| 111 | } | ||
| 112 | |||
| 113 | static void da9055_wdt_unref(struct watchdog_device *wdt_dev) | ||
| 114 | { | ||
| 115 | struct da9055_wdt_data *driver_data = watchdog_get_drvdata(wdt_dev); | ||
| 116 | |||
| 117 | kref_put(&driver_data->kref, da9055_wdt_release_resources); | ||
| 118 | } | ||
| 119 | |||
| 120 | static int da9055_wdt_start(struct watchdog_device *wdt_dev) | ||
| 121 | { | ||
| 122 | return da9055_wdt_set_timeout(wdt_dev, wdt_dev->timeout); | ||
| 123 | } | ||
| 124 | |||
| 125 | static int da9055_wdt_stop(struct watchdog_device *wdt_dev) | ||
| 126 | { | ||
| 127 | return da9055_wdt_set_timeout(wdt_dev, 0); | ||
| 128 | } | ||
| 129 | |||
| 130 | static struct watchdog_info da9055_wdt_info = { | ||
| 131 | .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, | ||
| 132 | .identity = "DA9055 Watchdog", | ||
| 133 | }; | ||
| 134 | |||
| 135 | static const struct watchdog_ops da9055_wdt_ops = { | ||
| 136 | .owner = THIS_MODULE, | ||
| 137 | .start = da9055_wdt_start, | ||
| 138 | .stop = da9055_wdt_stop, | ||
| 139 | .ping = da9055_wdt_ping, | ||
| 140 | .set_timeout = da9055_wdt_set_timeout, | ||
| 141 | .ref = da9055_wdt_ref, | ||
| 142 | .unref = da9055_wdt_unref, | ||
| 143 | }; | ||
| 144 | |||
| 145 | static int da9055_wdt_probe(struct platform_device *pdev) | ||
| 146 | { | ||
| 147 | struct da9055 *da9055 = dev_get_drvdata(pdev->dev.parent); | ||
| 148 | struct da9055_wdt_data *driver_data; | ||
| 149 | struct watchdog_device *da9055_wdt; | ||
| 150 | int ret; | ||
| 151 | |||
| 152 | driver_data = devm_kzalloc(&pdev->dev, sizeof(*driver_data), | ||
| 153 | GFP_KERNEL); | ||
| 154 | if (!driver_data) { | ||
| 155 | dev_err(da9055->dev, "Failed to allocate watchdog device\n"); | ||
| 156 | return -ENOMEM; | ||
| 157 | } | ||
| 158 | |||
| 159 | driver_data->da9055 = da9055; | ||
| 160 | |||
| 161 | da9055_wdt = &driver_data->wdt; | ||
| 162 | |||
| 163 | da9055_wdt->timeout = DA9055_DEF_TIMEOUT; | ||
| 164 | da9055_wdt->info = &da9055_wdt_info; | ||
| 165 | da9055_wdt->ops = &da9055_wdt_ops; | ||
| 166 | watchdog_set_nowayout(da9055_wdt, nowayout); | ||
| 167 | watchdog_set_drvdata(da9055_wdt, driver_data); | ||
| 168 | |||
| 169 | kref_init(&driver_data->kref); | ||
| 170 | |||
| 171 | ret = da9055_wdt_stop(da9055_wdt); | ||
| 172 | if (ret < 0) { | ||
| 173 | dev_err(&pdev->dev, "Failed to stop watchdog, %d\n", ret); | ||
| 174 | goto err; | ||
| 175 | } | ||
| 176 | |||
| 177 | dev_set_drvdata(&pdev->dev, driver_data); | ||
| 178 | |||
| 179 | ret = watchdog_register_device(&driver_data->wdt); | ||
| 180 | if (ret != 0) | ||
| 181 | dev_err(da9055->dev, "watchdog_register_device() failed: %d\n", | ||
| 182 | ret); | ||
| 183 | |||
| 184 | err: | ||
| 185 | return ret; | ||
| 186 | } | ||
| 187 | |||
| 188 | static int da9055_wdt_remove(struct platform_device *pdev) | ||
| 189 | { | ||
| 190 | struct da9055_wdt_data *driver_data = dev_get_drvdata(&pdev->dev); | ||
| 191 | |||
| 192 | watchdog_unregister_device(&driver_data->wdt); | ||
| 193 | kref_put(&driver_data->kref, da9055_wdt_release_resources); | ||
| 194 | |||
| 195 | return 0; | ||
| 196 | } | ||
| 197 | |||
| 198 | static struct platform_driver da9055_wdt_driver = { | ||
| 199 | .probe = da9055_wdt_probe, | ||
| 200 | .remove = da9055_wdt_remove, | ||
| 201 | .driver = { | ||
| 202 | .name = "da9055-watchdog", | ||
| 203 | }, | ||
| 204 | }; | ||
| 205 | |||
| 206 | module_platform_driver(da9055_wdt_driver); | ||
| 207 | |||
| 208 | MODULE_AUTHOR("David Dajun Chen <dchen@diasemi.com>"); | ||
| 209 | MODULE_DESCRIPTION("DA9055 watchdog"); | ||
| 210 | MODULE_LICENSE("GPL"); | ||
| 211 | MODULE_ALIAS("platform:da9055-watchdog"); | ||
diff --git a/drivers/watchdog/davinci_wdt.c b/drivers/watchdog/davinci_wdt.c index c8c5c8032bcb..e8e87246ea6d 100644 --- a/drivers/watchdog/davinci_wdt.c +++ b/drivers/watchdog/davinci_wdt.c | |||
| @@ -199,7 +199,7 @@ static struct miscdevice davinci_wdt_miscdev = { | |||
| 199 | .fops = &davinci_wdt_fops, | 199 | .fops = &davinci_wdt_fops, |
| 200 | }; | 200 | }; |
| 201 | 201 | ||
| 202 | static int __devinit davinci_wdt_probe(struct platform_device *pdev) | 202 | static int davinci_wdt_probe(struct platform_device *pdev) |
| 203 | { | 203 | { |
| 204 | int ret = 0, size; | 204 | int ret = 0, size; |
| 205 | struct device *dev = &pdev->dev; | 205 | struct device *dev = &pdev->dev; |
| @@ -208,7 +208,7 @@ static int __devinit davinci_wdt_probe(struct platform_device *pdev) | |||
| 208 | if (WARN_ON(IS_ERR(wdt_clk))) | 208 | if (WARN_ON(IS_ERR(wdt_clk))) |
| 209 | return PTR_ERR(wdt_clk); | 209 | return PTR_ERR(wdt_clk); |
| 210 | 210 | ||
| 211 | clk_enable(wdt_clk); | 211 | clk_prepare_enable(wdt_clk); |
| 212 | 212 | ||
| 213 | if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT) | 213 | if (heartbeat < 1 || heartbeat > MAX_HEARTBEAT) |
| 214 | heartbeat = DEFAULT_HEARTBEAT; | 214 | heartbeat = DEFAULT_HEARTBEAT; |
| @@ -248,7 +248,7 @@ static int __devinit davinci_wdt_probe(struct platform_device *pdev) | |||
| 248 | return ret; | 248 | return ret; |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | static int __devexit davinci_wdt_remove(struct platform_device *pdev) | 251 | static int davinci_wdt_remove(struct platform_device *pdev) |
| 252 | { | 252 | { |
| 253 | misc_deregister(&davinci_wdt_miscdev); | 253 | misc_deregister(&davinci_wdt_miscdev); |
| 254 | if (wdt_mem) { | 254 | if (wdt_mem) { |
| @@ -256,19 +256,26 @@ static int __devexit davinci_wdt_remove(struct platform_device *pdev) | |||
| 256 | wdt_mem = NULL; | 256 | wdt_mem = NULL; |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | clk_disable(wdt_clk); | 259 | clk_disable_unprepare(wdt_clk); |
| 260 | clk_put(wdt_clk); | 260 | clk_put(wdt_clk); |
| 261 | 261 | ||
| 262 | return 0; | 262 | return 0; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | static const struct of_device_id davinci_wdt_of_match[] = { | ||
| 266 | { .compatible = "ti,davinci-wdt", }, | ||
| 267 | {}, | ||
| 268 | }; | ||
| 269 | MODULE_DEVICE_TABLE(of, davinci_wdt_of_match); | ||
| 270 | |||
| 265 | static struct platform_driver platform_wdt_driver = { | 271 | static struct platform_driver platform_wdt_driver = { |
| 266 | .driver = { | 272 | .driver = { |
| 267 | .name = "watchdog", | 273 | .name = "watchdog", |
| 268 | .owner = THIS_MODULE, | 274 | .owner = THIS_MODULE, |
| 275 | .of_match_table = davinci_wdt_of_match, | ||
| 269 | }, | 276 | }, |
| 270 | .probe = davinci_wdt_probe, | 277 | .probe = davinci_wdt_probe, |
| 271 | .remove = __devexit_p(davinci_wdt_remove), | 278 | .remove = davinci_wdt_remove, |
| 272 | }; | 279 | }; |
| 273 | 280 | ||
| 274 | module_platform_driver(platform_wdt_driver); | 281 | module_platform_driver(platform_wdt_driver); |
diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c index 06de1211a444..a0eba3c40e25 100644 --- a/drivers/watchdog/dw_wdt.c +++ b/drivers/watchdog/dw_wdt.c | |||
| @@ -293,7 +293,7 @@ static struct miscdevice dw_wdt_miscdev = { | |||
| 293 | .minor = WATCHDOG_MINOR, | 293 | .minor = WATCHDOG_MINOR, |
| 294 | }; | 294 | }; |
| 295 | 295 | ||
| 296 | static int __devinit dw_wdt_drv_probe(struct platform_device *pdev) | 296 | static int dw_wdt_drv_probe(struct platform_device *pdev) |
| 297 | { | 297 | { |
| 298 | int ret; | 298 | int ret; |
| 299 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 299 | struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| @@ -333,7 +333,7 @@ out_put_clk: | |||
| 333 | return ret; | 333 | return ret; |
| 334 | } | 334 | } |
| 335 | 335 | ||
| 336 | static int __devexit dw_wdt_drv_remove(struct platform_device *pdev) | 336 | static int dw_wdt_drv_remove(struct platform_device *pdev) |
| 337 | { | 337 | { |
| 338 | misc_deregister(&dw_wdt_miscdev); | 338 | misc_deregister(&dw_wdt_miscdev); |
| 339 | 339 | ||
| @@ -345,7 +345,7 @@ static int __devexit dw_wdt_drv_remove(struct platform_device *pdev) | |||
| 345 | 345 | ||
| 346 | static struct platform_driver dw_wdt_driver = { | 346 | static struct platform_driver dw_wdt_driver = { |
| 347 | .probe = dw_wdt_drv_probe, | 347 | .probe = dw_wdt_drv_probe, |
| 348 | .remove = __devexit_p(dw_wdt_drv_remove), | 348 | .remove = dw_wdt_drv_remove, |
| 349 | .driver = { | 349 | .driver = { |
| 350 | .name = "dw_wdt", | 350 | .name = "dw_wdt", |
| 351 | .owner = THIS_MODULE, | 351 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c index 77050037597a..e0574844c313 100644 --- a/drivers/watchdog/ep93xx_wdt.c +++ b/drivers/watchdog/ep93xx_wdt.c | |||
| @@ -112,7 +112,7 @@ static struct watchdog_device ep93xx_wdt_wdd = { | |||
| 112 | .ops = &ep93xx_wdt_ops, | 112 | .ops = &ep93xx_wdt_ops, |
| 113 | }; | 113 | }; |
| 114 | 114 | ||
| 115 | static int __devinit ep93xx_wdt_probe(struct platform_device *pdev) | 115 | static int ep93xx_wdt_probe(struct platform_device *pdev) |
| 116 | { | 116 | { |
| 117 | struct resource *res; | 117 | struct resource *res; |
| 118 | unsigned long val; | 118 | unsigned long val; |
| @@ -156,7 +156,7 @@ static int __devinit ep93xx_wdt_probe(struct platform_device *pdev) | |||
| 156 | return 0; | 156 | return 0; |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | static int __devexit ep93xx_wdt_remove(struct platform_device *pdev) | 159 | static int ep93xx_wdt_remove(struct platform_device *pdev) |
| 160 | { | 160 | { |
| 161 | watchdog_unregister_device(&ep93xx_wdt_wdd); | 161 | watchdog_unregister_device(&ep93xx_wdt_wdd); |
| 162 | return 0; | 162 | return 0; |
| @@ -168,7 +168,7 @@ static struct platform_driver ep93xx_wdt_driver = { | |||
| 168 | .name = "ep93xx-wdt", | 168 | .name = "ep93xx-wdt", |
| 169 | }, | 169 | }, |
| 170 | .probe = ep93xx_wdt_probe, | 170 | .probe = ep93xx_wdt_probe, |
| 171 | .remove = __devexit_p(ep93xx_wdt_remove), | 171 | .remove = ep93xx_wdt_remove, |
| 172 | }; | 172 | }; |
| 173 | 173 | ||
| 174 | module_platform_driver(ep93xx_wdt_driver); | 174 | module_platform_driver(ep93xx_wdt_driver); |
diff --git a/drivers/watchdog/gef_wdt.c b/drivers/watchdog/gef_wdt.c index 17f4cae770c6..b9c5b58e59d3 100644 --- a/drivers/watchdog/gef_wdt.c +++ b/drivers/watchdog/gef_wdt.c | |||
| @@ -262,7 +262,7 @@ static struct miscdevice gef_wdt_miscdev = { | |||
| 262 | }; | 262 | }; |
| 263 | 263 | ||
| 264 | 264 | ||
| 265 | static int __devinit gef_wdt_probe(struct platform_device *dev) | 265 | static int gef_wdt_probe(struct platform_device *dev) |
| 266 | { | 266 | { |
| 267 | int timeout = 10; | 267 | int timeout = 10; |
| 268 | u32 freq; | 268 | u32 freq; |
| @@ -285,7 +285,7 @@ static int __devinit gef_wdt_probe(struct platform_device *dev) | |||
| 285 | return misc_register(&gef_wdt_miscdev); | 285 | return misc_register(&gef_wdt_miscdev); |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | static int __devexit gef_wdt_remove(struct platform_device *dev) | 288 | static int gef_wdt_remove(struct platform_device *dev) |
| 289 | { | 289 | { |
| 290 | misc_deregister(&gef_wdt_miscdev); | 290 | misc_deregister(&gef_wdt_miscdev); |
| 291 | 291 | ||
diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c index dc563b680abd..fcd599d4e225 100644 --- a/drivers/watchdog/geodewdt.c +++ b/drivers/watchdog/geodewdt.c | |||
| @@ -215,7 +215,7 @@ static struct miscdevice geodewdt_miscdev = { | |||
| 215 | .fops = &geodewdt_fops, | 215 | .fops = &geodewdt_fops, |
| 216 | }; | 216 | }; |
| 217 | 217 | ||
| 218 | static int __devinit geodewdt_probe(struct platform_device *dev) | 218 | static int geodewdt_probe(struct platform_device *dev) |
| 219 | { | 219 | { |
| 220 | int ret; | 220 | int ret; |
| 221 | 221 | ||
| @@ -243,7 +243,7 @@ static int __devinit geodewdt_probe(struct platform_device *dev) | |||
| 243 | return ret; | 243 | return ret; |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | static int __devexit geodewdt_remove(struct platform_device *dev) | 246 | static int geodewdt_remove(struct platform_device *dev) |
| 247 | { | 247 | { |
| 248 | misc_deregister(&geodewdt_miscdev); | 248 | misc_deregister(&geodewdt_miscdev); |
| 249 | return 0; | 249 | return 0; |
| @@ -256,7 +256,7 @@ static void geodewdt_shutdown(struct platform_device *dev) | |||
| 256 | 256 | ||
| 257 | static struct platform_driver geodewdt_driver = { | 257 | static struct platform_driver geodewdt_driver = { |
| 258 | .probe = geodewdt_probe, | 258 | .probe = geodewdt_probe, |
| 259 | .remove = __devexit_p(geodewdt_remove), | 259 | .remove = geodewdt_remove, |
| 260 | .shutdown = geodewdt_shutdown, | 260 | .shutdown = geodewdt_shutdown, |
| 261 | .driver = { | 261 | .driver = { |
| 262 | .owner = THIS_MODULE, | 262 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index ae60406ea8a1..11796b9b864e 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | #endif /* CONFIG_HPWDT_NMI_DECODING */ | 39 | #endif /* CONFIG_HPWDT_NMI_DECODING */ |
| 40 | #include <asm/nmi.h> | 40 | #include <asm/nmi.h> |
| 41 | 41 | ||
| 42 | #define HPWDT_VERSION "1.3.0" | 42 | #define HPWDT_VERSION "1.3.1" |
| 43 | #define SECS_TO_TICKS(secs) ((secs) * 1000 / 128) | 43 | #define SECS_TO_TICKS(secs) ((secs) * 1000 / 128) |
| 44 | #define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000) | 44 | #define TICKS_TO_SECS(ticks) ((ticks) * 128 / 1000) |
| 45 | #define HPWDT_MAX_TIMER TICKS_TO_SECS(65535) | 45 | #define HPWDT_MAX_TIMER TICKS_TO_SECS(65535) |
| @@ -212,7 +212,7 @@ asm(".text \n\t" | |||
| 212 | * 0 : SUCCESS | 212 | * 0 : SUCCESS |
| 213 | * <0 : FAILURE | 213 | * <0 : FAILURE |
| 214 | */ | 214 | */ |
| 215 | static int __devinit cru_detect(unsigned long map_entry, | 215 | static int cru_detect(unsigned long map_entry, |
| 216 | unsigned long map_offset) | 216 | unsigned long map_offset) |
| 217 | { | 217 | { |
| 218 | void *bios32_map; | 218 | void *bios32_map; |
| @@ -268,7 +268,7 @@ static int __devinit cru_detect(unsigned long map_entry, | |||
| 268 | /* | 268 | /* |
| 269 | * bios_checksum | 269 | * bios_checksum |
| 270 | */ | 270 | */ |
| 271 | static int __devinit bios_checksum(const char __iomem *ptr, int len) | 271 | static int bios_checksum(const char __iomem *ptr, int len) |
| 272 | { | 272 | { |
| 273 | char sum = 0; | 273 | char sum = 0; |
| 274 | int i; | 274 | int i; |
| @@ -293,7 +293,7 @@ static int __devinit bios_checksum(const char __iomem *ptr, int len) | |||
| 293 | * 0 : SUCCESS | 293 | * 0 : SUCCESS |
| 294 | * <0 : FAILURE | 294 | * <0 : FAILURE |
| 295 | */ | 295 | */ |
| 296 | static int __devinit bios32_present(const char __iomem *p) | 296 | static int bios32_present(const char __iomem *p) |
| 297 | { | 297 | { |
| 298 | struct bios32_service_dir *bios_32_ptr; | 298 | struct bios32_service_dir *bios_32_ptr; |
| 299 | int length; | 299 | int length; |
| @@ -323,7 +323,7 @@ static int __devinit bios32_present(const char __iomem *p) | |||
| 323 | return -ENODEV; | 323 | return -ENODEV; |
| 324 | } | 324 | } |
| 325 | 325 | ||
| 326 | static int __devinit detect_cru_service(void) | 326 | static int detect_cru_service(void) |
| 327 | { | 327 | { |
| 328 | char __iomem *p, *q; | 328 | char __iomem *p, *q; |
| 329 | int rc = -1; | 329 | int rc = -1; |
| @@ -395,7 +395,7 @@ asm(".text \n\t" | |||
| 395 | * This function checks whether or not a SMBIOS/DMI record is | 395 | * This function checks whether or not a SMBIOS/DMI record is |
| 396 | * the 64bit CRU info or not | 396 | * the 64bit CRU info or not |
| 397 | */ | 397 | */ |
| 398 | static void __devinit dmi_find_cru(const struct dmi_header *dm, void *dummy) | 398 | static void dmi_find_cru(const struct dmi_header *dm, void *dummy) |
| 399 | { | 399 | { |
| 400 | struct smbios_cru64_info *smbios_cru64_ptr; | 400 | struct smbios_cru64_info *smbios_cru64_ptr; |
| 401 | unsigned long cru_physical_address; | 401 | unsigned long cru_physical_address; |
| @@ -414,7 +414,7 @@ static void __devinit dmi_find_cru(const struct dmi_header *dm, void *dummy) | |||
| 414 | } | 414 | } |
| 415 | } | 415 | } |
| 416 | 416 | ||
| 417 | static int __devinit detect_cru_service(void) | 417 | static int detect_cru_service(void) |
| 418 | { | 418 | { |
| 419 | cru_rom_addr = NULL; | 419 | cru_rom_addr = NULL; |
| 420 | 420 | ||
| @@ -647,7 +647,7 @@ static struct miscdevice hpwdt_miscdev = { | |||
| 647 | 647 | ||
| 648 | #ifdef CONFIG_HPWDT_NMI_DECODING | 648 | #ifdef CONFIG_HPWDT_NMI_DECODING |
| 649 | #ifdef CONFIG_X86_LOCAL_APIC | 649 | #ifdef CONFIG_X86_LOCAL_APIC |
| 650 | static void __devinit hpwdt_check_nmi_decoding(struct pci_dev *dev) | 650 | static void hpwdt_check_nmi_decoding(struct pci_dev *dev) |
| 651 | { | 651 | { |
| 652 | /* | 652 | /* |
| 653 | * If nmi_watchdog is turned off then we can turn on | 653 | * If nmi_watchdog is turned off then we can turn on |
| @@ -656,7 +656,7 @@ static void __devinit hpwdt_check_nmi_decoding(struct pci_dev *dev) | |||
| 656 | hpwdt_nmi_decoding = 1; | 656 | hpwdt_nmi_decoding = 1; |
| 657 | } | 657 | } |
| 658 | #else | 658 | #else |
| 659 | static void __devinit hpwdt_check_nmi_decoding(struct pci_dev *dev) | 659 | static void hpwdt_check_nmi_decoding(struct pci_dev *dev) |
| 660 | { | 660 | { |
| 661 | dev_warn(&dev->dev, "NMI decoding is disabled. " | 661 | dev_warn(&dev->dev, "NMI decoding is disabled. " |
| 662 | "Your kernel does not support a NMI Watchdog.\n"); | 662 | "Your kernel does not support a NMI Watchdog.\n"); |
| @@ -671,7 +671,7 @@ static void __devinit hpwdt_check_nmi_decoding(struct pci_dev *dev) | |||
| 671 | * This check is independent of architecture and needs to be made for | 671 | * This check is independent of architecture and needs to be made for |
| 672 | * any ProLiant system. | 672 | * any ProLiant system. |
| 673 | */ | 673 | */ |
| 674 | static void __devinit dmi_find_icru(const struct dmi_header *dm, void *dummy) | 674 | static void dmi_find_icru(const struct dmi_header *dm, void *dummy) |
| 675 | { | 675 | { |
| 676 | struct smbios_proliant_info *smbios_proliant_ptr; | 676 | struct smbios_proliant_info *smbios_proliant_ptr; |
| 677 | 677 | ||
| @@ -682,7 +682,7 @@ static void __devinit dmi_find_icru(const struct dmi_header *dm, void *dummy) | |||
| 682 | } | 682 | } |
| 683 | } | 683 | } |
| 684 | 684 | ||
| 685 | static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev) | 685 | static int hpwdt_init_nmi_decoding(struct pci_dev *dev) |
| 686 | { | 686 | { |
| 687 | int retval; | 687 | int retval; |
| 688 | 688 | ||
| @@ -762,11 +762,11 @@ static void hpwdt_exit_nmi_decoding(void) | |||
| 762 | iounmap(cru_rom_addr); | 762 | iounmap(cru_rom_addr); |
| 763 | } | 763 | } |
| 764 | #else /* !CONFIG_HPWDT_NMI_DECODING */ | 764 | #else /* !CONFIG_HPWDT_NMI_DECODING */ |
| 765 | static void __devinit hpwdt_check_nmi_decoding(struct pci_dev *dev) | 765 | static void hpwdt_check_nmi_decoding(struct pci_dev *dev) |
| 766 | { | 766 | { |
| 767 | } | 767 | } |
| 768 | 768 | ||
| 769 | static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev) | 769 | static int hpwdt_init_nmi_decoding(struct pci_dev *dev) |
| 770 | { | 770 | { |
| 771 | return 0; | 771 | return 0; |
| 772 | } | 772 | } |
| @@ -776,7 +776,7 @@ static void hpwdt_exit_nmi_decoding(void) | |||
| 776 | } | 776 | } |
| 777 | #endif /* CONFIG_HPWDT_NMI_DECODING */ | 777 | #endif /* CONFIG_HPWDT_NMI_DECODING */ |
| 778 | 778 | ||
| 779 | static int __devinit hpwdt_init_one(struct pci_dev *dev, | 779 | static int hpwdt_init_one(struct pci_dev *dev, |
| 780 | const struct pci_device_id *ent) | 780 | const struct pci_device_id *ent) |
| 781 | { | 781 | { |
| 782 | int retval; | 782 | int retval; |
| @@ -848,7 +848,7 @@ error_pci_iomap: | |||
| 848 | return retval; | 848 | return retval; |
| 849 | } | 849 | } |
| 850 | 850 | ||
| 851 | static void __devexit hpwdt_exit(struct pci_dev *dev) | 851 | static void hpwdt_exit(struct pci_dev *dev) |
| 852 | { | 852 | { |
| 853 | if (!nowayout) | 853 | if (!nowayout) |
| 854 | hpwdt_stop(); | 854 | hpwdt_stop(); |
| @@ -863,7 +863,7 @@ static struct pci_driver hpwdt_driver = { | |||
| 863 | .name = "hpwdt", | 863 | .name = "hpwdt", |
| 864 | .id_table = hpwdt_devices, | 864 | .id_table = hpwdt_devices, |
| 865 | .probe = hpwdt_init_one, | 865 | .probe = hpwdt_init_one, |
| 866 | .remove = __devexit_p(hpwdt_exit), | 866 | .remove = hpwdt_exit, |
| 867 | }; | 867 | }; |
| 868 | 868 | ||
| 869 | MODULE_AUTHOR("Tom Mingarelli"); | 869 | MODULE_AUTHOR("Tom Mingarelli"); |
diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c index 276877d5b6a3..2b2ea13d03ea 100644 --- a/drivers/watchdog/i6300esb.c +++ b/drivers/watchdog/i6300esb.c | |||
| @@ -344,7 +344,7 @@ MODULE_DEVICE_TABLE(pci, esb_pci_tbl); | |||
| 344 | * Init & exit routines | 344 | * Init & exit routines |
| 345 | */ | 345 | */ |
| 346 | 346 | ||
| 347 | static unsigned char __devinit esb_getdevice(struct pci_dev *pdev) | 347 | static unsigned char esb_getdevice(struct pci_dev *pdev) |
| 348 | { | 348 | { |
| 349 | if (pci_enable_device(pdev)) { | 349 | if (pci_enable_device(pdev)) { |
| 350 | pr_err("failed to enable device\n"); | 350 | pr_err("failed to enable device\n"); |
| @@ -375,7 +375,7 @@ err_devput: | |||
| 375 | return 0; | 375 | return 0; |
| 376 | } | 376 | } |
| 377 | 377 | ||
| 378 | static void __devinit esb_initdevice(void) | 378 | static void esb_initdevice(void) |
| 379 | { | 379 | { |
| 380 | u8 val1; | 380 | u8 val1; |
| 381 | u16 val2; | 381 | u16 val2; |
| @@ -416,7 +416,7 @@ static void __devinit esb_initdevice(void) | |||
| 416 | esb_timer_set_heartbeat(heartbeat); | 416 | esb_timer_set_heartbeat(heartbeat); |
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | static int __devinit esb_probe(struct pci_dev *pdev, | 419 | static int esb_probe(struct pci_dev *pdev, |
| 420 | const struct pci_device_id *ent) | 420 | const struct pci_device_id *ent) |
| 421 | { | 421 | { |
| 422 | int ret; | 422 | int ret; |
| @@ -465,7 +465,7 @@ err_unmap: | |||
| 465 | return ret; | 465 | return ret; |
| 466 | } | 466 | } |
| 467 | 467 | ||
| 468 | static void __devexit esb_remove(struct pci_dev *pdev) | 468 | static void esb_remove(struct pci_dev *pdev) |
| 469 | { | 469 | { |
| 470 | /* Stop the timer before we leave */ | 470 | /* Stop the timer before we leave */ |
| 471 | if (!nowayout) | 471 | if (!nowayout) |
| @@ -488,7 +488,7 @@ static struct pci_driver esb_driver = { | |||
| 488 | .name = ESB_MODULE_NAME, | 488 | .name = ESB_MODULE_NAME, |
| 489 | .id_table = esb_pci_tbl, | 489 | .id_table = esb_pci_tbl, |
| 490 | .probe = esb_probe, | 490 | .probe = esb_probe, |
| 491 | .remove = __devexit_p(esb_remove), | 491 | .remove = esb_remove, |
| 492 | .shutdown = esb_shutdown, | 492 | .shutdown = esb_shutdown, |
| 493 | }; | 493 | }; |
| 494 | 494 | ||
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index 545d387de411..6130321da387 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c | |||
| @@ -364,7 +364,7 @@ static struct watchdog_device iTCO_wdt_watchdog_dev = { | |||
| 364 | * Init & exit routines | 364 | * Init & exit routines |
| 365 | */ | 365 | */ |
| 366 | 366 | ||
| 367 | static void __devexit iTCO_wdt_cleanup(void) | 367 | static void iTCO_wdt_cleanup(void) |
| 368 | { | 368 | { |
| 369 | /* Stop the timer before we leave */ | 369 | /* Stop the timer before we leave */ |
| 370 | if (!nowayout) | 370 | if (!nowayout) |
| @@ -390,7 +390,7 @@ static void __devexit iTCO_wdt_cleanup(void) | |||
| 390 | iTCO_wdt_private.gcs = NULL; | 390 | iTCO_wdt_private.gcs = NULL; |
| 391 | } | 391 | } |
| 392 | 392 | ||
| 393 | static int __devinit iTCO_wdt_probe(struct platform_device *dev) | 393 | static int iTCO_wdt_probe(struct platform_device *dev) |
| 394 | { | 394 | { |
| 395 | int ret = -ENODEV; | 395 | int ret = -ENODEV; |
| 396 | unsigned long val32; | 396 | unsigned long val32; |
| @@ -533,7 +533,7 @@ out: | |||
| 533 | return ret; | 533 | return ret; |
| 534 | } | 534 | } |
| 535 | 535 | ||
| 536 | static int __devexit iTCO_wdt_remove(struct platform_device *dev) | 536 | static int iTCO_wdt_remove(struct platform_device *dev) |
| 537 | { | 537 | { |
| 538 | if (iTCO_wdt_private.tco_res || iTCO_wdt_private.smi_res) | 538 | if (iTCO_wdt_private.tco_res || iTCO_wdt_private.smi_res) |
| 539 | iTCO_wdt_cleanup(); | 539 | iTCO_wdt_cleanup(); |
| @@ -548,7 +548,7 @@ static void iTCO_wdt_shutdown(struct platform_device *dev) | |||
| 548 | 548 | ||
| 549 | static struct platform_driver iTCO_wdt_driver = { | 549 | static struct platform_driver iTCO_wdt_driver = { |
| 550 | .probe = iTCO_wdt_probe, | 550 | .probe = iTCO_wdt_probe, |
| 551 | .remove = __devexit_p(iTCO_wdt_remove), | 551 | .remove = iTCO_wdt_remove, |
| 552 | .shutdown = iTCO_wdt_shutdown, | 552 | .shutdown = iTCO_wdt_shutdown, |
| 553 | .driver = { | 553 | .driver = { |
| 554 | .owner = THIS_MODULE, | 554 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c index 184c0bfc87a4..eb6b5cc98ec6 100644 --- a/drivers/watchdog/ib700wdt.c +++ b/drivers/watchdog/ib700wdt.c | |||
| @@ -277,7 +277,7 @@ static struct miscdevice ibwdt_miscdev = { | |||
| 277 | * Init & exit routines | 277 | * Init & exit routines |
| 278 | */ | 278 | */ |
| 279 | 279 | ||
| 280 | static int __devinit ibwdt_probe(struct platform_device *dev) | 280 | static int ibwdt_probe(struct platform_device *dev) |
| 281 | { | 281 | { |
| 282 | int res; | 282 | int res; |
| 283 | 283 | ||
| @@ -319,7 +319,7 @@ out_nostopreg: | |||
| 319 | return res; | 319 | return res; |
| 320 | } | 320 | } |
| 321 | 321 | ||
| 322 | static int __devexit ibwdt_remove(struct platform_device *dev) | 322 | static int ibwdt_remove(struct platform_device *dev) |
| 323 | { | 323 | { |
| 324 | misc_deregister(&ibwdt_miscdev); | 324 | misc_deregister(&ibwdt_miscdev); |
| 325 | release_region(WDT_START, 1); | 325 | release_region(WDT_START, 1); |
| @@ -337,7 +337,7 @@ static void ibwdt_shutdown(struct platform_device *dev) | |||
| 337 | 337 | ||
| 338 | static struct platform_driver ibwdt_driver = { | 338 | static struct platform_driver ibwdt_driver = { |
| 339 | .probe = ibwdt_probe, | 339 | .probe = ibwdt_probe, |
| 340 | .remove = __devexit_p(ibwdt_remove), | 340 | .remove = ibwdt_remove, |
| 341 | .shutdown = ibwdt_shutdown, | 341 | .shutdown = ibwdt_shutdown, |
| 342 | .driver = { | 342 | .driver = { |
| 343 | .owner = THIS_MODULE, | 343 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/ie6xx_wdt.c b/drivers/watchdog/ie6xx_wdt.c index 8f541b940053..e24ef6a6e064 100644 --- a/drivers/watchdog/ie6xx_wdt.c +++ b/drivers/watchdog/ie6xx_wdt.c | |||
| @@ -225,7 +225,7 @@ static const struct file_operations ie6xx_wdt_dbg_operations = { | |||
| 225 | .release = single_release, | 225 | .release = single_release, |
| 226 | }; | 226 | }; |
| 227 | 227 | ||
| 228 | static void __devinit ie6xx_wdt_debugfs_init(void) | 228 | static void ie6xx_wdt_debugfs_init(void) |
| 229 | { | 229 | { |
| 230 | /* /sys/kernel/debug/ie6xx_wdt */ | 230 | /* /sys/kernel/debug/ie6xx_wdt */ |
| 231 | ie6xx_wdt_data.debugfs = debugfs_create_file("ie6xx_wdt", | 231 | ie6xx_wdt_data.debugfs = debugfs_create_file("ie6xx_wdt", |
| @@ -238,7 +238,7 @@ static void ie6xx_wdt_debugfs_exit(void) | |||
| 238 | } | 238 | } |
| 239 | 239 | ||
| 240 | #else | 240 | #else |
| 241 | static void __devinit ie6xx_wdt_debugfs_init(void) | 241 | static void ie6xx_wdt_debugfs_init(void) |
| 242 | { | 242 | { |
| 243 | } | 243 | } |
| 244 | 244 | ||
| @@ -247,7 +247,7 @@ static void ie6xx_wdt_debugfs_exit(void) | |||
| 247 | } | 247 | } |
| 248 | #endif | 248 | #endif |
| 249 | 249 | ||
| 250 | static int __devinit ie6xx_wdt_probe(struct platform_device *pdev) | 250 | static int ie6xx_wdt_probe(struct platform_device *pdev) |
| 251 | { | 251 | { |
| 252 | struct resource *res; | 252 | struct resource *res; |
| 253 | u8 wdtlr; | 253 | u8 wdtlr; |
| @@ -295,7 +295,7 @@ misc_register_error: | |||
| 295 | return ret; | 295 | return ret; |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | static int __devexit ie6xx_wdt_remove(struct platform_device *pdev) | 298 | static int ie6xx_wdt_remove(struct platform_device *pdev) |
| 299 | { | 299 | { |
| 300 | struct resource *res; | 300 | struct resource *res; |
| 301 | 301 | ||
| @@ -311,7 +311,7 @@ static int __devexit ie6xx_wdt_remove(struct platform_device *pdev) | |||
| 311 | 311 | ||
| 312 | static struct platform_driver ie6xx_wdt_driver = { | 312 | static struct platform_driver ie6xx_wdt_driver = { |
| 313 | .probe = ie6xx_wdt_probe, | 313 | .probe = ie6xx_wdt_probe, |
| 314 | .remove = __devexit_p(ie6xx_wdt_remove), | 314 | .remove = ie6xx_wdt_remove, |
| 315 | .driver = { | 315 | .driver = { |
| 316 | .name = DRIVER_NAME, | 316 | .name = DRIVER_NAME, |
| 317 | .owner = THIS_MODULE, | 317 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index bcfab2b00ad2..9a45d0294cf4 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/uaccess.h> | 33 | #include <linux/uaccess.h> |
| 34 | #include <linux/timer.h> | 34 | #include <linux/timer.h> |
| 35 | #include <linux/jiffies.h> | 35 | #include <linux/jiffies.h> |
| 36 | #include <mach/hardware.h> | ||
| 37 | 36 | ||
| 38 | #define DRIVER_NAME "imx2-wdt" | 37 | #define DRIVER_NAME "imx2-wdt" |
| 39 | 38 | ||
diff --git a/drivers/watchdog/jz4740_wdt.c b/drivers/watchdog/jz4740_wdt.c index 978615ef899d..a61408fa0c94 100644 --- a/drivers/watchdog/jz4740_wdt.c +++ b/drivers/watchdog/jz4740_wdt.c | |||
| @@ -144,7 +144,7 @@ static const struct watchdog_ops jz4740_wdt_ops = { | |||
| 144 | .set_timeout = jz4740_wdt_set_timeout, | 144 | .set_timeout = jz4740_wdt_set_timeout, |
| 145 | }; | 145 | }; |
| 146 | 146 | ||
| 147 | static int __devinit jz4740_wdt_probe(struct platform_device *pdev) | 147 | static int jz4740_wdt_probe(struct platform_device *pdev) |
| 148 | { | 148 | { |
| 149 | struct jz4740_wdt_drvdata *drvdata; | 149 | struct jz4740_wdt_drvdata *drvdata; |
| 150 | struct watchdog_device *jz4740_wdt; | 150 | struct watchdog_device *jz4740_wdt; |
| @@ -197,7 +197,7 @@ err_out: | |||
| 197 | return ret; | 197 | return ret; |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | static int __devexit jz4740_wdt_remove(struct platform_device *pdev) | 200 | static int jz4740_wdt_remove(struct platform_device *pdev) |
| 201 | { | 201 | { |
| 202 | struct jz4740_wdt_drvdata *drvdata = platform_get_drvdata(pdev); | 202 | struct jz4740_wdt_drvdata *drvdata = platform_get_drvdata(pdev); |
| 203 | 203 | ||
| @@ -210,7 +210,7 @@ static int __devexit jz4740_wdt_remove(struct platform_device *pdev) | |||
| 210 | 210 | ||
| 211 | static struct platform_driver jz4740_wdt_driver = { | 211 | static struct platform_driver jz4740_wdt_driver = { |
| 212 | .probe = jz4740_wdt_probe, | 212 | .probe = jz4740_wdt_probe, |
| 213 | .remove = __devexit_p(jz4740_wdt_remove), | 213 | .remove = jz4740_wdt_remove, |
| 214 | .driver = { | 214 | .driver = { |
| 215 | .name = "jz4740-wdt", | 215 | .name = "jz4740-wdt", |
| 216 | .owner = THIS_MODULE, | 216 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c index c1a4d3bf581d..dce9ecffd44a 100644 --- a/drivers/watchdog/ks8695_wdt.c +++ b/drivers/watchdog/ks8695_wdt.c | |||
| @@ -235,7 +235,7 @@ static struct miscdevice ks8695wdt_miscdev = { | |||
| 235 | .fops = &ks8695wdt_fops, | 235 | .fops = &ks8695wdt_fops, |
| 236 | }; | 236 | }; |
| 237 | 237 | ||
| 238 | static int __devinit ks8695wdt_probe(struct platform_device *pdev) | 238 | static int ks8695wdt_probe(struct platform_device *pdev) |
| 239 | { | 239 | { |
| 240 | int res; | 240 | int res; |
| 241 | 241 | ||
| @@ -252,7 +252,7 @@ static int __devinit ks8695wdt_probe(struct platform_device *pdev) | |||
| 252 | return 0; | 252 | return 0; |
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | static int __devexit ks8695wdt_remove(struct platform_device *pdev) | 255 | static int ks8695wdt_remove(struct platform_device *pdev) |
| 256 | { | 256 | { |
| 257 | int res; | 257 | int res; |
| 258 | 258 | ||
| @@ -290,7 +290,7 @@ static int ks8695wdt_resume(struct platform_device *pdev) | |||
| 290 | 290 | ||
| 291 | static struct platform_driver ks8695wdt_driver = { | 291 | static struct platform_driver ks8695wdt_driver = { |
| 292 | .probe = ks8695wdt_probe, | 292 | .probe = ks8695wdt_probe, |
| 293 | .remove = __devexit_p(ks8695wdt_remove), | 293 | .remove = ks8695wdt_remove, |
| 294 | .shutdown = ks8695wdt_shutdown, | 294 | .shutdown = ks8695wdt_shutdown, |
| 295 | .suspend = ks8695wdt_suspend, | 295 | .suspend = ks8695wdt_suspend, |
| 296 | .resume = ks8695wdt_resume, | 296 | .resume = ks8695wdt_resume, |
diff --git a/drivers/watchdog/lantiq_wdt.c b/drivers/watchdog/lantiq_wdt.c index 2e74c3a8ee58..79fe01b42339 100644 --- a/drivers/watchdog/lantiq_wdt.c +++ b/drivers/watchdog/lantiq_wdt.c | |||
| @@ -186,7 +186,7 @@ static struct miscdevice ltq_wdt_miscdev = { | |||
| 186 | .fops = <q_wdt_fops, | 186 | .fops = <q_wdt_fops, |
| 187 | }; | 187 | }; |
| 188 | 188 | ||
| 189 | static int __devinit | 189 | static int |
| 190 | ltq_wdt_probe(struct platform_device *pdev) | 190 | ltq_wdt_probe(struct platform_device *pdev) |
| 191 | { | 191 | { |
| 192 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 192 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| @@ -220,7 +220,7 @@ ltq_wdt_probe(struct platform_device *pdev) | |||
| 220 | return misc_register(<q_wdt_miscdev); | 220 | return misc_register(<q_wdt_miscdev); |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | static int __devexit | 223 | static int |
| 224 | ltq_wdt_remove(struct platform_device *pdev) | 224 | ltq_wdt_remove(struct platform_device *pdev) |
| 225 | { | 225 | { |
| 226 | misc_deregister(<q_wdt_miscdev); | 226 | misc_deregister(<q_wdt_miscdev); |
| @@ -236,7 +236,7 @@ MODULE_DEVICE_TABLE(of, ltq_wdt_match); | |||
| 236 | 236 | ||
| 237 | static struct platform_driver ltq_wdt_driver = { | 237 | static struct platform_driver ltq_wdt_driver = { |
| 238 | .probe = ltq_wdt_probe, | 238 | .probe = ltq_wdt_probe, |
| 239 | .remove = __devexit_p(ltq_wdt_remove), | 239 | .remove = ltq_wdt_remove, |
| 240 | .driver = { | 240 | .driver = { |
| 241 | .name = "wdt", | 241 | .name = "wdt", |
| 242 | .owner = THIS_MODULE, | 242 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/max63xx_wdt.c b/drivers/watchdog/max63xx_wdt.c index 8f4a74e91619..773c661723ca 100644 --- a/drivers/watchdog/max63xx_wdt.c +++ b/drivers/watchdog/max63xx_wdt.c | |||
| @@ -174,7 +174,7 @@ static struct watchdog_device max63xx_wdt_dev = { | |||
| 174 | .ops = &max63xx_wdt_ops, | 174 | .ops = &max63xx_wdt_ops, |
| 175 | }; | 175 | }; |
| 176 | 176 | ||
| 177 | static int __devinit max63xx_wdt_probe(struct platform_device *pdev) | 177 | static int max63xx_wdt_probe(struct platform_device *pdev) |
| 178 | { | 178 | { |
| 179 | struct resource *wdt_mem; | 179 | struct resource *wdt_mem; |
| 180 | struct max63xx_timeout *table; | 180 | struct max63xx_timeout *table; |
| @@ -209,7 +209,7 @@ static int __devinit max63xx_wdt_probe(struct platform_device *pdev) | |||
| 209 | return watchdog_register_device(&max63xx_wdt_dev); | 209 | return watchdog_register_device(&max63xx_wdt_dev); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | static int __devexit max63xx_wdt_remove(struct platform_device *pdev) | 212 | static int max63xx_wdt_remove(struct platform_device *pdev) |
| 213 | { | 213 | { |
| 214 | watchdog_unregister_device(&max63xx_wdt_dev); | 214 | watchdog_unregister_device(&max63xx_wdt_dev); |
| 215 | return 0; | 215 | return 0; |
| @@ -228,7 +228,7 @@ MODULE_DEVICE_TABLE(platform, max63xx_id_table); | |||
| 228 | 228 | ||
| 229 | static struct platform_driver max63xx_wdt_driver = { | 229 | static struct platform_driver max63xx_wdt_driver = { |
| 230 | .probe = max63xx_wdt_probe, | 230 | .probe = max63xx_wdt_probe, |
| 231 | .remove = __devexit_p(max63xx_wdt_remove), | 231 | .remove = max63xx_wdt_remove, |
| 232 | .id_table = max63xx_id_table, | 232 | .id_table = max63xx_id_table, |
| 233 | .driver = { | 233 | .driver = { |
| 234 | .name = "max63xx_wdt", | 234 | .name = "max63xx_wdt", |
diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c index 37e4b52dbce9..97d62ee50341 100644 --- a/drivers/watchdog/mixcomwd.c +++ b/drivers/watchdog/mixcomwd.c | |||
| @@ -73,7 +73,7 @@ | |||
| 73 | static struct { | 73 | static struct { |
| 74 | int ioport; | 74 | int ioport; |
| 75 | int id; | 75 | int id; |
| 76 | } mixcomwd_io_info[] __devinitdata = { | 76 | } mixcomwd_io_info[] = { |
| 77 | /* The Mixcom cards */ | 77 | /* The Mixcom cards */ |
| 78 | {0x0d90, MIXCOM_ID}, | 78 | {0x0d90, MIXCOM_ID}, |
| 79 | {0x0e90, MIXCOM_ID}, | 79 | {0x0e90, MIXCOM_ID}, |
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c index e6a038ae8dc2..da2752063bb7 100644 --- a/drivers/watchdog/mpc8xxx_wdt.c +++ b/drivers/watchdog/mpc8xxx_wdt.c | |||
| @@ -188,7 +188,7 @@ static struct miscdevice mpc8xxx_wdt_miscdev = { | |||
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | static const struct of_device_id mpc8xxx_wdt_match[]; | 190 | static const struct of_device_id mpc8xxx_wdt_match[]; |
| 191 | static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev) | 191 | static int mpc8xxx_wdt_probe(struct platform_device *ofdev) |
| 192 | { | 192 | { |
| 193 | int ret; | 193 | int ret; |
| 194 | const struct of_device_id *match; | 194 | const struct of_device_id *match; |
| @@ -245,7 +245,7 @@ err_unmap: | |||
| 245 | return ret; | 245 | return ret; |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | static int __devexit mpc8xxx_wdt_remove(struct platform_device *ofdev) | 248 | static int mpc8xxx_wdt_remove(struct platform_device *ofdev) |
| 249 | { | 249 | { |
| 250 | mpc8xxx_wdt_pr_warn("watchdog removed"); | 250 | mpc8xxx_wdt_pr_warn("watchdog removed"); |
| 251 | del_timer_sync(&wdt_timer); | 251 | del_timer_sync(&wdt_timer); |
| @@ -281,7 +281,7 @@ MODULE_DEVICE_TABLE(of, mpc8xxx_wdt_match); | |||
| 281 | 281 | ||
| 282 | static struct platform_driver mpc8xxx_wdt_driver = { | 282 | static struct platform_driver mpc8xxx_wdt_driver = { |
| 283 | .probe = mpc8xxx_wdt_probe, | 283 | .probe = mpc8xxx_wdt_probe, |
| 284 | .remove = __devexit_p(mpc8xxx_wdt_remove), | 284 | .remove = mpc8xxx_wdt_remove, |
| 285 | .driver = { | 285 | .driver = { |
| 286 | .name = "mpc8xxx_wdt", | 286 | .name = "mpc8xxx_wdt", |
| 287 | .owner = THIS_MODULE, | 287 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c index 7c741dc987bd..233cfadcb21f 100644 --- a/drivers/watchdog/mpcore_wdt.c +++ b/drivers/watchdog/mpcore_wdt.c | |||
| @@ -80,8 +80,7 @@ static irqreturn_t mpcore_wdt_fire(int irq, void *arg) | |||
| 80 | 80 | ||
| 81 | /* Check it really was our interrupt */ | 81 | /* Check it really was our interrupt */ |
| 82 | if (readl(wdt->base + TWD_WDOG_INTSTAT)) { | 82 | if (readl(wdt->base + TWD_WDOG_INTSTAT)) { |
| 83 | dev_printk(KERN_CRIT, wdt->dev, | 83 | dev_crit(wdt->dev, "Triggered - Reboot ignored\n"); |
| 84 | "Triggered - Reboot ignored.\n"); | ||
| 85 | /* Clear the interrupt on the watchdog */ | 84 | /* Clear the interrupt on the watchdog */ |
| 86 | writel(1, wdt->base + TWD_WDOG_INTSTAT); | 85 | writel(1, wdt->base + TWD_WDOG_INTSTAT); |
| 87 | return IRQ_HANDLED; | 86 | return IRQ_HANDLED; |
| @@ -123,7 +122,7 @@ static void mpcore_wdt_stop(struct mpcore_wdt *wdt) | |||
| 123 | 122 | ||
| 124 | static void mpcore_wdt_start(struct mpcore_wdt *wdt) | 123 | static void mpcore_wdt_start(struct mpcore_wdt *wdt) |
| 125 | { | 124 | { |
| 126 | dev_printk(KERN_INFO, wdt->dev, "enabling watchdog.\n"); | 125 | dev_info(wdt->dev, "enabling watchdog\n"); |
| 127 | 126 | ||
| 128 | /* This loads the count register but does NOT start the count yet */ | 127 | /* This loads the count register but does NOT start the count yet */ |
| 129 | mpcore_wdt_keepalive(wdt); | 128 | mpcore_wdt_keepalive(wdt); |
| @@ -180,8 +179,8 @@ static int mpcore_wdt_release(struct inode *inode, struct file *file) | |||
| 180 | if (wdt->expect_close == 42) | 179 | if (wdt->expect_close == 42) |
| 181 | mpcore_wdt_stop(wdt); | 180 | mpcore_wdt_stop(wdt); |
| 182 | else { | 181 | else { |
| 183 | dev_printk(KERN_CRIT, wdt->dev, | 182 | dev_crit(wdt->dev, |
| 184 | "unexpected close, not stopping watchdog!\n"); | 183 | "unexpected close, not stopping watchdog!\n"); |
| 185 | mpcore_wdt_keepalive(wdt); | 184 | mpcore_wdt_keepalive(wdt); |
| 186 | } | 185 | } |
| 187 | clear_bit(0, &wdt->timer_alive); | 186 | clear_bit(0, &wdt->timer_alive); |
| @@ -327,7 +326,7 @@ static struct miscdevice mpcore_wdt_miscdev = { | |||
| 327 | .fops = &mpcore_wdt_fops, | 326 | .fops = &mpcore_wdt_fops, |
| 328 | }; | 327 | }; |
| 329 | 328 | ||
| 330 | static int __devinit mpcore_wdt_probe(struct platform_device *pdev) | 329 | static int mpcore_wdt_probe(struct platform_device *pdev) |
| 331 | { | 330 | { |
| 332 | struct mpcore_wdt *wdt; | 331 | struct mpcore_wdt *wdt; |
| 333 | struct resource *res; | 332 | struct resource *res; |
| @@ -351,9 +350,9 @@ static int __devinit mpcore_wdt_probe(struct platform_device *pdev) | |||
| 351 | ret = devm_request_irq(wdt->dev, wdt->irq, mpcore_wdt_fire, 0, | 350 | ret = devm_request_irq(wdt->dev, wdt->irq, mpcore_wdt_fire, 0, |
| 352 | "mpcore_wdt", wdt); | 351 | "mpcore_wdt", wdt); |
| 353 | if (ret) { | 352 | if (ret) { |
| 354 | dev_printk(KERN_ERR, wdt->dev, | 353 | dev_err(wdt->dev, |
| 355 | "cannot register IRQ%d for watchdog\n", | 354 | "cannot register IRQ%d for watchdog\n", |
| 356 | wdt->irq); | 355 | wdt->irq); |
| 357 | return ret; | 356 | return ret; |
| 358 | } | 357 | } |
| 359 | } | 358 | } |
| @@ -365,9 +364,9 @@ static int __devinit mpcore_wdt_probe(struct platform_device *pdev) | |||
| 365 | mpcore_wdt_miscdev.parent = &pdev->dev; | 364 | mpcore_wdt_miscdev.parent = &pdev->dev; |
| 366 | ret = misc_register(&mpcore_wdt_miscdev); | 365 | ret = misc_register(&mpcore_wdt_miscdev); |
| 367 | if (ret) { | 366 | if (ret) { |
| 368 | dev_printk(KERN_ERR, wdt->dev, | 367 | dev_err(wdt->dev, |
| 369 | "cannot register miscdev on minor=%d (err=%d)\n", | 368 | "cannot register miscdev on minor=%d (err=%d)\n", |
| 370 | WATCHDOG_MINOR, ret); | 369 | WATCHDOG_MINOR, ret); |
| 371 | return ret; | 370 | return ret; |
| 372 | } | 371 | } |
| 373 | 372 | ||
| @@ -378,7 +377,7 @@ static int __devinit mpcore_wdt_probe(struct platform_device *pdev) | |||
| 378 | return 0; | 377 | return 0; |
| 379 | } | 378 | } |
| 380 | 379 | ||
| 381 | static int __devexit mpcore_wdt_remove(struct platform_device *pdev) | 380 | static int mpcore_wdt_remove(struct platform_device *pdev) |
| 382 | { | 381 | { |
| 383 | platform_set_drvdata(pdev, NULL); | 382 | platform_set_drvdata(pdev, NULL); |
| 384 | 383 | ||
| @@ -415,7 +414,7 @@ MODULE_ALIAS("platform:mpcore_wdt"); | |||
| 415 | 414 | ||
| 416 | static struct platform_driver mpcore_wdt_driver = { | 415 | static struct platform_driver mpcore_wdt_driver = { |
| 417 | .probe = mpcore_wdt_probe, | 416 | .probe = mpcore_wdt_probe, |
| 418 | .remove = __devexit_p(mpcore_wdt_remove), | 417 | .remove = mpcore_wdt_remove, |
| 419 | .suspend = mpcore_wdt_suspend, | 418 | .suspend = mpcore_wdt_suspend, |
| 420 | .resume = mpcore_wdt_resume, | 419 | .resume = mpcore_wdt_resume, |
| 421 | .shutdown = mpcore_wdt_shutdown, | 420 | .shutdown = mpcore_wdt_shutdown, |
diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c index c29e31d99fe8..14dab6ff87aa 100644 --- a/drivers/watchdog/mtx-1_wdt.c +++ b/drivers/watchdog/mtx-1_wdt.c | |||
| @@ -204,7 +204,7 @@ static struct miscdevice mtx1_wdt_misc = { | |||
| 204 | }; | 204 | }; |
| 205 | 205 | ||
| 206 | 206 | ||
| 207 | static int __devinit mtx1_wdt_probe(struct platform_device *pdev) | 207 | static int mtx1_wdt_probe(struct platform_device *pdev) |
| 208 | { | 208 | { |
| 209 | int ret; | 209 | int ret; |
| 210 | 210 | ||
| @@ -233,7 +233,7 @@ static int __devinit mtx1_wdt_probe(struct platform_device *pdev) | |||
| 233 | return 0; | 233 | return 0; |
| 234 | } | 234 | } |
| 235 | 235 | ||
| 236 | static int __devexit mtx1_wdt_remove(struct platform_device *pdev) | 236 | static int mtx1_wdt_remove(struct platform_device *pdev) |
| 237 | { | 237 | { |
| 238 | /* FIXME: do we need to lock this test ? */ | 238 | /* FIXME: do we need to lock this test ? */ |
| 239 | if (mtx1_wdt_device.queue) { | 239 | if (mtx1_wdt_device.queue) { |
| @@ -248,7 +248,7 @@ static int __devexit mtx1_wdt_remove(struct platform_device *pdev) | |||
| 248 | 248 | ||
| 249 | static struct platform_driver mtx1_wdt_driver = { | 249 | static struct platform_driver mtx1_wdt_driver = { |
| 250 | .probe = mtx1_wdt_probe, | 250 | .probe = mtx1_wdt_probe, |
| 251 | .remove = __devexit_p(mtx1_wdt_remove), | 251 | .remove = mtx1_wdt_remove, |
| 252 | .driver.name = "mtx1-wdt", | 252 | .driver.name = "mtx1-wdt", |
| 253 | .driver.owner = THIS_MODULE, | 253 | .driver.owner = THIS_MODULE, |
| 254 | }; | 254 | }; |
diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c index c53d025e70df..c7fb878ca493 100644 --- a/drivers/watchdog/mv64x60_wdt.c +++ b/drivers/watchdog/mv64x60_wdt.c | |||
| @@ -253,7 +253,7 @@ static struct miscdevice mv64x60_wdt_miscdev = { | |||
| 253 | .fops = &mv64x60_wdt_fops, | 253 | .fops = &mv64x60_wdt_fops, |
| 254 | }; | 254 | }; |
| 255 | 255 | ||
| 256 | static int __devinit 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->dev.platform_data; |
| 259 | struct resource *r; | 259 | struct resource *r; |
| @@ -287,7 +287,7 @@ static int __devinit mv64x60_wdt_probe(struct platform_device *dev) | |||
| 287 | return misc_register(&mv64x60_wdt_miscdev); | 287 | return misc_register(&mv64x60_wdt_miscdev); |
| 288 | } | 288 | } |
| 289 | 289 | ||
| 290 | static int __devexit mv64x60_wdt_remove(struct platform_device *dev) | 290 | static int mv64x60_wdt_remove(struct platform_device *dev) |
| 291 | { | 291 | { |
| 292 | misc_deregister(&mv64x60_wdt_miscdev); | 292 | misc_deregister(&mv64x60_wdt_miscdev); |
| 293 | 293 | ||
| @@ -300,7 +300,7 @@ static int __devexit mv64x60_wdt_remove(struct platform_device *dev) | |||
| 300 | 300 | ||
| 301 | static struct platform_driver mv64x60_wdt_driver = { | 301 | static struct platform_driver mv64x60_wdt_driver = { |
| 302 | .probe = mv64x60_wdt_probe, | 302 | .probe = mv64x60_wdt_probe, |
| 303 | .remove = __devexit_p(mv64x60_wdt_remove), | 303 | .remove = mv64x60_wdt_remove, |
| 304 | .driver = { | 304 | .driver = { |
| 305 | .owner = THIS_MODULE, | 305 | .owner = THIS_MODULE, |
| 306 | .name = MV64x60_WDT_NAME, | 306 | .name = MV64x60_WDT_NAME, |
diff --git a/drivers/watchdog/nuc900_wdt.c b/drivers/watchdog/nuc900_wdt.c index ea4c7448b754..04c45a102992 100644 --- a/drivers/watchdog/nuc900_wdt.c +++ b/drivers/watchdog/nuc900_wdt.c | |||
| @@ -242,7 +242,7 @@ static struct miscdevice nuc900wdt_miscdev = { | |||
| 242 | .fops = &nuc900wdt_fops, | 242 | .fops = &nuc900wdt_fops, |
| 243 | }; | 243 | }; |
| 244 | 244 | ||
| 245 | static int __devinit nuc900wdt_probe(struct platform_device *pdev) | 245 | static int nuc900wdt_probe(struct platform_device *pdev) |
| 246 | { | 246 | { |
| 247 | int ret = 0; | 247 | int ret = 0; |
| 248 | 248 | ||
| @@ -309,7 +309,7 @@ err_get: | |||
| 309 | return ret; | 309 | return ret; |
| 310 | } | 310 | } |
| 311 | 311 | ||
| 312 | static int __devexit nuc900wdt_remove(struct platform_device *pdev) | 312 | static int nuc900wdt_remove(struct platform_device *pdev) |
| 313 | { | 313 | { |
| 314 | misc_deregister(&nuc900wdt_miscdev); | 314 | misc_deregister(&nuc900wdt_miscdev); |
| 315 | 315 | ||
| @@ -328,7 +328,7 @@ static int __devexit nuc900wdt_remove(struct platform_device *pdev) | |||
| 328 | 328 | ||
| 329 | static struct platform_driver nuc900wdt_driver = { | 329 | static struct platform_driver nuc900wdt_driver = { |
| 330 | .probe = nuc900wdt_probe, | 330 | .probe = nuc900wdt_probe, |
| 331 | .remove = __devexit_p(nuc900wdt_remove), | 331 | .remove = nuc900wdt_remove, |
| 332 | .driver = { | 332 | .driver = { |
| 333 | .name = "nuc900-wdt", | 333 | .name = "nuc900-wdt", |
| 334 | .owner = THIS_MODULE, | 334 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/nv_tco.c b/drivers/watchdog/nv_tco.c index 6bbb9efc6125..59cf19eeea07 100644 --- a/drivers/watchdog/nv_tco.c +++ b/drivers/watchdog/nv_tco.c | |||
| @@ -302,7 +302,7 @@ MODULE_DEVICE_TABLE(pci, tco_pci_tbl); | |||
| 302 | * Init & exit routines | 302 | * Init & exit routines |
| 303 | */ | 303 | */ |
| 304 | 304 | ||
| 305 | static unsigned char __devinit nv_tco_getdevice(void) | 305 | static unsigned char nv_tco_getdevice(void) |
| 306 | { | 306 | { |
| 307 | struct pci_dev *dev = NULL; | 307 | struct pci_dev *dev = NULL; |
| 308 | u32 val; | 308 | u32 val; |
| @@ -376,7 +376,7 @@ out: | |||
| 376 | return 0; | 376 | return 0; |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | static int __devinit nv_tco_init(struct platform_device *dev) | 379 | static int nv_tco_init(struct platform_device *dev) |
| 380 | { | 380 | { |
| 381 | int ret; | 381 | int ret; |
| 382 | 382 | ||
| @@ -423,7 +423,7 @@ unreg_region: | |||
| 423 | return ret; | 423 | return ret; |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | static void __devexit nv_tco_cleanup(void) | 426 | static void nv_tco_cleanup(void) |
| 427 | { | 427 | { |
| 428 | u32 val; | 428 | u32 val; |
| 429 | 429 | ||
| @@ -445,7 +445,7 @@ static void __devexit nv_tco_cleanup(void) | |||
| 445 | release_region(tcobase, 0x10); | 445 | release_region(tcobase, 0x10); |
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | static int __devexit nv_tco_remove(struct platform_device *dev) | 448 | static int nv_tco_remove(struct platform_device *dev) |
| 449 | { | 449 | { |
| 450 | if (tcobase) | 450 | if (tcobase) |
| 451 | nv_tco_cleanup(); | 451 | nv_tco_cleanup(); |
| @@ -468,7 +468,7 @@ static void nv_tco_shutdown(struct platform_device *dev) | |||
| 468 | 468 | ||
| 469 | static struct platform_driver nv_tco_driver = { | 469 | static struct platform_driver nv_tco_driver = { |
| 470 | .probe = nv_tco_init, | 470 | .probe = nv_tco_init, |
| 471 | .remove = __devexit_p(nv_tco_remove), | 471 | .remove = nv_tco_remove, |
| 472 | .shutdown = nv_tco_shutdown, | 472 | .shutdown = nv_tco_shutdown, |
| 473 | .driver = { | 473 | .driver = { |
| 474 | .owner = THIS_MODULE, | 474 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index 294fb4e00521..2761ddb08501 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c | |||
| @@ -289,7 +289,7 @@ static struct miscdevice xwdt_miscdev = { | |||
| 289 | .fops = &xwdt_fops, | 289 | .fops = &xwdt_fops, |
| 290 | }; | 290 | }; |
| 291 | 291 | ||
| 292 | static int __devinit xwdt_probe(struct platform_device *pdev) | 292 | static int xwdt_probe(struct platform_device *pdev) |
| 293 | { | 293 | { |
| 294 | int rc; | 294 | int rc; |
| 295 | u32 *tmptr; | 295 | u32 *tmptr; |
| @@ -383,7 +383,7 @@ err_out: | |||
| 383 | return rc; | 383 | return rc; |
| 384 | } | 384 | } |
| 385 | 385 | ||
| 386 | static int __devexit xwdt_remove(struct platform_device *dev) | 386 | static int xwdt_remove(struct platform_device *dev) |
| 387 | { | 387 | { |
| 388 | misc_deregister(&xwdt_miscdev); | 388 | misc_deregister(&xwdt_miscdev); |
| 389 | iounmap(xdev.base); | 389 | iounmap(xdev.base); |
| @@ -393,7 +393,7 @@ static int __devexit xwdt_remove(struct platform_device *dev) | |||
| 393 | } | 393 | } |
| 394 | 394 | ||
| 395 | /* Match table for of_platform binding */ | 395 | /* Match table for of_platform binding */ |
| 396 | static struct of_device_id __devinitdata xwdt_of_match[] = { | 396 | static struct of_device_id xwdt_of_match[] = { |
| 397 | { .compatible = "xlnx,xps-timebase-wdt-1.01.a", }, | 397 | { .compatible = "xlnx,xps-timebase-wdt-1.01.a", }, |
| 398 | {}, | 398 | {}, |
| 399 | }; | 399 | }; |
| @@ -401,7 +401,7 @@ MODULE_DEVICE_TABLE(of, xwdt_of_match); | |||
| 401 | 401 | ||
| 402 | static struct platform_driver xwdt_driver = { | 402 | static struct platform_driver xwdt_driver = { |
| 403 | .probe = xwdt_probe, | 403 | .probe = xwdt_probe, |
| 404 | .remove = __devexit_p(xwdt_remove), | 404 | .remove = xwdt_remove, |
| 405 | .driver = { | 405 | .driver = { |
| 406 | .owner = THIS_MODULE, | 406 | .owner = THIS_MODULE, |
| 407 | .name = WATCHDOG_NAME, | 407 | .name = WATCHDOG_NAME, |
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index f5db18dbc0f9..b0e541d022e6 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
| @@ -31,44 +31,34 @@ | |||
| 31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
| 32 | #include <linux/types.h> | 32 | #include <linux/types.h> |
| 33 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
| 34 | #include <linux/fs.h> | ||
| 35 | #include <linux/mm.h> | 34 | #include <linux/mm.h> |
| 36 | #include <linux/miscdevice.h> | ||
| 37 | #include <linux/watchdog.h> | 35 | #include <linux/watchdog.h> |
| 38 | #include <linux/reboot.h> | 36 | #include <linux/reboot.h> |
| 39 | #include <linux/init.h> | 37 | #include <linux/init.h> |
| 40 | #include <linux/err.h> | 38 | #include <linux/err.h> |
| 41 | #include <linux/platform_device.h> | 39 | #include <linux/platform_device.h> |
| 42 | #include <linux/moduleparam.h> | 40 | #include <linux/moduleparam.h> |
| 43 | #include <linux/bitops.h> | ||
| 44 | #include <linux/io.h> | 41 | #include <linux/io.h> |
| 45 | #include <linux/uaccess.h> | ||
| 46 | #include <linux/slab.h> | 42 | #include <linux/slab.h> |
| 47 | #include <linux/pm_runtime.h> | 43 | #include <linux/pm_runtime.h> |
| 48 | #include <mach/hardware.h> | 44 | #include <linux/platform_data/omap-wd-timer.h> |
| 49 | #include <plat/cpu.h> | ||
| 50 | #include <plat/prcm.h> | ||
| 51 | 45 | ||
| 52 | #include "omap_wdt.h" | 46 | #include "omap_wdt.h" |
| 53 | 47 | ||
| 54 | static struct platform_device *omap_wdt_dev; | ||
| 55 | |||
| 56 | static unsigned timer_margin; | 48 | static unsigned timer_margin; |
| 57 | module_param(timer_margin, uint, 0); | 49 | module_param(timer_margin, uint, 0); |
| 58 | MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)"); | 50 | MODULE_PARM_DESC(timer_margin, "initial watchdog timeout (in seconds)"); |
| 59 | 51 | ||
| 60 | static unsigned int wdt_trgr_pattern = 0x1234; | ||
| 61 | static DEFINE_SPINLOCK(wdt_lock); | ||
| 62 | |||
| 63 | struct omap_wdt_dev { | 52 | struct omap_wdt_dev { |
| 64 | void __iomem *base; /* physical */ | 53 | void __iomem *base; /* physical */ |
| 65 | struct device *dev; | 54 | struct device *dev; |
| 66 | int omap_wdt_users; | 55 | bool omap_wdt_users; |
| 67 | struct resource *mem; | 56 | struct resource *mem; |
| 68 | struct miscdevice omap_wdt_miscdev; | 57 | int wdt_trgr_pattern; |
| 58 | struct mutex lock; /* to avoid races with PM */ | ||
| 69 | }; | 59 | }; |
| 70 | 60 | ||
| 71 | static void omap_wdt_ping(struct omap_wdt_dev *wdev) | 61 | static void omap_wdt_reload(struct omap_wdt_dev *wdev) |
| 72 | { | 62 | { |
| 73 | void __iomem *base = wdev->base; | 63 | void __iomem *base = wdev->base; |
| 74 | 64 | ||
| @@ -76,8 +66,8 @@ static void omap_wdt_ping(struct omap_wdt_dev *wdev) | |||
| 76 | while ((__raw_readl(base + OMAP_WATCHDOG_WPS)) & 0x08) | 66 | while ((__raw_readl(base + OMAP_WATCHDOG_WPS)) & 0x08) |
| 77 | cpu_relax(); | 67 | cpu_relax(); |
| 78 | 68 | ||
| 79 | wdt_trgr_pattern = ~wdt_trgr_pattern; | 69 | wdev->wdt_trgr_pattern = ~wdev->wdt_trgr_pattern; |
| 80 | __raw_writel(wdt_trgr_pattern, (base + OMAP_WATCHDOG_TGR)); | 70 | __raw_writel(wdev->wdt_trgr_pattern, (base + OMAP_WATCHDOG_TGR)); |
| 81 | 71 | ||
| 82 | /* wait for posted write to complete */ | 72 | /* wait for posted write to complete */ |
| 83 | while ((__raw_readl(base + OMAP_WATCHDOG_WPS)) & 0x08) | 73 | while ((__raw_readl(base + OMAP_WATCHDOG_WPS)) & 0x08) |
| @@ -113,18 +103,10 @@ static void omap_wdt_disable(struct omap_wdt_dev *wdev) | |||
| 113 | cpu_relax(); | 103 | cpu_relax(); |
| 114 | } | 104 | } |
| 115 | 105 | ||
| 116 | static void omap_wdt_adjust_timeout(unsigned new_timeout) | 106 | static void omap_wdt_set_timer(struct omap_wdt_dev *wdev, |
| 117 | { | 107 | unsigned int timeout) |
| 118 | if (new_timeout < TIMER_MARGIN_MIN) | ||
| 119 | new_timeout = TIMER_MARGIN_DEFAULT; | ||
| 120 | if (new_timeout > TIMER_MARGIN_MAX) | ||
| 121 | new_timeout = TIMER_MARGIN_MAX; | ||
| 122 | timer_margin = new_timeout; | ||
| 123 | } | ||
| 124 | |||
| 125 | static void omap_wdt_set_timeout(struct omap_wdt_dev *wdev) | ||
| 126 | { | 108 | { |
| 127 | u32 pre_margin = GET_WLDR_VAL(timer_margin); | 109 | u32 pre_margin = GET_WLDR_VAL(timeout); |
| 128 | void __iomem *base = wdev->base; | 110 | void __iomem *base = wdev->base; |
| 129 | 111 | ||
| 130 | /* just count up at 32 KHz */ | 112 | /* just count up at 32 KHz */ |
| @@ -136,16 +118,14 @@ static void omap_wdt_set_timeout(struct omap_wdt_dev *wdev) | |||
| 136 | cpu_relax(); | 118 | cpu_relax(); |
| 137 | } | 119 | } |
| 138 | 120 | ||
| 139 | /* | 121 | static int omap_wdt_start(struct watchdog_device *wdog) |
| 140 | * Allow only one task to hold it open | ||
| 141 | */ | ||
| 142 | static int omap_wdt_open(struct inode *inode, struct file *file) | ||
| 143 | { | 122 | { |
| 144 | struct omap_wdt_dev *wdev = platform_get_drvdata(omap_wdt_dev); | 123 | struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); |
| 145 | void __iomem *base = wdev->base; | 124 | void __iomem *base = wdev->base; |
| 146 | 125 | ||
| 147 | if (test_and_set_bit(1, (unsigned long *)&(wdev->omap_wdt_users))) | 126 | mutex_lock(&wdev->lock); |
| 148 | return -EBUSY; | 127 | |
| 128 | wdev->omap_wdt_users = true; | ||
| 149 | 129 | ||
| 150 | pm_runtime_get_sync(wdev->dev); | 130 | pm_runtime_get_sync(wdev->dev); |
| 151 | 131 | ||
| @@ -157,225 +137,168 @@ static int omap_wdt_open(struct inode *inode, struct file *file) | |||
| 157 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01) | 137 | while (__raw_readl(base + OMAP_WATCHDOG_WPS) & 0x01) |
| 158 | cpu_relax(); | 138 | cpu_relax(); |
| 159 | 139 | ||
| 160 | file->private_data = (void *) wdev; | 140 | omap_wdt_set_timer(wdev, wdog->timeout); |
| 161 | 141 | omap_wdt_reload(wdev); /* trigger loading of new timeout value */ | |
| 162 | omap_wdt_set_timeout(wdev); | ||
| 163 | omap_wdt_ping(wdev); /* trigger loading of new timeout value */ | ||
| 164 | omap_wdt_enable(wdev); | 142 | omap_wdt_enable(wdev); |
| 165 | 143 | ||
| 166 | return nonseekable_open(inode, file); | 144 | mutex_unlock(&wdev->lock); |
| 145 | |||
| 146 | return 0; | ||
| 167 | } | 147 | } |
| 168 | 148 | ||
| 169 | static int omap_wdt_release(struct inode *inode, struct file *file) | 149 | static int omap_wdt_stop(struct watchdog_device *wdog) |
| 170 | { | 150 | { |
| 171 | struct omap_wdt_dev *wdev = file->private_data; | 151 | struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); |
| 172 | 152 | ||
| 173 | /* | 153 | mutex_lock(&wdev->lock); |
| 174 | * Shut off the timer unless NOWAYOUT is defined. | ||
| 175 | */ | ||
| 176 | #ifndef CONFIG_WATCHDOG_NOWAYOUT | ||
| 177 | omap_wdt_disable(wdev); | 154 | omap_wdt_disable(wdev); |
| 178 | |||
| 179 | pm_runtime_put_sync(wdev->dev); | 155 | pm_runtime_put_sync(wdev->dev); |
| 180 | #else | 156 | wdev->omap_wdt_users = false; |
| 181 | pr_crit("Unexpected close, not stopping!\n"); | 157 | mutex_unlock(&wdev->lock); |
| 182 | #endif | ||
| 183 | wdev->omap_wdt_users = 0; | ||
| 184 | |||
| 185 | return 0; | 158 | return 0; |
| 186 | } | 159 | } |
| 187 | 160 | ||
| 188 | static ssize_t omap_wdt_write(struct file *file, const char __user *data, | 161 | static int omap_wdt_ping(struct watchdog_device *wdog) |
| 189 | size_t len, loff_t *ppos) | ||
| 190 | { | 162 | { |
| 191 | struct omap_wdt_dev *wdev = file->private_data; | 163 | struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); |
| 192 | 164 | ||
| 193 | /* Refresh LOAD_TIME. */ | 165 | mutex_lock(&wdev->lock); |
| 194 | if (len) { | 166 | omap_wdt_reload(wdev); |
| 195 | spin_lock(&wdt_lock); | 167 | mutex_unlock(&wdev->lock); |
| 196 | omap_wdt_ping(wdev); | 168 | |
| 197 | spin_unlock(&wdt_lock); | 169 | return 0; |
| 198 | } | ||
| 199 | return len; | ||
| 200 | } | 170 | } |
| 201 | 171 | ||
| 202 | static long omap_wdt_ioctl(struct file *file, unsigned int cmd, | 172 | static int omap_wdt_set_timeout(struct watchdog_device *wdog, |
| 203 | unsigned long arg) | 173 | unsigned int timeout) |
| 204 | { | 174 | { |
| 205 | struct omap_wdt_dev *wdev; | 175 | struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); |
| 206 | int new_margin; | ||
| 207 | static const struct watchdog_info ident = { | ||
| 208 | .identity = "OMAP Watchdog", | ||
| 209 | .options = WDIOF_SETTIMEOUT, | ||
| 210 | .firmware_version = 0, | ||
| 211 | }; | ||
| 212 | |||
| 213 | wdev = file->private_data; | ||
| 214 | |||
| 215 | switch (cmd) { | ||
| 216 | case WDIOC_GETSUPPORT: | ||
| 217 | return copy_to_user((struct watchdog_info __user *)arg, &ident, | ||
| 218 | sizeof(ident)); | ||
| 219 | case WDIOC_GETSTATUS: | ||
| 220 | return put_user(0, (int __user *)arg); | ||
| 221 | case WDIOC_GETBOOTSTATUS: | ||
| 222 | #ifdef CONFIG_ARCH_OMAP1 | ||
| 223 | if (cpu_is_omap16xx()) | ||
| 224 | return put_user(__raw_readw(ARM_SYSST), | ||
| 225 | (int __user *)arg); | ||
| 226 | #endif | ||
| 227 | #ifdef CONFIG_ARCH_OMAP2PLUS | ||
| 228 | if (cpu_is_omap24xx()) | ||
| 229 | return put_user(omap_prcm_get_reset_sources(), | ||
| 230 | (int __user *)arg); | ||
| 231 | #endif | ||
| 232 | return put_user(0, (int __user *)arg); | ||
| 233 | case WDIOC_KEEPALIVE: | ||
| 234 | spin_lock(&wdt_lock); | ||
| 235 | omap_wdt_ping(wdev); | ||
| 236 | spin_unlock(&wdt_lock); | ||
| 237 | return 0; | ||
| 238 | case WDIOC_SETTIMEOUT: | ||
| 239 | if (get_user(new_margin, (int __user *)arg)) | ||
| 240 | return -EFAULT; | ||
| 241 | omap_wdt_adjust_timeout(new_margin); | ||
| 242 | |||
| 243 | spin_lock(&wdt_lock); | ||
| 244 | omap_wdt_disable(wdev); | ||
| 245 | omap_wdt_set_timeout(wdev); | ||
| 246 | omap_wdt_enable(wdev); | ||
| 247 | 176 | ||
| 248 | omap_wdt_ping(wdev); | 177 | mutex_lock(&wdev->lock); |
| 249 | spin_unlock(&wdt_lock); | 178 | omap_wdt_disable(wdev); |
| 250 | /* Fall */ | 179 | omap_wdt_set_timer(wdev, timeout); |
| 251 | case WDIOC_GETTIMEOUT: | 180 | omap_wdt_enable(wdev); |
| 252 | return put_user(timer_margin, (int __user *)arg); | 181 | omap_wdt_reload(wdev); |
| 253 | default: | 182 | wdog->timeout = timeout; |
| 254 | return -ENOTTY; | 183 | mutex_unlock(&wdev->lock); |
| 255 | } | 184 | |
| 185 | return 0; | ||
| 256 | } | 186 | } |
| 257 | 187 | ||
| 258 | static const struct file_operations omap_wdt_fops = { | 188 | static const struct watchdog_info omap_wdt_info = { |
| 259 | .owner = THIS_MODULE, | 189 | .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, |
| 260 | .write = omap_wdt_write, | 190 | .identity = "OMAP Watchdog", |
| 261 | .unlocked_ioctl = omap_wdt_ioctl, | ||
| 262 | .open = omap_wdt_open, | ||
| 263 | .release = omap_wdt_release, | ||
| 264 | .llseek = no_llseek, | ||
| 265 | }; | 191 | }; |
| 266 | 192 | ||
| 267 | static int __devinit omap_wdt_probe(struct platform_device *pdev) | 193 | static const struct watchdog_ops omap_wdt_ops = { |
| 194 | .owner = THIS_MODULE, | ||
| 195 | .start = omap_wdt_start, | ||
| 196 | .stop = omap_wdt_stop, | ||
| 197 | .ping = omap_wdt_ping, | ||
| 198 | .set_timeout = omap_wdt_set_timeout, | ||
| 199 | }; | ||
| 200 | |||
| 201 | static int omap_wdt_probe(struct platform_device *pdev) | ||
| 268 | { | 202 | { |
| 203 | struct omap_wd_timer_platform_data *pdata = pdev->dev.platform_data; | ||
| 204 | bool nowayout = WATCHDOG_NOWAYOUT; | ||
| 205 | struct watchdog_device *omap_wdt; | ||
| 269 | struct resource *res, *mem; | 206 | struct resource *res, *mem; |
| 270 | struct omap_wdt_dev *wdev; | 207 | struct omap_wdt_dev *wdev; |
| 208 | u32 rs; | ||
| 271 | int ret; | 209 | int ret; |
| 272 | 210 | ||
| 211 | omap_wdt = devm_kzalloc(&pdev->dev, sizeof(*omap_wdt), GFP_KERNEL); | ||
| 212 | if (!omap_wdt) | ||
| 213 | return -ENOMEM; | ||
| 214 | |||
| 273 | /* reserve static register mappings */ | 215 | /* reserve static register mappings */ |
| 274 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 216 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 275 | if (!res) { | 217 | if (!res) |
| 276 | ret = -ENOENT; | 218 | return -ENOENT; |
| 277 | goto err_get_resource; | ||
| 278 | } | ||
| 279 | 219 | ||
| 280 | if (omap_wdt_dev) { | 220 | mem = devm_request_mem_region(&pdev->dev, res->start, |
| 281 | ret = -EBUSY; | 221 | resource_size(res), pdev->name); |
| 282 | goto err_busy; | 222 | if (!mem) |
| 283 | } | 223 | return -EBUSY; |
| 284 | 224 | ||
| 285 | mem = request_mem_region(res->start, resource_size(res), pdev->name); | 225 | wdev = devm_kzalloc(&pdev->dev, sizeof(*wdev), GFP_KERNEL); |
| 286 | if (!mem) { | 226 | if (!wdev) |
| 287 | ret = -EBUSY; | 227 | return -ENOMEM; |
| 288 | goto err_busy; | ||
| 289 | } | ||
| 290 | 228 | ||
| 291 | wdev = kzalloc(sizeof(struct omap_wdt_dev), GFP_KERNEL); | 229 | wdev->omap_wdt_users = false; |
| 292 | if (!wdev) { | 230 | wdev->mem = mem; |
| 293 | ret = -ENOMEM; | 231 | wdev->dev = &pdev->dev; |
| 294 | goto err_kzalloc; | 232 | wdev->wdt_trgr_pattern = 0x1234; |
| 295 | } | 233 | mutex_init(&wdev->lock); |
| 296 | 234 | ||
| 297 | wdev->omap_wdt_users = 0; | 235 | wdev->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); |
| 298 | wdev->mem = mem; | 236 | if (!wdev->base) |
| 299 | wdev->dev = &pdev->dev; | 237 | return -ENOMEM; |
| 300 | 238 | ||
| 301 | wdev->base = ioremap(res->start, resource_size(res)); | 239 | omap_wdt->info = &omap_wdt_info; |
| 302 | if (!wdev->base) { | 240 | omap_wdt->ops = &omap_wdt_ops; |
| 303 | ret = -ENOMEM; | 241 | omap_wdt->min_timeout = TIMER_MARGIN_MIN; |
| 304 | goto err_ioremap; | 242 | omap_wdt->max_timeout = TIMER_MARGIN_MAX; |
| 305 | } | ||
| 306 | 243 | ||
| 307 | platform_set_drvdata(pdev, wdev); | 244 | if (timer_margin >= TIMER_MARGIN_MIN && |
| 245 | timer_margin <= TIMER_MARGIN_MAX) | ||
| 246 | omap_wdt->timeout = timer_margin; | ||
| 247 | else | ||
| 248 | omap_wdt->timeout = TIMER_MARGIN_DEFAULT; | ||
| 249 | |||
| 250 | watchdog_set_drvdata(omap_wdt, wdev); | ||
| 251 | watchdog_set_nowayout(omap_wdt, nowayout); | ||
| 252 | |||
| 253 | platform_set_drvdata(pdev, omap_wdt); | ||
| 308 | 254 | ||
| 309 | pm_runtime_enable(wdev->dev); | 255 | pm_runtime_enable(wdev->dev); |
| 310 | pm_runtime_get_sync(wdev->dev); | 256 | pm_runtime_get_sync(wdev->dev); |
| 311 | 257 | ||
| 312 | omap_wdt_disable(wdev); | 258 | if (pdata && pdata->read_reset_sources) |
| 313 | omap_wdt_adjust_timeout(timer_margin); | 259 | rs = pdata->read_reset_sources(); |
| 260 | else | ||
| 261 | rs = 0; | ||
| 262 | omap_wdt->bootstatus = (rs & (1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT)) ? | ||
| 263 | WDIOF_CARDRESET : 0; | ||
| 314 | 264 | ||
| 315 | wdev->omap_wdt_miscdev.parent = &pdev->dev; | 265 | omap_wdt_disable(wdev); |
| 316 | wdev->omap_wdt_miscdev.minor = WATCHDOG_MINOR; | ||
| 317 | wdev->omap_wdt_miscdev.name = "watchdog"; | ||
| 318 | wdev->omap_wdt_miscdev.fops = &omap_wdt_fops; | ||
| 319 | 266 | ||
| 320 | ret = misc_register(&(wdev->omap_wdt_miscdev)); | 267 | ret = watchdog_register_device(omap_wdt); |
| 321 | if (ret) | 268 | if (ret) { |
| 322 | goto err_misc; | 269 | pm_runtime_disable(wdev->dev); |
| 270 | return ret; | ||
| 271 | } | ||
| 323 | 272 | ||
| 324 | pr_info("OMAP Watchdog Timer Rev 0x%02x: initial timeout %d sec\n", | 273 | pr_info("OMAP Watchdog Timer Rev 0x%02x: initial timeout %d sec\n", |
| 325 | __raw_readl(wdev->base + OMAP_WATCHDOG_REV) & 0xFF, | 274 | __raw_readl(wdev->base + OMAP_WATCHDOG_REV) & 0xFF, |
| 326 | timer_margin); | 275 | omap_wdt->timeout); |
| 327 | 276 | ||
| 328 | pm_runtime_put_sync(wdev->dev); | 277 | pm_runtime_put_sync(wdev->dev); |
| 329 | 278 | ||
| 330 | omap_wdt_dev = pdev; | ||
| 331 | |||
| 332 | return 0; | 279 | return 0; |
| 333 | |||
| 334 | err_misc: | ||
| 335 | pm_runtime_disable(wdev->dev); | ||
| 336 | platform_set_drvdata(pdev, NULL); | ||
| 337 | iounmap(wdev->base); | ||
| 338 | |||
| 339 | err_ioremap: | ||
| 340 | wdev->base = NULL; | ||
| 341 | kfree(wdev); | ||
| 342 | |||
| 343 | err_kzalloc: | ||
| 344 | release_mem_region(res->start, resource_size(res)); | ||
| 345 | |||
| 346 | err_busy: | ||
| 347 | err_get_resource: | ||
| 348 | |||
| 349 | return ret; | ||
| 350 | } | 280 | } |
| 351 | 281 | ||
| 352 | static void omap_wdt_shutdown(struct platform_device *pdev) | 282 | static void omap_wdt_shutdown(struct platform_device *pdev) |
| 353 | { | 283 | { |
| 354 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); | 284 | struct watchdog_device *wdog = platform_get_drvdata(pdev); |
| 285 | struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); | ||
| 355 | 286 | ||
| 287 | mutex_lock(&wdev->lock); | ||
| 356 | if (wdev->omap_wdt_users) { | 288 | if (wdev->omap_wdt_users) { |
| 357 | omap_wdt_disable(wdev); | 289 | omap_wdt_disable(wdev); |
| 358 | pm_runtime_put_sync(wdev->dev); | 290 | pm_runtime_put_sync(wdev->dev); |
| 359 | } | 291 | } |
| 292 | mutex_unlock(&wdev->lock); | ||
| 360 | } | 293 | } |
| 361 | 294 | ||
| 362 | static int __devexit omap_wdt_remove(struct platform_device *pdev) | 295 | static int omap_wdt_remove(struct platform_device *pdev) |
| 363 | { | 296 | { |
| 364 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); | 297 | struct watchdog_device *wdog = platform_get_drvdata(pdev); |
| 365 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 298 | struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); |
| 366 | 299 | ||
| 367 | pm_runtime_disable(wdev->dev); | 300 | pm_runtime_disable(wdev->dev); |
| 368 | if (!res) | 301 | watchdog_unregister_device(wdog); |
| 369 | return -ENOENT; | ||
| 370 | |||
| 371 | misc_deregister(&(wdev->omap_wdt_miscdev)); | ||
| 372 | release_mem_region(res->start, resource_size(res)); | ||
| 373 | platform_set_drvdata(pdev, NULL); | ||
| 374 | |||
| 375 | iounmap(wdev->base); | ||
| 376 | |||
| 377 | kfree(wdev); | ||
| 378 | omap_wdt_dev = NULL; | ||
| 379 | 302 | ||
| 380 | return 0; | 303 | return 0; |
| 381 | } | 304 | } |
| @@ -390,25 +313,31 @@ static int __devexit omap_wdt_remove(struct platform_device *pdev) | |||
| 390 | 313 | ||
| 391 | static int omap_wdt_suspend(struct platform_device *pdev, pm_message_t state) | 314 | static int omap_wdt_suspend(struct platform_device *pdev, pm_message_t state) |
| 392 | { | 315 | { |
| 393 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); | 316 | struct watchdog_device *wdog = platform_get_drvdata(pdev); |
| 317 | struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); | ||
| 394 | 318 | ||
| 319 | mutex_lock(&wdev->lock); | ||
| 395 | if (wdev->omap_wdt_users) { | 320 | if (wdev->omap_wdt_users) { |
| 396 | omap_wdt_disable(wdev); | 321 | omap_wdt_disable(wdev); |
| 397 | pm_runtime_put_sync(wdev->dev); | 322 | pm_runtime_put_sync(wdev->dev); |
| 398 | } | 323 | } |
| 324 | mutex_unlock(&wdev->lock); | ||
| 399 | 325 | ||
| 400 | return 0; | 326 | return 0; |
| 401 | } | 327 | } |
| 402 | 328 | ||
| 403 | static int omap_wdt_resume(struct platform_device *pdev) | 329 | static int omap_wdt_resume(struct platform_device *pdev) |
| 404 | { | 330 | { |
| 405 | struct omap_wdt_dev *wdev = platform_get_drvdata(pdev); | 331 | struct watchdog_device *wdog = platform_get_drvdata(pdev); |
| 332 | struct omap_wdt_dev *wdev = watchdog_get_drvdata(wdog); | ||
| 406 | 333 | ||
| 334 | mutex_lock(&wdev->lock); | ||
| 407 | if (wdev->omap_wdt_users) { | 335 | if (wdev->omap_wdt_users) { |
| 408 | pm_runtime_get_sync(wdev->dev); | 336 | pm_runtime_get_sync(wdev->dev); |
| 409 | omap_wdt_enable(wdev); | 337 | omap_wdt_enable(wdev); |
| 410 | omap_wdt_ping(wdev); | 338 | omap_wdt_reload(wdev); |
| 411 | } | 339 | } |
| 340 | mutex_unlock(&wdev->lock); | ||
| 412 | 341 | ||
| 413 | return 0; | 342 | return 0; |
| 414 | } | 343 | } |
| @@ -426,7 +355,7 @@ MODULE_DEVICE_TABLE(of, omap_wdt_of_match); | |||
| 426 | 355 | ||
| 427 | static struct platform_driver omap_wdt_driver = { | 356 | static struct platform_driver omap_wdt_driver = { |
| 428 | .probe = omap_wdt_probe, | 357 | .probe = omap_wdt_probe, |
| 429 | .remove = __devexit_p(omap_wdt_remove), | 358 | .remove = omap_wdt_remove, |
| 430 | .shutdown = omap_wdt_shutdown, | 359 | .shutdown = omap_wdt_shutdown, |
| 431 | .suspend = omap_wdt_suspend, | 360 | .suspend = omap_wdt_suspend, |
| 432 | .resume = omap_wdt_resume, | 361 | .resume = omap_wdt_resume, |
| @@ -441,5 +370,4 @@ module_platform_driver(omap_wdt_driver); | |||
| 441 | 370 | ||
| 442 | MODULE_AUTHOR("George G. Davis"); | 371 | MODULE_AUTHOR("George G. Davis"); |
| 443 | MODULE_LICENSE("GPL"); | 372 | MODULE_LICENSE("GPL"); |
| 444 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
| 445 | MODULE_ALIAS("platform:omap_wdt"); | 373 | MODULE_ALIAS("platform:omap_wdt"); |
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index c20f96b579d9..7c18b3bffcf7 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c | |||
| @@ -142,7 +142,7 @@ static struct watchdog_device orion_wdt = { | |||
| 142 | .ops = &orion_wdt_ops, | 142 | .ops = &orion_wdt_ops, |
| 143 | }; | 143 | }; |
| 144 | 144 | ||
| 145 | static int __devinit orion_wdt_probe(struct platform_device *pdev) | 145 | static int orion_wdt_probe(struct platform_device *pdev) |
| 146 | { | 146 | { |
| 147 | struct resource *res; | 147 | struct resource *res; |
| 148 | int ret; | 148 | int ret; |
| @@ -156,6 +156,8 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev) | |||
| 156 | wdt_tclk = clk_get_rate(clk); | 156 | wdt_tclk = clk_get_rate(clk); |
| 157 | 157 | ||
| 158 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 158 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 159 | if (!res) | ||
| 160 | return -ENODEV; | ||
| 159 | wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); | 161 | wdt_reg = devm_ioremap(&pdev->dev, res->start, resource_size(res)); |
| 160 | if (!wdt_reg) | 162 | if (!wdt_reg) |
| 161 | return -ENOMEM; | 163 | return -ENOMEM; |
| @@ -181,7 +183,7 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev) | |||
| 181 | return 0; | 183 | return 0; |
| 182 | } | 184 | } |
| 183 | 185 | ||
| 184 | static int __devexit orion_wdt_remove(struct platform_device *pdev) | 186 | static int orion_wdt_remove(struct platform_device *pdev) |
| 185 | { | 187 | { |
| 186 | watchdog_unregister_device(&orion_wdt); | 188 | watchdog_unregister_device(&orion_wdt); |
| 187 | clk_disable_unprepare(clk); | 189 | clk_disable_unprepare(clk); |
| @@ -193,7 +195,7 @@ static void orion_wdt_shutdown(struct platform_device *pdev) | |||
| 193 | orion_wdt_stop(&orion_wdt); | 195 | orion_wdt_stop(&orion_wdt); |
| 194 | } | 196 | } |
| 195 | 197 | ||
| 196 | static const struct of_device_id orion_wdt_of_match_table[] __devinitdata = { | 198 | static const struct of_device_id orion_wdt_of_match_table[] = { |
| 197 | { .compatible = "marvell,orion-wdt", }, | 199 | { .compatible = "marvell,orion-wdt", }, |
| 198 | {}, | 200 | {}, |
| 199 | }; | 201 | }; |
| @@ -201,7 +203,7 @@ MODULE_DEVICE_TABLE(of, orion_wdt_of_match_table); | |||
| 201 | 203 | ||
| 202 | static struct platform_driver orion_wdt_driver = { | 204 | static struct platform_driver orion_wdt_driver = { |
| 203 | .probe = orion_wdt_probe, | 205 | .probe = orion_wdt_probe, |
| 204 | .remove = __devexit_p(orion_wdt_remove), | 206 | .remove = orion_wdt_remove, |
| 205 | .shutdown = orion_wdt_shutdown, | 207 | .shutdown = orion_wdt_shutdown, |
| 206 | .driver = { | 208 | .driver = { |
| 207 | .owner = THIS_MODULE, | 209 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/pcwd.c b/drivers/watchdog/pcwd.c index 75694cf24f86..33e49a7f889f 100644 --- a/drivers/watchdog/pcwd.c +++ b/drivers/watchdog/pcwd.c | |||
| @@ -801,7 +801,7 @@ static inline int get_revision(void) | |||
| 801 | * The initial rate is once per second at board start up, then twice | 801 | * The initial rate is once per second at board start up, then twice |
| 802 | * per second for normal operation. | 802 | * per second for normal operation. |
| 803 | */ | 803 | */ |
| 804 | static int __devinit pcwd_isa_match(struct device *dev, unsigned int id) | 804 | static int pcwd_isa_match(struct device *dev, unsigned int id) |
| 805 | { | 805 | { |
| 806 | int base_addr = pcwd_ioports[id]; | 806 | int base_addr = pcwd_ioports[id]; |
| 807 | int port0, last_port0; /* Reg 0, in case it's REV A */ | 807 | int port0, last_port0; /* Reg 0, in case it's REV A */ |
| @@ -846,7 +846,7 @@ static int __devinit pcwd_isa_match(struct device *dev, unsigned int id) | |||
| 846 | return retval; | 846 | return retval; |
| 847 | } | 847 | } |
| 848 | 848 | ||
| 849 | static int __devinit pcwd_isa_probe(struct device *dev, unsigned int id) | 849 | static int pcwd_isa_probe(struct device *dev, unsigned int id) |
| 850 | { | 850 | { |
| 851 | int ret; | 851 | int ret; |
| 852 | 852 | ||
| @@ -949,7 +949,7 @@ error_request_region: | |||
| 949 | return ret; | 949 | return ret; |
| 950 | } | 950 | } |
| 951 | 951 | ||
| 952 | static int __devexit pcwd_isa_remove(struct device *dev, unsigned int id) | 952 | static int pcwd_isa_remove(struct device *dev, unsigned int id) |
| 953 | { | 953 | { |
| 954 | if (debug >= DEBUG) | 954 | if (debug >= DEBUG) |
| 955 | pr_debug("pcwd_isa_remove id=%d\n", id); | 955 | pr_debug("pcwd_isa_remove id=%d\n", id); |
| @@ -984,7 +984,7 @@ static void pcwd_isa_shutdown(struct device *dev, unsigned int id) | |||
| 984 | static struct isa_driver pcwd_isa_driver = { | 984 | static struct isa_driver pcwd_isa_driver = { |
| 985 | .match = pcwd_isa_match, | 985 | .match = pcwd_isa_match, |
| 986 | .probe = pcwd_isa_probe, | 986 | .probe = pcwd_isa_probe, |
| 987 | .remove = __devexit_p(pcwd_isa_remove), | 987 | .remove = pcwd_isa_remove, |
| 988 | .shutdown = pcwd_isa_shutdown, | 988 | .shutdown = pcwd_isa_shutdown, |
| 989 | .driver = { | 989 | .driver = { |
| 990 | .owner = THIS_MODULE, | 990 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c index ee6900da8678..7890f84edf76 100644 --- a/drivers/watchdog/pcwd_pci.c +++ b/drivers/watchdog/pcwd_pci.c | |||
| @@ -682,7 +682,7 @@ static struct notifier_block pcipcwd_notifier = { | |||
| 682 | * Init & exit routines | 682 | * Init & exit routines |
| 683 | */ | 683 | */ |
| 684 | 684 | ||
| 685 | static int __devinit pcipcwd_card_init(struct pci_dev *pdev, | 685 | static int pcipcwd_card_init(struct pci_dev *pdev, |
| 686 | const struct pci_device_id *ent) | 686 | const struct pci_device_id *ent) |
| 687 | { | 687 | { |
| 688 | int ret = -EIO; | 688 | int ret = -EIO; |
| @@ -785,7 +785,7 @@ err_out_disable_device: | |||
| 785 | return ret; | 785 | return ret; |
| 786 | } | 786 | } |
| 787 | 787 | ||
| 788 | static void __devexit pcipcwd_card_exit(struct pci_dev *pdev) | 788 | static void pcipcwd_card_exit(struct pci_dev *pdev) |
| 789 | { | 789 | { |
| 790 | /* Stop the timer before we leave */ | 790 | /* Stop the timer before we leave */ |
| 791 | if (!nowayout) | 791 | if (!nowayout) |
| @@ -812,7 +812,7 @@ static struct pci_driver pcipcwd_driver = { | |||
| 812 | .name = WATCHDOG_NAME, | 812 | .name = WATCHDOG_NAME, |
| 813 | .id_table = pcipcwd_pci_tbl, | 813 | .id_table = pcipcwd_pci_tbl, |
| 814 | .probe = pcipcwd_card_init, | 814 | .probe = pcipcwd_card_init, |
| 815 | .remove = __devexit_p(pcipcwd_card_exit), | 815 | .remove = pcipcwd_card_exit, |
| 816 | }; | 816 | }; |
| 817 | 817 | ||
| 818 | module_pci_driver(pcipcwd_driver); | 818 | module_pci_driver(pcipcwd_driver); |
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index 87722e126058..dcba5dab6c29 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c | |||
| @@ -146,7 +146,7 @@ static struct watchdog_device pnx4008_wdd = { | |||
| 146 | .max_timeout = MAX_HEARTBEAT, | 146 | .max_timeout = MAX_HEARTBEAT, |
| 147 | }; | 147 | }; |
| 148 | 148 | ||
| 149 | static int __devinit pnx4008_wdt_probe(struct platform_device *pdev) | 149 | static int pnx4008_wdt_probe(struct platform_device *pdev) |
| 150 | { | 150 | { |
| 151 | struct resource *r; | 151 | struct resource *r; |
| 152 | int ret = 0; | 152 | int ret = 0; |
| @@ -192,7 +192,7 @@ out: | |||
| 192 | return ret; | 192 | return ret; |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | static int __devexit pnx4008_wdt_remove(struct platform_device *pdev) | 195 | static int pnx4008_wdt_remove(struct platform_device *pdev) |
| 196 | { | 196 | { |
| 197 | watchdog_unregister_device(&pnx4008_wdd); | 197 | watchdog_unregister_device(&pnx4008_wdd); |
| 198 | 198 | ||
| @@ -217,7 +217,7 @@ static struct platform_driver platform_wdt_driver = { | |||
| 217 | .of_match_table = of_match_ptr(pnx4008_wdt_match), | 217 | .of_match_table = of_match_ptr(pnx4008_wdt_match), |
| 218 | }, | 218 | }, |
| 219 | .probe = pnx4008_wdt_probe, | 219 | .probe = pnx4008_wdt_probe, |
| 220 | .remove = __devexit_p(pnx4008_wdt_remove), | 220 | .remove = pnx4008_wdt_remove, |
| 221 | }; | 221 | }; |
| 222 | 222 | ||
| 223 | module_platform_driver(platform_wdt_driver); | 223 | module_platform_driver(platform_wdt_driver); |
diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c index 547353a50ebb..f78bc008cbb7 100644 --- a/drivers/watchdog/rc32434_wdt.c +++ b/drivers/watchdog/rc32434_wdt.c | |||
| @@ -260,7 +260,7 @@ static struct miscdevice rc32434_wdt_miscdev = { | |||
| 260 | .fops = &rc32434_wdt_fops, | 260 | .fops = &rc32434_wdt_fops, |
| 261 | }; | 261 | }; |
| 262 | 262 | ||
| 263 | static int __devinit rc32434_wdt_probe(struct platform_device *pdev) | 263 | static int rc32434_wdt_probe(struct platform_device *pdev) |
| 264 | { | 264 | { |
| 265 | int ret; | 265 | int ret; |
| 266 | struct resource *r; | 266 | struct resource *r; |
| @@ -306,7 +306,7 @@ unmap: | |||
| 306 | return ret; | 306 | return ret; |
| 307 | } | 307 | } |
| 308 | 308 | ||
| 309 | static int __devexit rc32434_wdt_remove(struct platform_device *pdev) | 309 | static int rc32434_wdt_remove(struct platform_device *pdev) |
| 310 | { | 310 | { |
| 311 | misc_deregister(&rc32434_wdt_miscdev); | 311 | misc_deregister(&rc32434_wdt_miscdev); |
| 312 | iounmap(wdt_reg); | 312 | iounmap(wdt_reg); |
| @@ -320,7 +320,7 @@ static void rc32434_wdt_shutdown(struct platform_device *pdev) | |||
| 320 | 320 | ||
| 321 | static struct platform_driver rc32434_wdt_driver = { | 321 | static struct platform_driver rc32434_wdt_driver = { |
| 322 | .probe = rc32434_wdt_probe, | 322 | .probe = rc32434_wdt_probe, |
| 323 | .remove = __devexit_p(rc32434_wdt_remove), | 323 | .remove = rc32434_wdt_remove, |
| 324 | .shutdown = rc32434_wdt_shutdown, | 324 | .shutdown = rc32434_wdt_shutdown, |
| 325 | .driver = { | 325 | .driver = { |
| 326 | .name = "rc32434_wdt", | 326 | .name = "rc32434_wdt", |
diff --git a/drivers/watchdog/rdc321x_wdt.c b/drivers/watchdog/rdc321x_wdt.c index 042ccc56ae26..b0f116c2fd53 100644 --- a/drivers/watchdog/rdc321x_wdt.c +++ b/drivers/watchdog/rdc321x_wdt.c | |||
| @@ -225,7 +225,7 @@ static struct miscdevice rdc321x_wdt_misc = { | |||
| 225 | .fops = &rdc321x_wdt_fops, | 225 | .fops = &rdc321x_wdt_fops, |
| 226 | }; | 226 | }; |
| 227 | 227 | ||
| 228 | static int __devinit rdc321x_wdt_probe(struct platform_device *pdev) | 228 | static int rdc321x_wdt_probe(struct platform_device *pdev) |
| 229 | { | 229 | { |
| 230 | int err; | 230 | int err; |
| 231 | struct resource *r; | 231 | struct resource *r; |
| @@ -272,7 +272,7 @@ static int __devinit rdc321x_wdt_probe(struct platform_device *pdev) | |||
| 272 | return 0; | 272 | return 0; |
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | static int __devexit rdc321x_wdt_remove(struct platform_device *pdev) | 275 | static int rdc321x_wdt_remove(struct platform_device *pdev) |
| 276 | { | 276 | { |
| 277 | if (rdc321x_wdt_device.queue) { | 277 | if (rdc321x_wdt_device.queue) { |
| 278 | rdc321x_wdt_device.queue = 0; | 278 | rdc321x_wdt_device.queue = 0; |
| @@ -286,7 +286,7 @@ static int __devexit rdc321x_wdt_remove(struct platform_device *pdev) | |||
| 286 | 286 | ||
| 287 | static struct platform_driver rdc321x_wdt_driver = { | 287 | static struct platform_driver rdc321x_wdt_driver = { |
| 288 | .probe = rdc321x_wdt_probe, | 288 | .probe = rdc321x_wdt_probe, |
| 289 | .remove = __devexit_p(rdc321x_wdt_remove), | 289 | .remove = rdc321x_wdt_remove, |
| 290 | .driver = { | 290 | .driver = { |
| 291 | .owner = THIS_MODULE, | 291 | .owner = THIS_MODULE, |
| 292 | .name = "rdc321x-wdt", | 292 | .name = "rdc321x-wdt", |
diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c index 49e1b1c2135c..0040451aec1d 100644 --- a/drivers/watchdog/riowd.c +++ b/drivers/watchdog/riowd.c | |||
| @@ -174,7 +174,7 @@ static struct miscdevice riowd_miscdev = { | |||
| 174 | .fops = &riowd_fops | 174 | .fops = &riowd_fops |
| 175 | }; | 175 | }; |
| 176 | 176 | ||
| 177 | static int __devinit riowd_probe(struct platform_device *op) | 177 | static int riowd_probe(struct platform_device *op) |
| 178 | { | 178 | { |
| 179 | struct riowd *p; | 179 | struct riowd *p; |
| 180 | int err = -EINVAL; | 180 | int err = -EINVAL; |
| @@ -220,7 +220,7 @@ out: | |||
| 220 | return err; | 220 | return err; |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | static int __devexit riowd_remove(struct platform_device *op) | 223 | static int riowd_remove(struct platform_device *op) |
| 224 | { | 224 | { |
| 225 | struct riowd *p = dev_get_drvdata(&op->dev); | 225 | struct riowd *p = dev_get_drvdata(&op->dev); |
| 226 | 226 | ||
| @@ -246,7 +246,7 @@ static struct platform_driver riowd_driver = { | |||
| 246 | .of_match_table = riowd_match, | 246 | .of_match_table = riowd_match, |
| 247 | }, | 247 | }, |
| 248 | .probe = riowd_probe, | 248 | .probe = riowd_probe, |
| 249 | .remove = __devexit_p(riowd_remove), | 249 | .remove = riowd_remove, |
| 250 | }; | 250 | }; |
| 251 | 251 | ||
| 252 | module_platform_driver(riowd_driver); | 252 | module_platform_driver(riowd_driver); |
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 9245b4d23bfe..27bcd4e2c4a4 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c | |||
| @@ -303,7 +303,7 @@ static inline void s3c2410wdt_cpufreq_deregister(void) | |||
| 303 | } | 303 | } |
| 304 | #endif | 304 | #endif |
| 305 | 305 | ||
| 306 | static int __devinit s3c2410wdt_probe(struct platform_device *pdev) | 306 | static int s3c2410wdt_probe(struct platform_device *pdev) |
| 307 | { | 307 | { |
| 308 | struct device *dev; | 308 | struct device *dev; |
| 309 | unsigned int wtcon; | 309 | unsigned int wtcon; |
| @@ -354,7 +354,7 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) | |||
| 354 | goto err_map; | 354 | goto err_map; |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | clk_enable(wdt_clock); | 357 | clk_prepare_enable(wdt_clock); |
| 358 | 358 | ||
| 359 | ret = s3c2410wdt_cpufreq_register(); | 359 | ret = s3c2410wdt_cpufreq_register(); |
| 360 | if (ret < 0) { | 360 | if (ret < 0) { |
| @@ -421,7 +421,7 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) | |||
| 421 | s3c2410wdt_cpufreq_deregister(); | 421 | s3c2410wdt_cpufreq_deregister(); |
| 422 | 422 | ||
| 423 | err_clk: | 423 | err_clk: |
| 424 | clk_disable(wdt_clock); | 424 | clk_disable_unprepare(wdt_clock); |
| 425 | clk_put(wdt_clock); | 425 | clk_put(wdt_clock); |
| 426 | wdt_clock = NULL; | 426 | wdt_clock = NULL; |
| 427 | 427 | ||
| @@ -437,7 +437,7 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) | |||
| 437 | return ret; | 437 | return ret; |
| 438 | } | 438 | } |
| 439 | 439 | ||
| 440 | static int __devexit s3c2410wdt_remove(struct platform_device *dev) | 440 | static int s3c2410wdt_remove(struct platform_device *dev) |
| 441 | { | 441 | { |
| 442 | watchdog_unregister_device(&s3c2410_wdd); | 442 | watchdog_unregister_device(&s3c2410_wdd); |
| 443 | 443 | ||
| @@ -445,7 +445,7 @@ static int __devexit s3c2410wdt_remove(struct platform_device *dev) | |||
| 445 | 445 | ||
| 446 | s3c2410wdt_cpufreq_deregister(); | 446 | s3c2410wdt_cpufreq_deregister(); |
| 447 | 447 | ||
| 448 | clk_disable(wdt_clock); | 448 | clk_disable_unprepare(wdt_clock); |
| 449 | clk_put(wdt_clock); | 449 | clk_put(wdt_clock); |
| 450 | wdt_clock = NULL; | 450 | wdt_clock = NULL; |
| 451 | 451 | ||
| @@ -508,7 +508,7 @@ MODULE_DEVICE_TABLE(of, s3c2410_wdt_match); | |||
| 508 | 508 | ||
| 509 | static struct platform_driver s3c2410wdt_driver = { | 509 | static struct platform_driver s3c2410wdt_driver = { |
| 510 | .probe = s3c2410wdt_probe, | 510 | .probe = s3c2410wdt_probe, |
| 511 | .remove = __devexit_p(s3c2410wdt_remove), | 511 | .remove = s3c2410wdt_remove, |
| 512 | .shutdown = s3c2410wdt_shutdown, | 512 | .shutdown = s3c2410wdt_shutdown, |
| 513 | .suspend = s3c2410wdt_suspend, | 513 | .suspend = s3c2410wdt_suspend, |
| 514 | .resume = s3c2410wdt_resume, | 514 | .resume = s3c2410wdt_resume, |
diff --git a/drivers/watchdog/sch311x_wdt.c b/drivers/watchdog/sch311x_wdt.c index 9681ada0f252..af7b136b1874 100644 --- a/drivers/watchdog/sch311x_wdt.c +++ b/drivers/watchdog/sch311x_wdt.c | |||
| @@ -356,7 +356,7 @@ static struct miscdevice sch311x_wdt_miscdev = { | |||
| 356 | * Init & exit routines | 356 | * Init & exit routines |
| 357 | */ | 357 | */ |
| 358 | 358 | ||
| 359 | static int __devinit sch311x_wdt_probe(struct platform_device *pdev) | 359 | static int sch311x_wdt_probe(struct platform_device *pdev) |
| 360 | { | 360 | { |
| 361 | struct device *dev = &pdev->dev; | 361 | struct device *dev = &pdev->dev; |
| 362 | int err; | 362 | int err; |
| @@ -429,7 +429,7 @@ exit: | |||
| 429 | return err; | 429 | return err; |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | static int __devexit sch311x_wdt_remove(struct platform_device *pdev) | 432 | static int sch311x_wdt_remove(struct platform_device *pdev) |
| 433 | { | 433 | { |
| 434 | /* Stop the timer before we leave */ | 434 | /* Stop the timer before we leave */ |
| 435 | if (!nowayout) | 435 | if (!nowayout) |
| @@ -451,7 +451,7 @@ static void sch311x_wdt_shutdown(struct platform_device *dev) | |||
| 451 | 451 | ||
| 452 | static struct platform_driver sch311x_wdt_driver = { | 452 | static struct platform_driver sch311x_wdt_driver = { |
| 453 | .probe = sch311x_wdt_probe, | 453 | .probe = sch311x_wdt_probe, |
| 454 | .remove = __devexit_p(sch311x_wdt_remove), | 454 | .remove = sch311x_wdt_remove, |
| 455 | .shutdown = sch311x_wdt_shutdown, | 455 | .shutdown = sch311x_wdt_shutdown, |
| 456 | .driver = { | 456 | .driver = { |
| 457 | .owner = THIS_MODULE, | 457 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c index e5b59bebcdb1..6a89e4045fbd 100644 --- a/drivers/watchdog/shwdt.c +++ b/drivers/watchdog/shwdt.c | |||
| @@ -217,7 +217,7 @@ static struct watchdog_device sh_wdt_dev = { | |||
| 217 | .ops = &sh_wdt_ops, | 217 | .ops = &sh_wdt_ops, |
| 218 | }; | 218 | }; |
| 219 | 219 | ||
| 220 | static int __devinit sh_wdt_probe(struct platform_device *pdev) | 220 | static int sh_wdt_probe(struct platform_device *pdev) |
| 221 | { | 221 | { |
| 222 | struct sh_wdt *wdt; | 222 | struct sh_wdt *wdt; |
| 223 | struct resource *res; | 223 | struct resource *res; |
| @@ -298,7 +298,7 @@ err: | |||
| 298 | return rc; | 298 | return rc; |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | static int __devexit sh_wdt_remove(struct platform_device *pdev) | 301 | static int sh_wdt_remove(struct platform_device *pdev) |
| 302 | { | 302 | { |
| 303 | struct sh_wdt *wdt = platform_get_drvdata(pdev); | 303 | struct sh_wdt *wdt = platform_get_drvdata(pdev); |
| 304 | 304 | ||
| @@ -324,7 +324,7 @@ static struct platform_driver sh_wdt_driver = { | |||
| 324 | }, | 324 | }, |
| 325 | 325 | ||
| 326 | .probe = sh_wdt_probe, | 326 | .probe = sh_wdt_probe, |
| 327 | .remove = __devexit_p(sh_wdt_remove), | 327 | .remove = sh_wdt_remove, |
| 328 | .shutdown = sh_wdt_shutdown, | 328 | .shutdown = sh_wdt_shutdown, |
| 329 | }; | 329 | }; |
| 330 | 330 | ||
diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index ae5e82cb83fa..2b0e000d4377 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c | |||
| @@ -13,7 +13,9 @@ | |||
| 13 | * as published by the Free Software Foundation; either version | 13 | * as published by the Free Software Foundation; either version |
| 14 | * 2 of the License, or (at your option) any later version. | 14 | * 2 of the License, or (at your option) any later version. |
| 15 | * | 15 | * |
| 16 | * See AMD Publication 43009 "AMD SB700/710/750 Register Reference Guide" | 16 | * See AMD Publication 43009 "AMD SB700/710/750 Register Reference Guide", |
| 17 | * AMD Publication 45482 "AMD SB800-Series Southbridges Register | ||
| 18 | * Reference Guide" | ||
| 17 | */ | 19 | */ |
| 18 | 20 | ||
| 19 | /* | 21 | /* |
| @@ -38,18 +40,24 @@ | |||
| 38 | #include "sp5100_tco.h" | 40 | #include "sp5100_tco.h" |
| 39 | 41 | ||
| 40 | /* Module and version information */ | 42 | /* Module and version information */ |
| 41 | #define TCO_VERSION "0.01" | 43 | #define TCO_VERSION "0.03" |
| 42 | #define TCO_MODULE_NAME "SP5100 TCO timer" | 44 | #define TCO_MODULE_NAME "SP5100 TCO timer" |
| 43 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION | 45 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION |
| 44 | 46 | ||
| 45 | /* internal variables */ | 47 | /* internal variables */ |
| 46 | static u32 tcobase_phys; | 48 | static u32 tcobase_phys; |
| 49 | static u32 resbase_phys; | ||
| 50 | static u32 tco_wdt_fired; | ||
| 47 | static void __iomem *tcobase; | 51 | static void __iomem *tcobase; |
| 48 | static unsigned int pm_iobase; | 52 | static unsigned int pm_iobase; |
| 49 | static DEFINE_SPINLOCK(tco_lock); /* Guards the hardware */ | 53 | static DEFINE_SPINLOCK(tco_lock); /* Guards the hardware */ |
| 50 | static unsigned long timer_alive; | 54 | static unsigned long timer_alive; |
| 51 | static char tco_expect_close; | 55 | static char tco_expect_close; |
| 52 | static struct pci_dev *sp5100_tco_pci; | 56 | static struct pci_dev *sp5100_tco_pci; |
| 57 | static struct resource wdt_res = { | ||
| 58 | .name = "Watchdog Timer", | ||
| 59 | .flags = IORESOURCE_MEM, | ||
| 60 | }; | ||
| 53 | 61 | ||
| 54 | /* the watchdog platform device */ | 62 | /* the watchdog platform device */ |
| 55 | static struct platform_device *sp5100_tco_platform_device; | 63 | static struct platform_device *sp5100_tco_platform_device; |
| @@ -64,9 +72,15 @@ MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (default=" | |||
| 64 | 72 | ||
| 65 | static bool nowayout = WATCHDOG_NOWAYOUT; | 73 | static bool nowayout = WATCHDOG_NOWAYOUT; |
| 66 | module_param(nowayout, bool, 0); | 74 | module_param(nowayout, bool, 0); |
| 67 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started" | 75 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started." |
| 68 | " (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); | 76 | " (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); |
| 69 | 77 | ||
| 78 | static unsigned int force_addr; | ||
| 79 | module_param(force_addr, uint, 0); | ||
| 80 | MODULE_PARM_DESC(force_addr, "Force the use of specified MMIO address." | ||
| 81 | " ONLY USE THIS PARAMETER IF YOU REALLY KNOW" | ||
| 82 | " WHAT YOU ARE DOING (default=none)"); | ||
| 83 | |||
| 70 | /* | 84 | /* |
| 71 | * Some TCO specific functions | 85 | * Some TCO specific functions |
| 72 | */ | 86 | */ |
| @@ -122,6 +136,79 @@ static int tco_timer_set_heartbeat(int t) | |||
| 122 | return 0; | 136 | return 0; |
| 123 | } | 137 | } |
| 124 | 138 | ||
| 139 | static void tco_timer_enable(void) | ||
| 140 | { | ||
| 141 | int val; | ||
| 142 | |||
| 143 | if (sp5100_tco_pci->revision >= 0x40) { | ||
| 144 | /* For SB800 or later */ | ||
| 145 | /* Set the Watchdog timer resolution to 1 sec */ | ||
| 146 | outb(SB800_PM_WATCHDOG_CONFIG, SB800_IO_PM_INDEX_REG); | ||
| 147 | val = inb(SB800_IO_PM_DATA_REG); | ||
| 148 | val |= SB800_PM_WATCHDOG_SECOND_RES; | ||
| 149 | outb(val, SB800_IO_PM_DATA_REG); | ||
| 150 | |||
| 151 | /* Enable watchdog decode bit and watchdog timer */ | ||
| 152 | outb(SB800_PM_WATCHDOG_CONTROL, SB800_IO_PM_INDEX_REG); | ||
| 153 | val = inb(SB800_IO_PM_DATA_REG); | ||
| 154 | val |= SB800_PCI_WATCHDOG_DECODE_EN; | ||
| 155 | val &= ~SB800_PM_WATCHDOG_DISABLE; | ||
| 156 | outb(val, SB800_IO_PM_DATA_REG); | ||
| 157 | } else { | ||
| 158 | /* For SP5100 or SB7x0 */ | ||
| 159 | /* Enable watchdog decode bit */ | ||
| 160 | pci_read_config_dword(sp5100_tco_pci, | ||
| 161 | SP5100_PCI_WATCHDOG_MISC_REG, | ||
| 162 | &val); | ||
| 163 | |||
| 164 | val |= SP5100_PCI_WATCHDOG_DECODE_EN; | ||
| 165 | |||
| 166 | pci_write_config_dword(sp5100_tco_pci, | ||
| 167 | SP5100_PCI_WATCHDOG_MISC_REG, | ||
| 168 | val); | ||
| 169 | |||
| 170 | /* Enable Watchdog timer and set the resolution to 1 sec */ | ||
| 171 | outb(SP5100_PM_WATCHDOG_CONTROL, SP5100_IO_PM_INDEX_REG); | ||
| 172 | val = inb(SP5100_IO_PM_DATA_REG); | ||
| 173 | val |= SP5100_PM_WATCHDOG_SECOND_RES; | ||
| 174 | val &= ~SP5100_PM_WATCHDOG_DISABLE; | ||
| 175 | outb(val, SP5100_IO_PM_DATA_REG); | ||
| 176 | } | ||
| 177 | } | ||
| 178 | |||
| 179 | static void tco_timer_disable(void) | ||
| 180 | { | ||
| 181 | int val; | ||
| 182 | |||
| 183 | if (sp5100_tco_pci->revision >= 0x40) { | ||
| 184 | /* For SB800 or later */ | ||
| 185 | /* Enable watchdog decode bit and Disable watchdog timer */ | ||
| 186 | outb(SB800_PM_WATCHDOG_CONTROL, SB800_IO_PM_INDEX_REG); | ||
| 187 | val = inb(SB800_IO_PM_DATA_REG); | ||
| 188 | val |= SB800_PCI_WATCHDOG_DECODE_EN; | ||
| 189 | val |= SB800_PM_WATCHDOG_DISABLE; | ||
| 190 | outb(val, SB800_IO_PM_DATA_REG); | ||
| 191 | } else { | ||
| 192 | /* For SP5100 or SB7x0 */ | ||
| 193 | /* Enable watchdog decode bit */ | ||
| 194 | pci_read_config_dword(sp5100_tco_pci, | ||
| 195 | SP5100_PCI_WATCHDOG_MISC_REG, | ||
| 196 | &val); | ||
| 197 | |||
| 198 | val |= SP5100_PCI_WATCHDOG_DECODE_EN; | ||
| 199 | |||
| 200 | pci_write_config_dword(sp5100_tco_pci, | ||
| 201 | SP5100_PCI_WATCHDOG_MISC_REG, | ||
| 202 | val); | ||
| 203 | |||
| 204 | /* Disable Watchdog timer */ | ||
| 205 | outb(SP5100_PM_WATCHDOG_CONTROL, SP5100_IO_PM_INDEX_REG); | ||
| 206 | val = inb(SP5100_IO_PM_DATA_REG); | ||
| 207 | val |= SP5100_PM_WATCHDOG_DISABLE; | ||
| 208 | outb(val, SP5100_IO_PM_DATA_REG); | ||
| 209 | } | ||
| 210 | } | ||
| 211 | |||
| 125 | /* | 212 | /* |
| 126 | * /dev/watchdog handling | 213 | * /dev/watchdog handling |
| 127 | */ | 214 | */ |
| @@ -270,11 +357,12 @@ MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl); | |||
| 270 | /* | 357 | /* |
| 271 | * Init & exit routines | 358 | * Init & exit routines |
| 272 | */ | 359 | */ |
| 273 | 360 | static unsigned char sp5100_tco_setupdevice(void) | |
| 274 | static unsigned char __devinit sp5100_tco_setupdevice(void) | ||
| 275 | { | 361 | { |
| 276 | struct pci_dev *dev = NULL; | 362 | struct pci_dev *dev = NULL; |
| 363 | const char *dev_name = NULL; | ||
| 277 | u32 val; | 364 | u32 val; |
| 365 | u32 index_reg, data_reg, base_addr; | ||
| 278 | 366 | ||
| 279 | /* Match the PCI device */ | 367 | /* Match the PCI device */ |
| 280 | for_each_pci_dev(dev) { | 368 | for_each_pci_dev(dev) { |
| @@ -287,29 +375,160 @@ static unsigned char __devinit sp5100_tco_setupdevice(void) | |||
| 287 | if (!sp5100_tco_pci) | 375 | if (!sp5100_tco_pci) |
| 288 | return 0; | 376 | return 0; |
| 289 | 377 | ||
| 378 | pr_info("PCI Revision ID: 0x%x\n", sp5100_tco_pci->revision); | ||
| 379 | |||
| 380 | /* | ||
| 381 | * Determine type of southbridge chipset. | ||
| 382 | */ | ||
| 383 | if (sp5100_tco_pci->revision >= 0x40) { | ||
| 384 | dev_name = SB800_DEVNAME; | ||
| 385 | index_reg = SB800_IO_PM_INDEX_REG; | ||
| 386 | data_reg = SB800_IO_PM_DATA_REG; | ||
| 387 | base_addr = SB800_PM_WATCHDOG_BASE; | ||
| 388 | } else { | ||
| 389 | dev_name = SP5100_DEVNAME; | ||
| 390 | index_reg = SP5100_IO_PM_INDEX_REG; | ||
| 391 | data_reg = SP5100_IO_PM_DATA_REG; | ||
| 392 | base_addr = SP5100_PM_WATCHDOG_BASE; | ||
| 393 | } | ||
| 394 | |||
| 290 | /* Request the IO ports used by this driver */ | 395 | /* Request the IO ports used by this driver */ |
| 291 | pm_iobase = SP5100_IO_PM_INDEX_REG; | 396 | pm_iobase = SP5100_IO_PM_INDEX_REG; |
| 292 | if (!request_region(pm_iobase, SP5100_PM_IOPORTS_SIZE, "SP5100 TCO")) { | 397 | if (!request_region(pm_iobase, SP5100_PM_IOPORTS_SIZE, dev_name)) { |
| 293 | pr_err("I/O address 0x%04x already in use\n", pm_iobase); | 398 | pr_err("I/O address 0x%04x already in use\n", pm_iobase); |
| 294 | goto exit; | 399 | goto exit; |
| 295 | } | 400 | } |
| 296 | 401 | ||
| 297 | /* Find the watchdog base address. */ | 402 | /* |
| 298 | outb(SP5100_PM_WATCHDOG_BASE3, SP5100_IO_PM_INDEX_REG); | 403 | * First, Find the watchdog timer MMIO address from indirect I/O. |
| 299 | val = inb(SP5100_IO_PM_DATA_REG); | 404 | */ |
| 300 | outb(SP5100_PM_WATCHDOG_BASE2, SP5100_IO_PM_INDEX_REG); | 405 | outb(base_addr+3, index_reg); |
| 301 | val = val << 8 | inb(SP5100_IO_PM_DATA_REG); | 406 | val = inb(data_reg); |
| 302 | outb(SP5100_PM_WATCHDOG_BASE1, SP5100_IO_PM_INDEX_REG); | 407 | outb(base_addr+2, index_reg); |
| 303 | val = val << 8 | inb(SP5100_IO_PM_DATA_REG); | 408 | val = val << 8 | inb(data_reg); |
| 304 | outb(SP5100_PM_WATCHDOG_BASE0, SP5100_IO_PM_INDEX_REG); | 409 | outb(base_addr+1, index_reg); |
| 305 | /* Low three bits of BASE0 are reserved. */ | 410 | val = val << 8 | inb(data_reg); |
| 306 | val = val << 8 | (inb(SP5100_IO_PM_DATA_REG) & 0xf8); | 411 | outb(base_addr+0, index_reg); |
| 412 | /* Low three bits of BASE are reserved */ | ||
| 413 | val = val << 8 | (inb(data_reg) & 0xf8); | ||
| 414 | |||
| 415 | pr_debug("Got 0x%04x from indirect I/O\n", val); | ||
| 416 | |||
| 417 | /* Check MMIO address conflict */ | ||
| 418 | if (request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, | ||
| 419 | dev_name)) | ||
| 420 | goto setup_wdt; | ||
| 421 | else | ||
| 422 | pr_debug("MMIO address 0x%04x already in use\n", val); | ||
| 423 | |||
| 424 | /* | ||
| 425 | * Secondly, Find the watchdog timer MMIO address | ||
| 426 | * from SBResource_MMIO register. | ||
| 427 | */ | ||
| 428 | if (sp5100_tco_pci->revision >= 0x40) { | ||
| 429 | /* Read SBResource_MMIO from AcpiMmioEn(PM_Reg: 24h) */ | ||
| 430 | outb(SB800_PM_ACPI_MMIO_EN+3, SB800_IO_PM_INDEX_REG); | ||
| 431 | val = inb(SB800_IO_PM_DATA_REG); | ||
| 432 | outb(SB800_PM_ACPI_MMIO_EN+2, SB800_IO_PM_INDEX_REG); | ||
| 433 | val = val << 8 | inb(SB800_IO_PM_DATA_REG); | ||
| 434 | outb(SB800_PM_ACPI_MMIO_EN+1, SB800_IO_PM_INDEX_REG); | ||
| 435 | val = val << 8 | inb(SB800_IO_PM_DATA_REG); | ||
| 436 | outb(SB800_PM_ACPI_MMIO_EN+0, SB800_IO_PM_INDEX_REG); | ||
| 437 | val = val << 8 | inb(SB800_IO_PM_DATA_REG); | ||
| 438 | } else { | ||
| 439 | /* Read SBResource_MMIO from PCI config(PCI_Reg: 9Ch) */ | ||
| 440 | pci_read_config_dword(sp5100_tco_pci, | ||
| 441 | SP5100_SB_RESOURCE_MMIO_BASE, &val); | ||
| 442 | } | ||
| 443 | |||
| 444 | /* The SBResource_MMIO is enabled and mapped memory space? */ | ||
| 445 | if ((val & (SB800_ACPI_MMIO_DECODE_EN | SB800_ACPI_MMIO_SEL)) == | ||
| 446 | SB800_ACPI_MMIO_DECODE_EN) { | ||
| 447 | /* Clear unnecessary the low twelve bits */ | ||
| 448 | val &= ~0xFFF; | ||
| 449 | /* Add the Watchdog Timer offset to base address. */ | ||
| 450 | val += SB800_PM_WDT_MMIO_OFFSET; | ||
| 451 | /* Check MMIO address conflict */ | ||
| 452 | if (request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, | ||
| 453 | dev_name)) { | ||
| 454 | pr_debug("Got 0x%04x from SBResource_MMIO register\n", | ||
| 455 | val); | ||
| 456 | goto setup_wdt; | ||
| 457 | } else | ||
| 458 | pr_debug("MMIO address 0x%04x already in use\n", val); | ||
| 459 | } else | ||
| 460 | pr_debug("SBResource_MMIO is disabled(0x%04x)\n", val); | ||
| 461 | |||
| 462 | /* | ||
| 463 | * Lastly re-programming the watchdog timer MMIO address, | ||
| 464 | * This method is a last resort... | ||
| 465 | * | ||
| 466 | * Before re-programming, to ensure that the watchdog timer | ||
| 467 | * is disabled, disable the watchdog timer. | ||
| 468 | */ | ||
| 469 | tco_timer_disable(); | ||
| 470 | |||
| 471 | if (force_addr) { | ||
| 472 | /* | ||
| 473 | * Force the use of watchdog timer MMIO address, and aligned to | ||
| 474 | * 8byte boundary. | ||
| 475 | */ | ||
| 476 | force_addr &= ~0x7; | ||
| 477 | val = force_addr; | ||
| 478 | |||
| 479 | pr_info("Force the use of 0x%04x as MMIO address\n", val); | ||
| 480 | } else { | ||
| 481 | /* | ||
| 482 | * Get empty slot into the resource tree for watchdog timer. | ||
| 483 | */ | ||
| 484 | if (allocate_resource(&iomem_resource, | ||
| 485 | &wdt_res, | ||
| 486 | SP5100_WDT_MEM_MAP_SIZE, | ||
| 487 | 0xf0000000, | ||
| 488 | 0xfffffff8, | ||
| 489 | 0x8, | ||
| 490 | NULL, | ||
| 491 | NULL)) { | ||
| 492 | pr_err("MMIO allocation failed\n"); | ||
| 493 | goto unreg_region; | ||
| 494 | } | ||
| 495 | |||
| 496 | val = resbase_phys = wdt_res.start; | ||
| 497 | pr_debug("Got 0x%04x from resource tree\n", val); | ||
| 498 | } | ||
| 499 | |||
| 500 | /* Restore to the low three bits, if chipset is SB8x0(or later) */ | ||
| 501 | if (sp5100_tco_pci->revision >= 0x40) { | ||
| 502 | u8 reserved_bit; | ||
| 503 | reserved_bit = inb(base_addr) & 0x7; | ||
| 504 | val |= (u32)reserved_bit; | ||
| 505 | } | ||
| 506 | |||
| 507 | /* Re-programming the watchdog timer base address */ | ||
| 508 | outb(base_addr+0, index_reg); | ||
| 509 | /* Low three bits of BASE are reserved */ | ||
| 510 | outb((val >> 0) & 0xf8, data_reg); | ||
| 511 | outb(base_addr+1, index_reg); | ||
| 512 | outb((val >> 8) & 0xff, data_reg); | ||
| 513 | outb(base_addr+2, index_reg); | ||
| 514 | outb((val >> 16) & 0xff, data_reg); | ||
| 515 | outb(base_addr+3, index_reg); | ||
| 516 | outb((val >> 24) & 0xff, data_reg); | ||
| 517 | |||
| 518 | /* | ||
| 519 | * Clear unnecessary the low three bits, | ||
| 520 | * if chipset is SB8x0(or later) | ||
| 521 | */ | ||
| 522 | if (sp5100_tco_pci->revision >= 0x40) | ||
| 523 | val &= ~0x7; | ||
| 307 | 524 | ||
| 308 | if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, | 525 | if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, |
| 309 | "SP5100 TCO")) { | 526 | dev_name)) { |
| 310 | pr_err("mmio address 0x%04x already in use\n", val); | 527 | pr_err("MMIO address 0x%04x already in use\n", val); |
| 311 | goto unreg_region; | 528 | goto unreg_resource; |
| 312 | } | 529 | } |
| 530 | |||
| 531 | setup_wdt: | ||
| 313 | tcobase_phys = val; | 532 | tcobase_phys = val; |
| 314 | 533 | ||
| 315 | tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE); | 534 | tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE); |
| @@ -318,26 +537,18 @@ static unsigned char __devinit sp5100_tco_setupdevice(void) | |||
| 318 | goto unreg_mem_region; | 537 | goto unreg_mem_region; |
| 319 | } | 538 | } |
| 320 | 539 | ||
| 321 | /* Enable watchdog decode bit */ | 540 | pr_info("Using 0x%04x for watchdog MMIO address\n", val); |
| 322 | pci_read_config_dword(sp5100_tco_pci, | ||
| 323 | SP5100_PCI_WATCHDOG_MISC_REG, | ||
| 324 | &val); | ||
| 325 | |||
| 326 | val |= SP5100_PCI_WATCHDOG_DECODE_EN; | ||
| 327 | 541 | ||
| 328 | pci_write_config_dword(sp5100_tco_pci, | 542 | /* Setup the watchdog timer */ |
| 329 | SP5100_PCI_WATCHDOG_MISC_REG, | 543 | tco_timer_enable(); |
| 330 | val); | ||
| 331 | 544 | ||
| 332 | /* Enable Watchdog timer and set the resolution to 1 sec. */ | 545 | /* Check that the watchdog action is set to reset the system */ |
| 333 | outb(SP5100_PM_WATCHDOG_CONTROL, SP5100_IO_PM_INDEX_REG); | ||
| 334 | val = inb(SP5100_IO_PM_DATA_REG); | ||
| 335 | val |= SP5100_PM_WATCHDOG_SECOND_RES; | ||
| 336 | val &= ~SP5100_PM_WATCHDOG_DISABLE; | ||
| 337 | outb(val, SP5100_IO_PM_DATA_REG); | ||
| 338 | |||
| 339 | /* Check that the watchdog action is set to reset the system. */ | ||
| 340 | val = readl(SP5100_WDT_CONTROL(tcobase)); | 546 | val = readl(SP5100_WDT_CONTROL(tcobase)); |
| 547 | /* | ||
| 548 | * Save WatchDogFired status, because WatchDogFired flag is | ||
| 549 | * cleared here. | ||
| 550 | */ | ||
| 551 | tco_wdt_fired = val & SP5100_PM_WATCHDOG_FIRED; | ||
| 341 | val &= ~SP5100_PM_WATCHDOG_ACTION_RESET; | 552 | val &= ~SP5100_PM_WATCHDOG_ACTION_RESET; |
| 342 | writel(val, SP5100_WDT_CONTROL(tcobase)); | 553 | writel(val, SP5100_WDT_CONTROL(tcobase)); |
| 343 | 554 | ||
| @@ -355,32 +566,30 @@ static unsigned char __devinit sp5100_tco_setupdevice(void) | |||
| 355 | 566 | ||
| 356 | unreg_mem_region: | 567 | unreg_mem_region: |
| 357 | release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE); | 568 | release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE); |
| 569 | unreg_resource: | ||
| 570 | if (resbase_phys) | ||
| 571 | release_resource(&wdt_res); | ||
| 358 | unreg_region: | 572 | unreg_region: |
| 359 | release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE); | 573 | release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE); |
| 360 | exit: | 574 | exit: |
| 361 | return 0; | 575 | return 0; |
| 362 | } | 576 | } |
| 363 | 577 | ||
| 364 | static int __devinit sp5100_tco_init(struct platform_device *dev) | 578 | static int sp5100_tco_init(struct platform_device *dev) |
| 365 | { | 579 | { |
| 366 | int ret; | 580 | int ret; |
| 367 | u32 val; | 581 | char addr_str[16]; |
| 368 | 582 | ||
| 369 | /* Check whether or not the hardware watchdog is there. If found, then | 583 | /* |
| 584 | * Check whether or not the hardware watchdog is there. If found, then | ||
| 370 | * set it up. | 585 | * set it up. |
| 371 | */ | 586 | */ |
| 372 | if (!sp5100_tco_setupdevice()) | 587 | if (!sp5100_tco_setupdevice()) |
| 373 | return -ENODEV; | 588 | return -ENODEV; |
| 374 | 589 | ||
| 375 | /* Check to see if last reboot was due to watchdog timeout */ | 590 | /* Check to see if last reboot was due to watchdog timeout */ |
| 376 | pr_info("Watchdog reboot %sdetected\n", | 591 | pr_info("Last reboot was %striggered by watchdog.\n", |
| 377 | readl(SP5100_WDT_CONTROL(tcobase)) & SP5100_PM_WATCHDOG_FIRED ? | 592 | tco_wdt_fired ? "" : "not "); |
| 378 | "" : "not "); | ||
| 379 | |||
| 380 | /* Clear out the old status */ | ||
| 381 | val = readl(SP5100_WDT_CONTROL(tcobase)); | ||
| 382 | val &= ~SP5100_PM_WATCHDOG_FIRED; | ||
| 383 | writel(val, SP5100_WDT_CONTROL(tcobase)); | ||
| 384 | 593 | ||
| 385 | /* | 594 | /* |
| 386 | * Check that the heartbeat value is within it's range. | 595 | * Check that the heartbeat value is within it's range. |
| @@ -400,19 +609,29 @@ static int __devinit sp5100_tco_init(struct platform_device *dev) | |||
| 400 | 609 | ||
| 401 | clear_bit(0, &timer_alive); | 610 | clear_bit(0, &timer_alive); |
| 402 | 611 | ||
| 403 | pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", | 612 | /* Show module parameters */ |
| 404 | tcobase, heartbeat, nowayout); | 613 | if (force_addr == tcobase_phys) |
| 614 | /* The force_addr is vaild */ | ||
| 615 | sprintf(addr_str, "0x%04x", force_addr); | ||
| 616 | else | ||
| 617 | strcpy(addr_str, "none"); | ||
| 618 | |||
| 619 | pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d, " | ||
| 620 | "force_addr=%s)\n", | ||
| 621 | tcobase, heartbeat, nowayout, addr_str); | ||
| 405 | 622 | ||
| 406 | return 0; | 623 | return 0; |
| 407 | 624 | ||
| 408 | exit: | 625 | exit: |
| 409 | iounmap(tcobase); | 626 | iounmap(tcobase); |
| 410 | release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE); | 627 | release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE); |
| 628 | if (resbase_phys) | ||
| 629 | release_resource(&wdt_res); | ||
| 411 | release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE); | 630 | release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE); |
| 412 | return ret; | 631 | return ret; |
| 413 | } | 632 | } |
| 414 | 633 | ||
| 415 | static void __devexit sp5100_tco_cleanup(void) | 634 | static void sp5100_tco_cleanup(void) |
| 416 | { | 635 | { |
| 417 | /* Stop the timer before we leave */ | 636 | /* Stop the timer before we leave */ |
| 418 | if (!nowayout) | 637 | if (!nowayout) |
| @@ -422,10 +641,12 @@ static void __devexit sp5100_tco_cleanup(void) | |||
| 422 | misc_deregister(&sp5100_tco_miscdev); | 641 | misc_deregister(&sp5100_tco_miscdev); |
| 423 | iounmap(tcobase); | 642 | iounmap(tcobase); |
| 424 | release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE); | 643 | release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE); |
| 644 | if (resbase_phys) | ||
| 645 | release_resource(&wdt_res); | ||
| 425 | release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE); | 646 | release_region(pm_iobase, SP5100_PM_IOPORTS_SIZE); |
| 426 | } | 647 | } |
| 427 | 648 | ||
| 428 | static int __devexit sp5100_tco_remove(struct platform_device *dev) | 649 | static int sp5100_tco_remove(struct platform_device *dev) |
| 429 | { | 650 | { |
| 430 | if (tcobase) | 651 | if (tcobase) |
| 431 | sp5100_tco_cleanup(); | 652 | sp5100_tco_cleanup(); |
| @@ -439,7 +660,7 @@ static void sp5100_tco_shutdown(struct platform_device *dev) | |||
| 439 | 660 | ||
| 440 | static struct platform_driver sp5100_tco_driver = { | 661 | static struct platform_driver sp5100_tco_driver = { |
| 441 | .probe = sp5100_tco_init, | 662 | .probe = sp5100_tco_init, |
| 442 | .remove = __devexit_p(sp5100_tco_remove), | 663 | .remove = sp5100_tco_remove, |
| 443 | .shutdown = sp5100_tco_shutdown, | 664 | .shutdown = sp5100_tco_shutdown, |
| 444 | .driver = { | 665 | .driver = { |
| 445 | .owner = THIS_MODULE, | 666 | .owner = THIS_MODULE, |
| @@ -451,7 +672,7 @@ static int __init sp5100_tco_init_module(void) | |||
| 451 | { | 672 | { |
| 452 | int err; | 673 | int err; |
| 453 | 674 | ||
| 454 | pr_info("SP5100 TCO WatchDog Timer Driver v%s\n", TCO_VERSION); | 675 | pr_info("SP5100/SB800 TCO WatchDog Timer Driver v%s\n", TCO_VERSION); |
| 455 | 676 | ||
| 456 | err = platform_driver_register(&sp5100_tco_driver); | 677 | err = platform_driver_register(&sp5100_tco_driver); |
| 457 | if (err) | 678 | if (err) |
| @@ -475,13 +696,13 @@ static void __exit sp5100_tco_cleanup_module(void) | |||
| 475 | { | 696 | { |
| 476 | platform_device_unregister(sp5100_tco_platform_device); | 697 | platform_device_unregister(sp5100_tco_platform_device); |
| 477 | platform_driver_unregister(&sp5100_tco_driver); | 698 | platform_driver_unregister(&sp5100_tco_driver); |
| 478 | pr_info("SP5100 TCO Watchdog Module Unloaded\n"); | 699 | pr_info("SP5100/SB800 TCO Watchdog Module Unloaded\n"); |
| 479 | } | 700 | } |
| 480 | 701 | ||
| 481 | module_init(sp5100_tco_init_module); | 702 | module_init(sp5100_tco_init_module); |
| 482 | module_exit(sp5100_tco_cleanup_module); | 703 | module_exit(sp5100_tco_cleanup_module); |
| 483 | 704 | ||
| 484 | MODULE_AUTHOR("Priyanka Gupta"); | 705 | MODULE_AUTHOR("Priyanka Gupta"); |
| 485 | MODULE_DESCRIPTION("TCO timer driver for SP5100 chipset"); | 706 | MODULE_DESCRIPTION("TCO timer driver for SP5100/SB800 chipset"); |
| 486 | MODULE_LICENSE("GPL"); | 707 | MODULE_LICENSE("GPL"); |
| 487 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 708 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
diff --git a/drivers/watchdog/sp5100_tco.h b/drivers/watchdog/sp5100_tco.h index a5a16cc90a34..71594a0c14b7 100644 --- a/drivers/watchdog/sp5100_tco.h +++ b/drivers/watchdog/sp5100_tco.h | |||
| @@ -9,33 +9,57 @@ | |||
| 9 | /* | 9 | /* |
| 10 | * Some address definitions for the Watchdog | 10 | * Some address definitions for the Watchdog |
| 11 | */ | 11 | */ |
| 12 | |||
| 13 | #define SP5100_WDT_MEM_MAP_SIZE 0x08 | 12 | #define SP5100_WDT_MEM_MAP_SIZE 0x08 |
| 14 | #define SP5100_WDT_CONTROL(base) ((base) + 0x00) /* Watchdog Control */ | 13 | #define SP5100_WDT_CONTROL(base) ((base) + 0x00) /* Watchdog Control */ |
| 15 | #define SP5100_WDT_COUNT(base) ((base) + 0x04) /* Watchdog Count */ | 14 | #define SP5100_WDT_COUNT(base) ((base) + 0x04) /* Watchdog Count */ |
| 16 | 15 | ||
| 17 | #define SP5100_WDT_START_STOP_BIT 1 | 16 | #define SP5100_WDT_START_STOP_BIT (1 << 0) |
| 18 | #define SP5100_WDT_TRIGGER_BIT (1 << 7) | 17 | #define SP5100_WDT_TRIGGER_BIT (1 << 7) |
| 19 | 18 | ||
| 20 | #define SP5100_PCI_WATCHDOG_MISC_REG 0x41 | ||
| 21 | #define SP5100_PCI_WATCHDOG_DECODE_EN (1 << 3) | ||
| 22 | |||
| 23 | #define SP5100_PM_IOPORTS_SIZE 0x02 | 19 | #define SP5100_PM_IOPORTS_SIZE 0x02 |
| 24 | 20 | ||
| 25 | /* These two IO registers are hardcoded and there doesn't seem to be a way to | 21 | /* |
| 22 | * These two IO registers are hardcoded and there doesn't seem to be a way to | ||
| 26 | * read them from a register. | 23 | * read them from a register. |
| 27 | */ | 24 | */ |
| 25 | |||
| 26 | /* For SP5100/SB7x0 chipset */ | ||
| 28 | #define SP5100_IO_PM_INDEX_REG 0xCD6 | 27 | #define SP5100_IO_PM_INDEX_REG 0xCD6 |
| 29 | #define SP5100_IO_PM_DATA_REG 0xCD7 | 28 | #define SP5100_IO_PM_DATA_REG 0xCD7 |
| 30 | 29 | ||
| 30 | #define SP5100_SB_RESOURCE_MMIO_BASE 0x9C | ||
| 31 | |||
| 31 | #define SP5100_PM_WATCHDOG_CONTROL 0x69 | 32 | #define SP5100_PM_WATCHDOG_CONTROL 0x69 |
| 32 | #define SP5100_PM_WATCHDOG_BASE0 0x6C | 33 | #define SP5100_PM_WATCHDOG_BASE 0x6C |
| 33 | #define SP5100_PM_WATCHDOG_BASE1 0x6D | ||
| 34 | #define SP5100_PM_WATCHDOG_BASE2 0x6E | ||
| 35 | #define SP5100_PM_WATCHDOG_BASE3 0x6F | ||
| 36 | 34 | ||
| 37 | #define SP5100_PM_WATCHDOG_FIRED (1 << 1) | 35 | #define SP5100_PM_WATCHDOG_FIRED (1 << 1) |
| 38 | #define SP5100_PM_WATCHDOG_ACTION_RESET (1 << 2) | 36 | #define SP5100_PM_WATCHDOG_ACTION_RESET (1 << 2) |
| 39 | 37 | ||
| 40 | #define SP5100_PM_WATCHDOG_DISABLE 1 | 38 | #define SP5100_PCI_WATCHDOG_MISC_REG 0x41 |
| 39 | #define SP5100_PCI_WATCHDOG_DECODE_EN (1 << 3) | ||
| 40 | |||
| 41 | #define SP5100_PM_WATCHDOG_DISABLE (1 << 0) | ||
| 41 | #define SP5100_PM_WATCHDOG_SECOND_RES (3 << 1) | 42 | #define SP5100_PM_WATCHDOG_SECOND_RES (3 << 1) |
| 43 | |||
| 44 | #define SP5100_DEVNAME "SP5100 TCO" | ||
| 45 | |||
| 46 | |||
| 47 | /* For SB8x0(or later) chipset */ | ||
| 48 | #define SB800_IO_PM_INDEX_REG 0xCD6 | ||
| 49 | #define SB800_IO_PM_DATA_REG 0xCD7 | ||
| 50 | |||
| 51 | #define SB800_PM_ACPI_MMIO_EN 0x24 | ||
| 52 | #define SB800_PM_WATCHDOG_CONTROL 0x48 | ||
| 53 | #define SB800_PM_WATCHDOG_BASE 0x48 | ||
| 54 | #define SB800_PM_WATCHDOG_CONFIG 0x4C | ||
| 55 | |||
| 56 | #define SB800_PCI_WATCHDOG_DECODE_EN (1 << 0) | ||
| 57 | #define SB800_PM_WATCHDOG_DISABLE (1 << 2) | ||
| 58 | #define SB800_PM_WATCHDOG_SECOND_RES (3 << 0) | ||
| 59 | #define SB800_ACPI_MMIO_DECODE_EN (1 << 0) | ||
| 60 | #define SB800_ACPI_MMIO_SEL (1 << 2) | ||
| 61 | |||
| 62 | |||
| 63 | #define SB800_PM_WDT_MMIO_OFFSET 0xB00 | ||
| 64 | |||
| 65 | #define SB800_DEVNAME "SB800 TCO" | ||
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index e4841c36798b..8872642505c0 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c | |||
| @@ -130,16 +130,10 @@ static int wdt_config(struct watchdog_device *wdd, bool ping) | |||
| 130 | int ret; | 130 | int ret; |
| 131 | 131 | ||
| 132 | if (!ping) { | 132 | if (!ping) { |
| 133 | ret = clk_prepare(wdt->clk); | ||
| 134 | if (ret) { | ||
| 135 | dev_err(&wdt->adev->dev, "clock prepare fail"); | ||
| 136 | return ret; | ||
| 137 | } | ||
| 138 | 133 | ||
| 139 | ret = clk_enable(wdt->clk); | 134 | ret = clk_prepare_enable(wdt->clk); |
| 140 | if (ret) { | 135 | if (ret) { |
| 141 | dev_err(&wdt->adev->dev, "clock enable fail"); | 136 | dev_err(&wdt->adev->dev, "clock enable fail"); |
| 142 | clk_unprepare(wdt->clk); | ||
| 143 | return ret; | 137 | return ret; |
| 144 | } | 138 | } |
| 145 | } | 139 | } |
| @@ -190,8 +184,7 @@ static int wdt_disable(struct watchdog_device *wdd) | |||
| 190 | readl_relaxed(wdt->base + WDTLOCK); | 184 | readl_relaxed(wdt->base + WDTLOCK); |
| 191 | spin_unlock(&wdt->lock); | 185 | spin_unlock(&wdt->lock); |
| 192 | 186 | ||
| 193 | clk_disable(wdt->clk); | 187 | clk_disable_unprepare(wdt->clk); |
| 194 | clk_unprepare(wdt->clk); | ||
| 195 | 188 | ||
| 196 | return 0; | 189 | return 0; |
| 197 | } | 190 | } |
| @@ -210,7 +203,7 @@ static const struct watchdog_ops wdt_ops = { | |||
| 210 | .get_timeleft = wdt_timeleft, | 203 | .get_timeleft = wdt_timeleft, |
| 211 | }; | 204 | }; |
| 212 | 205 | ||
| 213 | static int __devinit | 206 | static int |
| 214 | sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) | 207 | sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) |
| 215 | { | 208 | { |
| 216 | struct sp805_wdt *wdt; | 209 | struct sp805_wdt *wdt; |
| @@ -272,7 +265,7 @@ err: | |||
| 272 | return ret; | 265 | return ret; |
| 273 | } | 266 | } |
| 274 | 267 | ||
| 275 | static int __devexit sp805_wdt_remove(struct amba_device *adev) | 268 | static int sp805_wdt_remove(struct amba_device *adev) |
| 276 | { | 269 | { |
| 277 | struct sp805_wdt *wdt = amba_get_drvdata(adev); | 270 | struct sp805_wdt *wdt = amba_get_drvdata(adev); |
| 278 | 271 | ||
| @@ -284,8 +277,7 @@ static int __devexit sp805_wdt_remove(struct amba_device *adev) | |||
| 284 | return 0; | 277 | return 0; |
| 285 | } | 278 | } |
| 286 | 279 | ||
| 287 | #ifdef CONFIG_PM | 280 | static int __maybe_unused sp805_wdt_suspend(struct device *dev) |
| 288 | static int sp805_wdt_suspend(struct device *dev) | ||
| 289 | { | 281 | { |
| 290 | struct sp805_wdt *wdt = dev_get_drvdata(dev); | 282 | struct sp805_wdt *wdt = dev_get_drvdata(dev); |
| 291 | 283 | ||
| @@ -295,7 +287,7 @@ static int sp805_wdt_suspend(struct device *dev) | |||
| 295 | return 0; | 287 | return 0; |
| 296 | } | 288 | } |
| 297 | 289 | ||
| 298 | static int sp805_wdt_resume(struct device *dev) | 290 | static int __maybe_unused sp805_wdt_resume(struct device *dev) |
| 299 | { | 291 | { |
| 300 | struct sp805_wdt *wdt = dev_get_drvdata(dev); | 292 | struct sp805_wdt *wdt = dev_get_drvdata(dev); |
| 301 | 293 | ||
| @@ -304,7 +296,6 @@ static int sp805_wdt_resume(struct device *dev) | |||
| 304 | 296 | ||
| 305 | return 0; | 297 | return 0; |
| 306 | } | 298 | } |
| 307 | #endif /* CONFIG_PM */ | ||
| 308 | 299 | ||
| 309 | static SIMPLE_DEV_PM_OPS(sp805_wdt_dev_pm_ops, sp805_wdt_suspend, | 300 | static SIMPLE_DEV_PM_OPS(sp805_wdt_dev_pm_ops, sp805_wdt_suspend, |
| 310 | sp805_wdt_resume); | 301 | sp805_wdt_resume); |
| @@ -326,7 +317,7 @@ static struct amba_driver sp805_wdt_driver = { | |||
| 326 | }, | 317 | }, |
| 327 | .id_table = sp805_wdt_ids, | 318 | .id_table = sp805_wdt_ids, |
| 328 | .probe = sp805_wdt_probe, | 319 | .probe = sp805_wdt_probe, |
| 329 | .remove = __devexit_p(sp805_wdt_remove), | 320 | .remove = sp805_wdt_remove, |
| 330 | }; | 321 | }; |
| 331 | 322 | ||
| 332 | module_amba_driver(sp805_wdt_driver); | 323 | module_amba_driver(sp805_wdt_driver); |
diff --git a/drivers/watchdog/stmp3xxx_wdt.c b/drivers/watchdog/stmp3xxx_wdt.c index 21d96b92bfd7..1f4f69728fee 100644 --- a/drivers/watchdog/stmp3xxx_wdt.c +++ b/drivers/watchdog/stmp3xxx_wdt.c | |||
| @@ -204,7 +204,7 @@ static struct miscdevice stmp3xxx_wdt_miscdev = { | |||
| 204 | .fops = &stmp3xxx_wdt_fops, | 204 | .fops = &stmp3xxx_wdt_fops, |
| 205 | }; | 205 | }; |
| 206 | 206 | ||
| 207 | static int __devinit stmp3xxx_wdt_probe(struct platform_device *pdev) | 207 | static int stmp3xxx_wdt_probe(struct platform_device *pdev) |
| 208 | { | 208 | { |
| 209 | int ret = 0; | 209 | int ret = 0; |
| 210 | 210 | ||
| @@ -229,7 +229,7 @@ static int __devinit stmp3xxx_wdt_probe(struct platform_device *pdev) | |||
| 229 | return ret; | 229 | return ret; |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | static int __devexit stmp3xxx_wdt_remove(struct platform_device *pdev) | 232 | static int stmp3xxx_wdt_remove(struct platform_device *pdev) |
| 233 | { | 233 | { |
| 234 | misc_deregister(&stmp3xxx_wdt_miscdev); | 234 | misc_deregister(&stmp3xxx_wdt_miscdev); |
| 235 | return 0; | 235 | return 0; |
| @@ -269,7 +269,7 @@ static struct platform_driver platform_wdt_driver = { | |||
| 269 | .name = "stmp3xxx_wdt", | 269 | .name = "stmp3xxx_wdt", |
| 270 | }, | 270 | }, |
| 271 | .probe = stmp3xxx_wdt_probe, | 271 | .probe = stmp3xxx_wdt_probe, |
| 272 | .remove = __devexit_p(stmp3xxx_wdt_remove), | 272 | .remove = stmp3xxx_wdt_remove, |
| 273 | .suspend = stmp3xxx_wdt_suspend, | 273 | .suspend = stmp3xxx_wdt_suspend, |
| 274 | .resume = stmp3xxx_wdt_resume, | 274 | .resume = stmp3xxx_wdt_resume, |
| 275 | }; | 275 | }; |
diff --git a/drivers/watchdog/ts72xx_wdt.c b/drivers/watchdog/ts72xx_wdt.c index 8df050d800e6..b8a92459f10f 100644 --- a/drivers/watchdog/ts72xx_wdt.c +++ b/drivers/watchdog/ts72xx_wdt.c | |||
| @@ -390,7 +390,7 @@ static struct miscdevice ts72xx_wdt_miscdev = { | |||
| 390 | .fops = &ts72xx_wdt_fops, | 390 | .fops = &ts72xx_wdt_fops, |
| 391 | }; | 391 | }; |
| 392 | 392 | ||
| 393 | static __devinit int ts72xx_wdt_probe(struct platform_device *pdev) | 393 | static int ts72xx_wdt_probe(struct platform_device *pdev) |
| 394 | { | 394 | { |
| 395 | struct ts72xx_wdt *wdt; | 395 | struct ts72xx_wdt *wdt; |
| 396 | struct resource *r1, *r2; | 396 | struct resource *r1, *r2; |
| @@ -476,7 +476,7 @@ fail: | |||
| 476 | return error; | 476 | return error; |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | static __devexit int ts72xx_wdt_remove(struct platform_device *pdev) | 479 | static int ts72xx_wdt_remove(struct platform_device *pdev) |
| 480 | { | 480 | { |
| 481 | struct ts72xx_wdt *wdt = platform_get_drvdata(pdev); | 481 | struct ts72xx_wdt *wdt = platform_get_drvdata(pdev); |
| 482 | struct resource *res; | 482 | struct resource *res; |
| @@ -499,7 +499,7 @@ static __devexit int ts72xx_wdt_remove(struct platform_device *pdev) | |||
| 499 | 499 | ||
| 500 | static struct platform_driver ts72xx_wdt_driver = { | 500 | static struct platform_driver ts72xx_wdt_driver = { |
| 501 | .probe = ts72xx_wdt_probe, | 501 | .probe = ts72xx_wdt_probe, |
| 502 | .remove = __devexit_p(ts72xx_wdt_remove), | 502 | .remove = ts72xx_wdt_remove, |
| 503 | .driver = { | 503 | .driver = { |
| 504 | .name = "ts72xx-wdt", | 504 | .name = "ts72xx-wdt", |
| 505 | .owner = THIS_MODULE, | 505 | .owner = THIS_MODULE, |
diff --git a/drivers/watchdog/twl4030_wdt.c b/drivers/watchdog/twl4030_wdt.c index 249f11305d26..0f03106f7516 100644 --- a/drivers/watchdog/twl4030_wdt.c +++ b/drivers/watchdog/twl4030_wdt.c | |||
| @@ -22,26 +22,12 @@ | |||
| 22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| 23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
| 24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
| 25 | #include <linux/fs.h> | ||
| 26 | #include <linux/watchdog.h> | 25 | #include <linux/watchdog.h> |
| 27 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
| 28 | #include <linux/miscdevice.h> | ||
| 29 | #include <linux/uaccess.h> | ||
| 30 | #include <linux/i2c/twl.h> | 27 | #include <linux/i2c/twl.h> |
| 31 | 28 | ||
| 32 | #define TWL4030_WATCHDOG_CFG_REG_OFFS 0x3 | 29 | #define TWL4030_WATCHDOG_CFG_REG_OFFS 0x3 |
| 33 | 30 | ||
| 34 | #define TWL4030_WDT_STATE_OPEN 0x1 | ||
| 35 | #define TWL4030_WDT_STATE_ACTIVE 0x8 | ||
| 36 | |||
| 37 | static struct platform_device *twl4030_wdt_dev; | ||
| 38 | |||
| 39 | struct twl4030_wdt { | ||
| 40 | struct miscdevice miscdev; | ||
| 41 | int timer_margin; | ||
| 42 | unsigned long state; | ||
| 43 | }; | ||
| 44 | |||
| 45 | static bool nowayout = WATCHDOG_NOWAYOUT; | 31 | static bool nowayout = WATCHDOG_NOWAYOUT; |
| 46 | module_param(nowayout, bool, 0); | 32 | module_param(nowayout, bool, 0); |
| 47 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " | 33 | MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " |
| @@ -49,175 +35,75 @@ MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started " | |||
| 49 | 35 | ||
| 50 | static int twl4030_wdt_write(unsigned char val) | 36 | static int twl4030_wdt_write(unsigned char val) |
| 51 | { | 37 | { |
| 52 | return twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, val, | 38 | return twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, val, |
| 53 | TWL4030_WATCHDOG_CFG_REG_OFFS); | 39 | TWL4030_WATCHDOG_CFG_REG_OFFS); |
| 54 | } | 40 | } |
| 55 | 41 | ||
| 56 | static int twl4030_wdt_enable(struct twl4030_wdt *wdt) | 42 | static int twl4030_wdt_start(struct watchdog_device *wdt) |
| 57 | { | 43 | { |
| 58 | return twl4030_wdt_write(wdt->timer_margin + 1); | 44 | return twl4030_wdt_write(wdt->timeout + 1); |
| 59 | } | 45 | } |
| 60 | 46 | ||
| 61 | static int twl4030_wdt_disable(struct twl4030_wdt *wdt) | 47 | static int twl4030_wdt_stop(struct watchdog_device *wdt) |
| 62 | { | 48 | { |
| 63 | return twl4030_wdt_write(0); | 49 | return twl4030_wdt_write(0); |
| 64 | } | 50 | } |
| 65 | 51 | ||
| 66 | static int twl4030_wdt_set_timeout(struct twl4030_wdt *wdt, int timeout) | 52 | static int twl4030_wdt_set_timeout(struct watchdog_device *wdt, |
| 67 | { | 53 | unsigned int timeout) |
| 68 | if (timeout < 0 || timeout > 30) { | ||
| 69 | dev_warn(wdt->miscdev.parent, | ||
| 70 | "Timeout can only be in the range [0-30] seconds"); | ||
| 71 | return -EINVAL; | ||
| 72 | } | ||
| 73 | wdt->timer_margin = timeout; | ||
| 74 | return twl4030_wdt_enable(wdt); | ||
| 75 | } | ||
| 76 | |||
| 77 | static ssize_t twl4030_wdt_write_fop(struct file *file, | ||
| 78 | const char __user *data, size_t len, loff_t *ppos) | ||
| 79 | { | ||
| 80 | struct twl4030_wdt *wdt = file->private_data; | ||
| 81 | |||
| 82 | if (len) | ||
| 83 | twl4030_wdt_enable(wdt); | ||
| 84 | |||
| 85 | return len; | ||
| 86 | } | ||
| 87 | |||
| 88 | static long twl4030_wdt_ioctl(struct file *file, | ||
| 89 | unsigned int cmd, unsigned long arg) | ||
| 90 | { | 54 | { |
| 91 | void __user *argp = (void __user *)arg; | 55 | wdt->timeout = timeout; |
| 92 | int __user *p = argp; | ||
| 93 | int new_margin; | ||
| 94 | struct twl4030_wdt *wdt = file->private_data; | ||
| 95 | |||
| 96 | static const struct watchdog_info twl4030_wd_ident = { | ||
| 97 | .identity = "TWL4030 Watchdog", | ||
| 98 | .options = WDIOF_SETTIMEOUT, | ||
| 99 | .firmware_version = 0, | ||
| 100 | }; | ||
| 101 | |||
| 102 | switch (cmd) { | ||
| 103 | case WDIOC_GETSUPPORT: | ||
| 104 | return copy_to_user(argp, &twl4030_wd_ident, | ||
| 105 | sizeof(twl4030_wd_ident)) ? -EFAULT : 0; | ||
| 106 | |||
| 107 | case WDIOC_GETSTATUS: | ||
| 108 | case WDIOC_GETBOOTSTATUS: | ||
| 109 | return put_user(0, p); | ||
| 110 | |||
| 111 | case WDIOC_KEEPALIVE: | ||
| 112 | twl4030_wdt_enable(wdt); | ||
| 113 | break; | ||
| 114 | |||
| 115 | case WDIOC_SETTIMEOUT: | ||
| 116 | if (get_user(new_margin, p)) | ||
| 117 | return -EFAULT; | ||
| 118 | if (twl4030_wdt_set_timeout(wdt, new_margin)) | ||
| 119 | return -EINVAL; | ||
| 120 | return put_user(wdt->timer_margin, p); | ||
| 121 | |||
| 122 | case WDIOC_GETTIMEOUT: | ||
| 123 | return put_user(wdt->timer_margin, p); | ||
| 124 | |||
| 125 | default: | ||
| 126 | return -ENOTTY; | ||
| 127 | } | ||
| 128 | |||
| 129 | return 0; | 56 | return 0; |
| 130 | } | 57 | } |
| 131 | 58 | ||
| 132 | static int twl4030_wdt_open(struct inode *inode, struct file *file) | 59 | static const struct watchdog_info twl4030_wdt_info = { |
| 133 | { | 60 | .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, |
| 134 | struct twl4030_wdt *wdt = platform_get_drvdata(twl4030_wdt_dev); | 61 | .identity = "TWL4030 Watchdog", |
| 135 | 62 | }; | |
| 136 | /* /dev/watchdog can only be opened once */ | ||
| 137 | if (test_and_set_bit(0, &wdt->state)) | ||
| 138 | return -EBUSY; | ||
| 139 | |||
| 140 | wdt->state |= TWL4030_WDT_STATE_ACTIVE; | ||
| 141 | file->private_data = (void *) wdt; | ||
| 142 | |||
| 143 | twl4030_wdt_enable(wdt); | ||
| 144 | return nonseekable_open(inode, file); | ||
| 145 | } | ||
| 146 | |||
| 147 | static int twl4030_wdt_release(struct inode *inode, struct file *file) | ||
| 148 | { | ||
| 149 | struct twl4030_wdt *wdt = file->private_data; | ||
| 150 | if (nowayout) { | ||
| 151 | dev_alert(wdt->miscdev.parent, | ||
| 152 | "Unexpected close, watchdog still running!\n"); | ||
| 153 | twl4030_wdt_enable(wdt); | ||
| 154 | } else { | ||
| 155 | if (twl4030_wdt_disable(wdt)) | ||
| 156 | return -EFAULT; | ||
| 157 | wdt->state &= ~TWL4030_WDT_STATE_ACTIVE; | ||
| 158 | } | ||
| 159 | |||
| 160 | clear_bit(0, &wdt->state); | ||
| 161 | return 0; | ||
| 162 | } | ||
| 163 | 63 | ||
| 164 | static const struct file_operations twl4030_wdt_fops = { | 64 | static const struct watchdog_ops twl4030_wdt_ops = { |
| 165 | .owner = THIS_MODULE, | 65 | .owner = THIS_MODULE, |
| 166 | .llseek = no_llseek, | 66 | .start = twl4030_wdt_start, |
| 167 | .open = twl4030_wdt_open, | 67 | .stop = twl4030_wdt_stop, |
| 168 | .release = twl4030_wdt_release, | 68 | .set_timeout = twl4030_wdt_set_timeout, |
| 169 | .unlocked_ioctl = twl4030_wdt_ioctl, | ||
| 170 | .write = twl4030_wdt_write_fop, | ||
| 171 | }; | 69 | }; |
| 172 | 70 | ||
| 173 | static int __devinit twl4030_wdt_probe(struct platform_device *pdev) | 71 | static int twl4030_wdt_probe(struct platform_device *pdev) |
| 174 | { | 72 | { |
| 175 | int ret = 0; | 73 | int ret = 0; |
| 176 | struct twl4030_wdt *wdt; | 74 | struct watchdog_device *wdt; |
| 177 | 75 | ||
| 178 | wdt = kzalloc(sizeof(struct twl4030_wdt), GFP_KERNEL); | 76 | wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL); |
| 179 | if (!wdt) | 77 | if (!wdt) |
| 180 | return -ENOMEM; | 78 | return -ENOMEM; |
| 181 | 79 | ||
| 182 | wdt->state = 0; | 80 | wdt->info = &twl4030_wdt_info; |
| 183 | wdt->timer_margin = 30; | 81 | wdt->ops = &twl4030_wdt_ops; |
| 184 | wdt->miscdev.parent = &pdev->dev; | 82 | wdt->status = 0; |
| 185 | wdt->miscdev.fops = &twl4030_wdt_fops; | 83 | wdt->timeout = 30; |
| 186 | wdt->miscdev.minor = WATCHDOG_MINOR; | 84 | wdt->min_timeout = 1; |
| 187 | wdt->miscdev.name = "watchdog"; | 85 | wdt->max_timeout = 30; |
| 188 | 86 | ||
| 87 | watchdog_set_nowayout(wdt, nowayout); | ||
| 189 | platform_set_drvdata(pdev, wdt); | 88 | platform_set_drvdata(pdev, wdt); |
| 190 | 89 | ||
| 191 | twl4030_wdt_dev = pdev; | 90 | twl4030_wdt_stop(wdt); |
| 192 | |||
| 193 | twl4030_wdt_disable(wdt); | ||
| 194 | 91 | ||
| 195 | ret = misc_register(&wdt->miscdev); | 92 | ret = watchdog_register_device(wdt); |
| 196 | if (ret) { | 93 | if (ret) { |
| 197 | dev_err(wdt->miscdev.parent, | ||
| 198 | "Failed to register misc device\n"); | ||
| 199 | platform_set_drvdata(pdev, NULL); | 94 | platform_set_drvdata(pdev, NULL); |
| 200 | kfree(wdt); | ||
| 201 | twl4030_wdt_dev = NULL; | ||
| 202 | return ret; | 95 | return ret; |
| 203 | } | 96 | } |
| 97 | |||
| 204 | return 0; | 98 | return 0; |
| 205 | } | 99 | } |
| 206 | 100 | ||
| 207 | static int __devexit twl4030_wdt_remove(struct platform_device *pdev) | 101 | static int twl4030_wdt_remove(struct platform_device *pdev) |
| 208 | { | 102 | { |
| 209 | struct twl4030_wdt *wdt = platform_get_drvdata(pdev); | 103 | struct watchdog_device *wdt = platform_get_drvdata(pdev); |
| 210 | |||
| 211 | if (wdt->state & TWL4030_WDT_STATE_ACTIVE) | ||
| 212 | if (twl4030_wdt_disable(wdt)) | ||
| 213 | return -EFAULT; | ||
| 214 | |||
| 215 | wdt->state &= ~TWL4030_WDT_STATE_ACTIVE; | ||
| 216 | misc_deregister(&wdt->miscdev); | ||
| 217 | 104 | ||
| 105 | watchdog_unregister_device(wdt); | ||
| 218 | platform_set_drvdata(pdev, NULL); | 106 | platform_set_drvdata(pdev, NULL); |
| 219 | kfree(wdt); | ||
| 220 | twl4030_wdt_dev = NULL; | ||
| 221 | 107 | ||
| 222 | return 0; | 108 | return 0; |
| 223 | } | 109 | } |
| @@ -225,18 +111,18 @@ static int __devexit twl4030_wdt_remove(struct platform_device *pdev) | |||
| 225 | #ifdef CONFIG_PM | 111 | #ifdef CONFIG_PM |
| 226 | static int twl4030_wdt_suspend(struct platform_device *pdev, pm_message_t state) | 112 | static int twl4030_wdt_suspend(struct platform_device *pdev, pm_message_t state) |
| 227 | { | 113 | { |
| 228 | struct twl4030_wdt *wdt = platform_get_drvdata(pdev); | 114 | struct watchdog_device *wdt = platform_get_drvdata(pdev); |
| 229 | if (wdt->state & TWL4030_WDT_STATE_ACTIVE) | 115 | if (watchdog_active(wdt)) |
| 230 | return twl4030_wdt_disable(wdt); | 116 | return twl4030_wdt_stop(wdt); |
| 231 | 117 | ||
| 232 | return 0; | 118 | return 0; |
| 233 | } | 119 | } |
| 234 | 120 | ||
| 235 | static int twl4030_wdt_resume(struct platform_device *pdev) | 121 | static int twl4030_wdt_resume(struct platform_device *pdev) |
| 236 | { | 122 | { |
| 237 | struct twl4030_wdt *wdt = platform_get_drvdata(pdev); | 123 | struct watchdog_device *wdt = platform_get_drvdata(pdev); |
| 238 | if (wdt->state & TWL4030_WDT_STATE_ACTIVE) | 124 | if (watchdog_active(wdt)) |
| 239 | return twl4030_wdt_enable(wdt); | 125 | return twl4030_wdt_start(wdt); |
| 240 | 126 | ||
| 241 | return 0; | 127 | return 0; |
| 242 | } | 128 | } |
| @@ -245,14 +131,21 @@ static int twl4030_wdt_resume(struct platform_device *pdev) | |||
| 245 | #define twl4030_wdt_resume NULL | 131 | #define twl4030_wdt_resume NULL |
| 246 | #endif | 132 | #endif |
| 247 | 133 | ||
| 134 | static const struct of_device_id twl_wdt_of_match[] = { | ||
| 135 | { .compatible = "ti,twl4030-wdt", }, | ||
| 136 | { }, | ||
| 137 | }; | ||
| 138 | MODULE_DEVICE_TABLE(of, twl_wdt_of_match); | ||
| 139 | |||
| 248 | static struct platform_driver twl4030_wdt_driver = { | 140 | static struct platform_driver twl4030_wdt_driver = { |
| 249 | .probe = twl4030_wdt_probe, | 141 | .probe = twl4030_wdt_probe, |
| 250 | .remove = __devexit_p(twl4030_wdt_remove), | 142 | .remove = twl4030_wdt_remove, |
| 251 | .suspend = twl4030_wdt_suspend, | 143 | .suspend = twl4030_wdt_suspend, |
| 252 | .resume = twl4030_wdt_resume, | 144 | .resume = twl4030_wdt_resume, |
| 253 | .driver = { | 145 | .driver = { |
| 254 | .owner = THIS_MODULE, | 146 | .owner = THIS_MODULE, |
| 255 | .name = "twl4030_wdt", | 147 | .name = "twl4030_wdt", |
| 148 | .of_match_table = twl_wdt_of_match, | ||
| 256 | }, | 149 | }, |
| 257 | }; | 150 | }; |
| 258 | 151 | ||
| @@ -260,6 +153,5 @@ module_platform_driver(twl4030_wdt_driver); | |||
| 260 | 153 | ||
| 261 | MODULE_AUTHOR("Nokia Corporation"); | 154 | MODULE_AUTHOR("Nokia Corporation"); |
| 262 | MODULE_LICENSE("GPL"); | 155 | MODULE_LICENSE("GPL"); |
| 263 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | ||
| 264 | MODULE_ALIAS("platform:twl4030_wdt"); | 156 | MODULE_ALIAS("platform:twl4030_wdt"); |
| 265 | 157 | ||
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c index aa50da3ccfe3..1a68f760cf86 100644 --- a/drivers/watchdog/via_wdt.c +++ b/drivers/watchdog/via_wdt.c | |||
| @@ -155,7 +155,7 @@ static struct watchdog_device wdt_dev = { | |||
| 155 | .max_timeout = WDT_TIMEOUT_MAX, | 155 | .max_timeout = WDT_TIMEOUT_MAX, |
| 156 | }; | 156 | }; |
| 157 | 157 | ||
| 158 | static int __devinit wdt_probe(struct pci_dev *pdev, | 158 | static int wdt_probe(struct pci_dev *pdev, |
| 159 | const struct pci_device_id *ent) | 159 | const struct pci_device_id *ent) |
| 160 | { | 160 | { |
| 161 | unsigned char conf; | 161 | unsigned char conf; |
| @@ -229,7 +229,7 @@ err_out_disable_device: | |||
| 229 | return ret; | 229 | return ret; |
| 230 | } | 230 | } |
| 231 | 231 | ||
| 232 | static void __devexit wdt_remove(struct pci_dev *pdev) | 232 | static void wdt_remove(struct pci_dev *pdev) |
| 233 | { | 233 | { |
| 234 | watchdog_unregister_device(&wdt_dev); | 234 | watchdog_unregister_device(&wdt_dev); |
| 235 | del_timer(&timer); | 235 | del_timer(&timer); |
| @@ -250,7 +250,7 @@ static struct pci_driver wdt_driver = { | |||
| 250 | .name = "via_wdt", | 250 | .name = "via_wdt", |
| 251 | .id_table = wdt_pci_table, | 251 | .id_table = wdt_pci_table, |
| 252 | .probe = wdt_probe, | 252 | .probe = wdt_probe, |
| 253 | .remove = __devexit_p(wdt_remove), | 253 | .remove = wdt_remove, |
| 254 | }; | 254 | }; |
| 255 | 255 | ||
| 256 | module_pci_driver(wdt_driver); | 256 | module_pci_driver(wdt_driver); |
diff --git a/drivers/watchdog/wdt_pci.c b/drivers/watchdog/wdt_pci.c index e32654efdbb6..36a54c0e32dd 100644 --- a/drivers/watchdog/wdt_pci.c +++ b/drivers/watchdog/wdt_pci.c | |||
| @@ -605,7 +605,7 @@ static struct notifier_block wdtpci_notifier = { | |||
| 605 | }; | 605 | }; |
| 606 | 606 | ||
| 607 | 607 | ||
| 608 | static int __devinit wdtpci_init_one(struct pci_dev *dev, | 608 | static int wdtpci_init_one(struct pci_dev *dev, |
| 609 | const struct pci_device_id *ent) | 609 | const struct pci_device_id *ent) |
| 610 | { | 610 | { |
| 611 | int ret = -EIO; | 611 | int ret = -EIO; |
| @@ -705,7 +705,7 @@ out_pci: | |||
| 705 | } | 705 | } |
| 706 | 706 | ||
| 707 | 707 | ||
| 708 | static void __devexit wdtpci_remove_one(struct pci_dev *pdev) | 708 | static void wdtpci_remove_one(struct pci_dev *pdev) |
| 709 | { | 709 | { |
| 710 | /* here we assume only one device will ever have | 710 | /* here we assume only one device will ever have |
| 711 | * been picked up and registered by probe function */ | 711 | * been picked up and registered by probe function */ |
| @@ -736,7 +736,7 @@ static struct pci_driver wdtpci_driver = { | |||
| 736 | .name = "wdt_pci", | 736 | .name = "wdt_pci", |
| 737 | .id_table = wdtpci_pci_tbl, | 737 | .id_table = wdtpci_pci_tbl, |
| 738 | .probe = wdtpci_init_one, | 738 | .probe = wdtpci_init_one, |
| 739 | .remove = __devexit_p(wdtpci_remove_one), | 739 | .remove = wdtpci_remove_one, |
| 740 | }; | 740 | }; |
| 741 | 741 | ||
| 742 | module_pci_driver(wdtpci_driver); | 742 | module_pci_driver(wdtpci_driver); |
diff --git a/drivers/watchdog/wm831x_wdt.c b/drivers/watchdog/wm831x_wdt.c index 87d66d236c3e..9dcb6d082277 100644 --- a/drivers/watchdog/wm831x_wdt.c +++ b/drivers/watchdog/wm831x_wdt.c | |||
| @@ -181,7 +181,7 @@ static const struct watchdog_ops wm831x_wdt_ops = { | |||
| 181 | .set_timeout = wm831x_wdt_set_timeout, | 181 | .set_timeout = wm831x_wdt_set_timeout, |
| 182 | }; | 182 | }; |
| 183 | 183 | ||
| 184 | static int __devinit 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; |
| @@ -292,7 +292,7 @@ err: | |||
| 292 | return ret; | 292 | return ret; |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | static int __devexit wm831x_wdt_remove(struct platform_device *pdev) | 295 | static int wm831x_wdt_remove(struct platform_device *pdev) |
| 296 | { | 296 | { |
| 297 | struct wm831x_wdt_drvdata *driver_data = dev_get_drvdata(&pdev->dev); | 297 | struct wm831x_wdt_drvdata *driver_data = dev_get_drvdata(&pdev->dev); |
| 298 | 298 | ||
| @@ -306,7 +306,7 @@ static int __devexit wm831x_wdt_remove(struct platform_device *pdev) | |||
| 306 | 306 | ||
| 307 | static struct platform_driver wm831x_wdt_driver = { | 307 | static struct platform_driver wm831x_wdt_driver = { |
| 308 | .probe = wm831x_wdt_probe, | 308 | .probe = wm831x_wdt_probe, |
| 309 | .remove = __devexit_p(wm831x_wdt_remove), | 309 | .remove = wm831x_wdt_remove, |
| 310 | .driver = { | 310 | .driver = { |
| 311 | .name = "wm831x-watchdog", | 311 | .name = "wm831x-watchdog", |
| 312 | }, | 312 | }, |
diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c index 3c76693447fd..34d272ada23d 100644 --- a/drivers/watchdog/wm8350_wdt.c +++ b/drivers/watchdog/wm8350_wdt.c | |||
| @@ -140,7 +140,7 @@ static struct watchdog_device wm8350_wdt = { | |||
| 140 | .max_timeout = 4, | 140 | .max_timeout = 4, |
| 141 | }; | 141 | }; |
| 142 | 142 | ||
| 143 | static int __devinit wm8350_wdt_probe(struct platform_device *pdev) | 143 | static int wm8350_wdt_probe(struct platform_device *pdev) |
| 144 | { | 144 | { |
| 145 | struct wm8350 *wm8350 = platform_get_drvdata(pdev); | 145 | struct wm8350 *wm8350 = platform_get_drvdata(pdev); |
| 146 | 146 | ||
| @@ -158,7 +158,7 @@ static int __devinit wm8350_wdt_probe(struct platform_device *pdev) | |||
| 158 | return watchdog_register_device(&wm8350_wdt); | 158 | return watchdog_register_device(&wm8350_wdt); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | static int __devexit wm8350_wdt_remove(struct platform_device *pdev) | 161 | static int wm8350_wdt_remove(struct platform_device *pdev) |
| 162 | { | 162 | { |
| 163 | watchdog_unregister_device(&wm8350_wdt); | 163 | watchdog_unregister_device(&wm8350_wdt); |
| 164 | return 0; | 164 | return 0; |
| @@ -166,7 +166,7 @@ static int __devexit wm8350_wdt_remove(struct platform_device *pdev) | |||
| 166 | 166 | ||
| 167 | static struct platform_driver wm8350_wdt_driver = { | 167 | static struct platform_driver wm8350_wdt_driver = { |
| 168 | .probe = wm8350_wdt_probe, | 168 | .probe = wm8350_wdt_probe, |
| 169 | .remove = __devexit_p(wm8350_wdt_remove), | 169 | .remove = wm8350_wdt_remove, |
| 170 | .driver = { | 170 | .driver = { |
| 171 | .name = "wm8350-wdt", | 171 | .name = "wm8350-wdt", |
| 172 | }, | 172 | }, |
diff --git a/drivers/watchdog/xen_wdt.c b/drivers/watchdog/xen_wdt.c index e4a25b51165c..92ad33d0cb71 100644 --- a/drivers/watchdog/xen_wdt.c +++ b/drivers/watchdog/xen_wdt.c | |||
| @@ -244,7 +244,7 @@ static struct miscdevice xen_wdt_miscdev = { | |||
| 244 | .fops = &xen_wdt_fops, | 244 | .fops = &xen_wdt_fops, |
| 245 | }; | 245 | }; |
| 246 | 246 | ||
| 247 | static int __devinit xen_wdt_probe(struct platform_device *dev) | 247 | static int xen_wdt_probe(struct platform_device *dev) |
| 248 | { | 248 | { |
| 249 | struct sched_watchdog wd = { .id = ~0 }; | 249 | struct sched_watchdog wd = { .id = ~0 }; |
| 250 | int ret = HYPERVISOR_sched_op(SCHEDOP_watchdog, &wd); | 250 | int ret = HYPERVISOR_sched_op(SCHEDOP_watchdog, &wd); |
| @@ -280,7 +280,7 @@ static int __devinit xen_wdt_probe(struct platform_device *dev) | |||
| 280 | return ret; | 280 | return ret; |
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | static int __devexit xen_wdt_remove(struct platform_device *dev) | 283 | static int xen_wdt_remove(struct platform_device *dev) |
| 284 | { | 284 | { |
| 285 | /* Stop the timer before we leave */ | 285 | /* Stop the timer before we leave */ |
| 286 | if (!nowayout) | 286 | if (!nowayout) |
| @@ -315,7 +315,7 @@ static int xen_wdt_resume(struct platform_device *dev) | |||
| 315 | 315 | ||
| 316 | static struct platform_driver xen_wdt_driver = { | 316 | static struct platform_driver xen_wdt_driver = { |
| 317 | .probe = xen_wdt_probe, | 317 | .probe = xen_wdt_probe, |
| 318 | .remove = __devexit_p(xen_wdt_remove), | 318 | .remove = xen_wdt_remove, |
| 319 | .shutdown = xen_wdt_shutdown, | 319 | .shutdown = xen_wdt_shutdown, |
| 320 | .suspend = xen_wdt_suspend, | 320 | .suspend = xen_wdt_suspend, |
| 321 | .resume = xen_wdt_resume, | 321 | .resume = xen_wdt_resume, |
