Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-wat…
Browse files Browse the repository at this point in the history
…chdog

* 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
  • Loading branch information
torvalds committed Jun 30, 2011
2 parents c8618d1 + aeb0aea commit 3b775e2
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion arch/x86/include/asm/apb_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extern int sfi_mtimer_num;
#else /* CONFIG_APB_TIMER */

static inline unsigned long apbt_quick_calibrate(void) {return 0; }
static inline void apbt_time_init(void) {return 0; }
static inline void apbt_time_init(void) { }

#endif
#endif /* ASM_X86_APBT_H */
3 changes: 1 addition & 2 deletions drivers/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,7 @@ config I6300ESB_WDT

config INTEL_SCU_WATCHDOG
bool "Intel SCU Watchdog for Mobile Platforms"
depends on WATCHDOG
depends on INTEL_SCU_IPC
depends on X86_MRST
---help---
Hardware driver for the watchdog time built into the Intel SCU
for Intel Mobile Platforms.
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/at32ap700x_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ static void __exit at32_wdt_exit(void)
}
module_exit(at32_wdt_exit);

MODULE_AUTHOR("Hans-Christian Egtvedt <[email protected]>");
MODULE_AUTHOR("Hans-Christian Egtvedt <[email protected]>");
MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
2 changes: 1 addition & 1 deletion drivers/watchdog/gef_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,4 @@ MODULE_AUTHOR("Martyn Welch <[email protected]>");
MODULE_DESCRIPTION("GE watchdog driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
MODULE_ALIAS("platform: gef_wdt");
MODULE_ALIAS("platform:gef_wdt");
1 change: 0 additions & 1 deletion drivers/watchdog/intel_scu_watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <linux/sched.h>
#include <linux/signal.h>
#include <linux/sfi.h>
#include <linux/types.h>
#include <asm/irq.h>
#include <asm/atomic.h>
#include <asm/intel_scu_ipc.h>
Expand Down
29 changes: 16 additions & 13 deletions drivers/watchdog/mtx-1_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,18 @@ static struct {
int default_ticks;
unsigned long inuse;
unsigned gpio;
int gstate;
unsigned int gstate;
} mtx1_wdt_device;

static void mtx1_wdt_trigger(unsigned long unused)
{
u32 tmp;

spin_lock(&mtx1_wdt_device.lock);
if (mtx1_wdt_device.running)
ticks--;

/* toggle wdt gpio */
mtx1_wdt_device.gstate = ~mtx1_wdt_device.gstate;
if (mtx1_wdt_device.gstate)
gpio_direction_output(mtx1_wdt_device.gpio, 1);
else
gpio_direction_input(mtx1_wdt_device.gpio);
mtx1_wdt_device.gstate = !mtx1_wdt_device.gstate;
gpio_set_value(mtx1_wdt_device.gpio, mtx1_wdt_device.gstate);

if (mtx1_wdt_device.queue && ticks)
mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
Expand All @@ -105,7 +100,7 @@ static void mtx1_wdt_start(void)
if (!mtx1_wdt_device.queue) {
mtx1_wdt_device.queue = 1;
mtx1_wdt_device.gstate = 1;
gpio_direction_output(mtx1_wdt_device.gpio, 1);
gpio_set_value(mtx1_wdt_device.gpio, 1);
mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
}
mtx1_wdt_device.running++;
Expand All @@ -120,7 +115,7 @@ static int mtx1_wdt_stop(void)
if (mtx1_wdt_device.queue) {
mtx1_wdt_device.queue = 0;
mtx1_wdt_device.gstate = 0;
gpio_direction_output(mtx1_wdt_device.gpio, 0);
gpio_set_value(mtx1_wdt_device.gpio, 0);
}
ticks = mtx1_wdt_device.default_ticks;
spin_unlock_irqrestore(&mtx1_wdt_device.lock, flags);
Expand Down Expand Up @@ -214,6 +209,12 @@ static int __devinit mtx1_wdt_probe(struct platform_device *pdev)
int ret;

mtx1_wdt_device.gpio = pdev->resource[0].start;
ret = gpio_request_one(mtx1_wdt_device.gpio,
GPIOF_OUT_INIT_HIGH, "mtx1-wdt");
if (ret < 0) {
dev_err(&pdev->dev, "failed to request gpio");
return ret;
}

spin_lock_init(&mtx1_wdt_device.lock);
init_completion(&mtx1_wdt_device.stop);
Expand All @@ -239,11 +240,13 @@ static int __devexit mtx1_wdt_remove(struct platform_device *pdev)
mtx1_wdt_device.queue = 0;
wait_for_completion(&mtx1_wdt_device.stop);
}

gpio_free(mtx1_wdt_device.gpio);
misc_deregister(&mtx1_wdt_misc);
return 0;
}

static struct platform_driver mtx1_wdt = {
static struct platform_driver mtx1_wdt_driver = {
.probe = mtx1_wdt_probe,
.remove = __devexit_p(mtx1_wdt_remove),
.driver.name = "mtx1-wdt",
Expand All @@ -252,12 +255,12 @@ static struct platform_driver mtx1_wdt = {

static int __init mtx1_wdt_init(void)
{
return platform_driver_register(&mtx1_wdt);
return platform_driver_register(&mtx1_wdt_driver);
}

static void __exit mtx1_wdt_exit(void)
{
platform_driver_unregister(&mtx1_wdt);
platform_driver_unregister(&mtx1_wdt_driver);
}

module_init(mtx1_wdt_init);
Expand Down
5 changes: 5 additions & 0 deletions drivers/watchdog/wm831x_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ static int __devinit wm831x_wdt_probe(struct platform_device *pdev)
struct wm831x_watchdog_pdata *pdata;
int reg, ret;

if (wm831x) {
dev_err(&pdev->dev, "wm831x watchdog already registered\n");
return -EBUSY;
}

wm831x = dev_get_drvdata(pdev->dev.parent);

ret = wm831x_reg_read(wm831x, WM831X_WATCHDOG);
Expand Down

0 comments on commit 3b775e2

Please sign in to comment.