diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-30 13:43:57 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-30 13:43:57 -0400 |
| commit | 3b775e2246ae861daec276d3229a7de2af69b7db (patch) | |
| tree | 6d2811f0742beea2358df19e93e9dff5f935d230 | |
| parent | c8618d16f91f58c01be4bdbec4d724efe426a081 (diff) | |
| parent | aeb0aea143e958d5218162d73b1ed4d6ff0ed7c4 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
watchdog: update author email for at32ap700x_wdt
watchdog: gef_wdt: fix MODULE_ALIAS
watchdog: Intel SCU Watchdog: Fix build and remove duplicate code
watchdog: mtx1-wdt: fix section mismatch
watchdog: mtx1-wdt: fix GPIO toggling
watchdog: mtx1-wdt: request gpio before using it
watchdog: Handle multiple wm831x watchdogs being registered
| -rw-r--r-- | arch/x86/include/asm/apb_timer.h | 2 | ||||
| -rw-r--r-- | drivers/watchdog/Kconfig | 3 | ||||
| -rw-r--r-- | drivers/watchdog/at32ap700x_wdt.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/gef_wdt.c | 2 | ||||
| -rw-r--r-- | drivers/watchdog/intel_scu_watchdog.c | 1 | ||||
| -rw-r--r-- | drivers/watchdog/mtx-1_wdt.c | 29 | ||||
| -rw-r--r-- | drivers/watchdog/wm831x_wdt.c | 5 |
7 files changed, 25 insertions, 19 deletions
diff --git a/arch/x86/include/asm/apb_timer.h b/arch/x86/include/asm/apb_timer.h index 2fefa501d3ba..af60d8a2e288 100644 --- a/arch/x86/include/asm/apb_timer.h +++ b/arch/x86/include/asm/apb_timer.h | |||
| @@ -62,7 +62,7 @@ extern int sfi_mtimer_num; | |||
| 62 | #else /* CONFIG_APB_TIMER */ | 62 | #else /* CONFIG_APB_TIMER */ |
| 63 | 63 | ||
| 64 | static inline unsigned long apbt_quick_calibrate(void) {return 0; } | 64 | static inline unsigned long apbt_quick_calibrate(void) {return 0; } |
| 65 | static inline void apbt_time_init(void) {return 0; } | 65 | static inline void apbt_time_init(void) { } |
| 66 | 66 | ||
| 67 | #endif | 67 | #endif |
| 68 | #endif /* ASM_X86_APBT_H */ | 68 | #endif /* ASM_X86_APBT_H */ |
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 022f9eb0b7bf..9536d386bb38 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
| @@ -535,8 +535,7 @@ config I6300ESB_WDT | |||
| 535 | 535 | ||
| 536 | config INTEL_SCU_WATCHDOG | 536 | config INTEL_SCU_WATCHDOG |
| 537 | bool "Intel SCU Watchdog for Mobile Platforms" | 537 | bool "Intel SCU Watchdog for Mobile Platforms" |
| 538 | depends on WATCHDOG | 538 | depends on X86_MRST |
| 539 | depends on INTEL_SCU_IPC | ||
| 540 | ---help--- | 539 | ---help--- |
| 541 | Hardware driver for the watchdog time built into the Intel SCU | 540 | Hardware driver for the watchdog time built into the Intel SCU |
| 542 | for Intel Mobile Platforms. | 541 | for Intel Mobile Platforms. |
diff --git a/drivers/watchdog/at32ap700x_wdt.c b/drivers/watchdog/at32ap700x_wdt.c index 750bc5281d79..4ca5d40304b2 100644 --- a/drivers/watchdog/at32ap700x_wdt.c +++ b/drivers/watchdog/at32ap700x_wdt.c | |||
| @@ -448,7 +448,7 @@ static void __exit at32_wdt_exit(void) | |||
| 448 | } | 448 | } |
| 449 | module_exit(at32_wdt_exit); | 449 | module_exit(at32_wdt_exit); |
| 450 | 450 | ||
| 451 | MODULE_AUTHOR("Hans-Christian Egtvedt <hcegtvedt@atmel.com>"); | 451 | MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>"); |
| 452 | MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X"); | 452 | MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X"); |
| 453 | MODULE_LICENSE("GPL"); | 453 | MODULE_LICENSE("GPL"); |
| 454 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 454 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
diff --git a/drivers/watchdog/gef_wdt.c b/drivers/watchdog/gef_wdt.c index 29a7cd4b90c8..b146082bd85a 100644 --- a/drivers/watchdog/gef_wdt.c +++ b/drivers/watchdog/gef_wdt.c | |||
| @@ -329,4 +329,4 @@ MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com>"); | |||
| 329 | MODULE_DESCRIPTION("GE watchdog driver"); | 329 | MODULE_DESCRIPTION("GE watchdog driver"); |
| 330 | MODULE_LICENSE("GPL"); | 330 | MODULE_LICENSE("GPL"); |
| 331 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 331 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
| 332 | MODULE_ALIAS("platform: gef_wdt"); | 332 | MODULE_ALIAS("platform:gef_wdt"); |
diff --git a/drivers/watchdog/intel_scu_watchdog.c b/drivers/watchdog/intel_scu_watchdog.c index 919bdd16136f..ba4386066a42 100644 --- a/drivers/watchdog/intel_scu_watchdog.c +++ b/drivers/watchdog/intel_scu_watchdog.c | |||
| @@ -42,7 +42,6 @@ | |||
| 42 | #include <linux/sched.h> | 42 | #include <linux/sched.h> |
| 43 | #include <linux/signal.h> | 43 | #include <linux/signal.h> |
| 44 | #include <linux/sfi.h> | 44 | #include <linux/sfi.h> |
| 45 | #include <linux/types.h> | ||
| 46 | #include <asm/irq.h> | 45 | #include <asm/irq.h> |
| 47 | #include <asm/atomic.h> | 46 | #include <asm/atomic.h> |
| 48 | #include <asm/intel_scu_ipc.h> | 47 | #include <asm/intel_scu_ipc.h> |
diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c index 1479dc4d6129..0430e093b1a0 100644 --- a/drivers/watchdog/mtx-1_wdt.c +++ b/drivers/watchdog/mtx-1_wdt.c | |||
| @@ -66,23 +66,18 @@ static struct { | |||
| 66 | int default_ticks; | 66 | int default_ticks; |
| 67 | unsigned long inuse; | 67 | unsigned long inuse; |
| 68 | unsigned gpio; | 68 | unsigned gpio; |
| 69 | int gstate; | 69 | unsigned int gstate; |
| 70 | } mtx1_wdt_device; | 70 | } mtx1_wdt_device; |
| 71 | 71 | ||
| 72 | static void mtx1_wdt_trigger(unsigned long unused) | 72 | static void mtx1_wdt_trigger(unsigned long unused) |
| 73 | { | 73 | { |
| 74 | u32 tmp; | ||
| 75 | |||
| 76 | spin_lock(&mtx1_wdt_device.lock); | 74 | spin_lock(&mtx1_wdt_device.lock); |
| 77 | if (mtx1_wdt_device.running) | 75 | if (mtx1_wdt_device.running) |
| 78 | ticks--; | 76 | ticks--; |
| 79 | 77 | ||
| 80 | /* toggle wdt gpio */ | 78 | /* toggle wdt gpio */ |
| 81 | mtx1_wdt_device.gstate = ~mtx1_wdt_device.gstate; | 79 | mtx1_wdt_device.gstate = !mtx1_wdt_device.gstate; |
| 82 | if (mtx1_wdt_device.gstate) | 80 | gpio_set_value(mtx1_wdt_device.gpio, mtx1_wdt_device.gstate); |
| 83 | gpio_direction_output(mtx1_wdt_device.gpio, 1); | ||
| 84 | else | ||
| 85 | gpio_direction_input(mtx1_wdt_device.gpio); | ||
| 86 | 81 | ||
| 87 | if (mtx1_wdt_device.queue && ticks) | 82 | if (mtx1_wdt_device.queue && ticks) |
| 88 | mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL); | 83 | mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL); |
| @@ -105,7 +100,7 @@ static void mtx1_wdt_start(void) | |||
| 105 | if (!mtx1_wdt_device.queue) { | 100 | if (!mtx1_wdt_device.queue) { |
| 106 | mtx1_wdt_device.queue = 1; | 101 | mtx1_wdt_device.queue = 1; |
| 107 | mtx1_wdt_device.gstate = 1; | 102 | mtx1_wdt_device.gstate = 1; |
| 108 | gpio_direction_output(mtx1_wdt_device.gpio, 1); | 103 | gpio_set_value(mtx1_wdt_device.gpio, 1); |
| 109 | mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL); | 104 | mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL); |
| 110 | } | 105 | } |
| 111 | mtx1_wdt_device.running++; | 106 | mtx1_wdt_device.running++; |
| @@ -120,7 +115,7 @@ static int mtx1_wdt_stop(void) | |||
| 120 | if (mtx1_wdt_device.queue) { | 115 | if (mtx1_wdt_device.queue) { |
| 121 | mtx1_wdt_device.queue = 0; | 116 | mtx1_wdt_device.queue = 0; |
| 122 | mtx1_wdt_device.gstate = 0; | 117 | mtx1_wdt_device.gstate = 0; |
| 123 | gpio_direction_output(mtx1_wdt_device.gpio, 0); | 118 | gpio_set_value(mtx1_wdt_device.gpio, 0); |
| 124 | } | 119 | } |
| 125 | ticks = mtx1_wdt_device.default_ticks; | 120 | ticks = mtx1_wdt_device.default_ticks; |
| 126 | spin_unlock_irqrestore(&mtx1_wdt_device.lock, flags); | 121 | spin_unlock_irqrestore(&mtx1_wdt_device.lock, flags); |
| @@ -214,6 +209,12 @@ static int __devinit mtx1_wdt_probe(struct platform_device *pdev) | |||
| 214 | int ret; | 209 | int ret; |
| 215 | 210 | ||
| 216 | mtx1_wdt_device.gpio = pdev->resource[0].start; | 211 | mtx1_wdt_device.gpio = pdev->resource[0].start; |
| 212 | ret = gpio_request_one(mtx1_wdt_device.gpio, | ||
| 213 | GPIOF_OUT_INIT_HIGH, "mtx1-wdt"); | ||
| 214 | if (ret < 0) { | ||
| 215 | dev_err(&pdev->dev, "failed to request gpio"); | ||
| 216 | return ret; | ||
| 217 | } | ||
| 217 | 218 | ||
| 218 | spin_lock_init(&mtx1_wdt_device.lock); | 219 | spin_lock_init(&mtx1_wdt_device.lock); |
| 219 | init_completion(&mtx1_wdt_device.stop); | 220 | init_completion(&mtx1_wdt_device.stop); |
| @@ -239,11 +240,13 @@ static int __devexit mtx1_wdt_remove(struct platform_device *pdev) | |||
| 239 | mtx1_wdt_device.queue = 0; | 240 | mtx1_wdt_device.queue = 0; |
| 240 | wait_for_completion(&mtx1_wdt_device.stop); | 241 | wait_for_completion(&mtx1_wdt_device.stop); |
| 241 | } | 242 | } |
| 243 | |||
| 244 | gpio_free(mtx1_wdt_device.gpio); | ||
| 242 | misc_deregister(&mtx1_wdt_misc); | 245 | misc_deregister(&mtx1_wdt_misc); |
| 243 | return 0; | 246 | return 0; |
| 244 | } | 247 | } |
| 245 | 248 | ||
| 246 | static struct platform_driver mtx1_wdt = { | 249 | static struct platform_driver mtx1_wdt_driver = { |
| 247 | .probe = mtx1_wdt_probe, | 250 | .probe = mtx1_wdt_probe, |
| 248 | .remove = __devexit_p(mtx1_wdt_remove), | 251 | .remove = __devexit_p(mtx1_wdt_remove), |
| 249 | .driver.name = "mtx1-wdt", | 252 | .driver.name = "mtx1-wdt", |
| @@ -252,12 +255,12 @@ static struct platform_driver mtx1_wdt = { | |||
| 252 | 255 | ||
| 253 | static int __init mtx1_wdt_init(void) | 256 | static int __init mtx1_wdt_init(void) |
| 254 | { | 257 | { |
| 255 | return platform_driver_register(&mtx1_wdt); | 258 | return platform_driver_register(&mtx1_wdt_driver); |
| 256 | } | 259 | } |
| 257 | 260 | ||
| 258 | static void __exit mtx1_wdt_exit(void) | 261 | static void __exit mtx1_wdt_exit(void) |
| 259 | { | 262 | { |
| 260 | platform_driver_unregister(&mtx1_wdt); | 263 | platform_driver_unregister(&mtx1_wdt_driver); |
| 261 | } | 264 | } |
| 262 | 265 | ||
| 263 | module_init(mtx1_wdt_init); | 266 | module_init(mtx1_wdt_init); |
diff --git a/drivers/watchdog/wm831x_wdt.c b/drivers/watchdog/wm831x_wdt.c index 8c4b2d5bb7da..871caea4e1c6 100644 --- a/drivers/watchdog/wm831x_wdt.c +++ b/drivers/watchdog/wm831x_wdt.c | |||
| @@ -320,6 +320,11 @@ static int __devinit wm831x_wdt_probe(struct platform_device *pdev) | |||
| 320 | struct wm831x_watchdog_pdata *pdata; | 320 | struct wm831x_watchdog_pdata *pdata; |
| 321 | int reg, ret; | 321 | int reg, ret; |
| 322 | 322 | ||
| 323 | if (wm831x) { | ||
| 324 | dev_err(&pdev->dev, "wm831x watchdog already registered\n"); | ||
| 325 | return -EBUSY; | ||
| 326 | } | ||
| 327 | |||
| 323 | wm831x = dev_get_drvdata(pdev->dev.parent); | 328 | wm831x = dev_get_drvdata(pdev->dev.parent); |
| 324 | 329 | ||
| 325 | ret = wm831x_reg_read(wm831x, WM831X_WATCHDOG); | 330 | ret = wm831x_reg_read(wm831x, WM831X_WATCHDOG); |
