Skip to content

Commit 3b775e2

Browse files
committed
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
2 parents c8618d1 + aeb0aea commit 3b775e2

File tree

7 files changed

+25
-19
lines changed

7 files changed

+25
-19
lines changed

arch/x86/include/asm/apb_timer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ extern int sfi_mtimer_num;
6262
#else /* CONFIG_APB_TIMER */
6363

6464
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) { }
6666

6767
#endif
6868
#endif /* ASM_X86_APBT_H */

drivers/watchdog/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,7 @@ config I6300ESB_WDT
535535

536536
config INTEL_SCU_WATCHDOG
537537
bool "Intel SCU Watchdog for Mobile Platforms"
538-
depends on WATCHDOG
539-
depends on INTEL_SCU_IPC
538+
depends on X86_MRST
540539
---help---
541540
Hardware driver for the watchdog time built into the Intel SCU
542541
for Intel Mobile Platforms.

drivers/watchdog/at32ap700x_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ static void __exit at32_wdt_exit(void)
448448
}
449449
module_exit(at32_wdt_exit);
450450

451-
MODULE_AUTHOR("Hans-Christian Egtvedt <[email protected]>");
451+
MODULE_AUTHOR("Hans-Christian Egtvedt <[email protected]>");
452452
MODULE_DESCRIPTION("Watchdog driver for Atmel AT32AP700X");
453453
MODULE_LICENSE("GPL");
454454
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);

drivers/watchdog/gef_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,4 +329,4 @@ MODULE_AUTHOR("Martyn Welch <[email protected]>");
329329
MODULE_DESCRIPTION("GE watchdog driver");
330330
MODULE_LICENSE("GPL");
331331
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
332-
MODULE_ALIAS("platform: gef_wdt");
332+
MODULE_ALIAS("platform:gef_wdt");

drivers/watchdog/intel_scu_watchdog.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include <linux/sched.h>
4343
#include <linux/signal.h>
4444
#include <linux/sfi.h>
45-
#include <linux/types.h>
4645
#include <asm/irq.h>
4746
#include <asm/atomic.h>
4847
#include <asm/intel_scu_ipc.h>

drivers/watchdog/mtx-1_wdt.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,18 @@ static struct {
6666
int default_ticks;
6767
unsigned long inuse;
6868
unsigned gpio;
69-
int gstate;
69+
unsigned int gstate;
7070
} mtx1_wdt_device;
7171

7272
static void mtx1_wdt_trigger(unsigned long unused)
7373
{
74-
u32 tmp;
75-
7674
spin_lock(&mtx1_wdt_device.lock);
7775
if (mtx1_wdt_device.running)
7876
ticks--;
7977

8078
/* toggle wdt gpio */
81-
mtx1_wdt_device.gstate = ~mtx1_wdt_device.gstate;
82-
if (mtx1_wdt_device.gstate)
83-
gpio_direction_output(mtx1_wdt_device.gpio, 1);
84-
else
85-
gpio_direction_input(mtx1_wdt_device.gpio);
79+
mtx1_wdt_device.gstate = !mtx1_wdt_device.gstate;
80+
gpio_set_value(mtx1_wdt_device.gpio, mtx1_wdt_device.gstate);
8681

8782
if (mtx1_wdt_device.queue && ticks)
8883
mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
@@ -105,7 +100,7 @@ static void mtx1_wdt_start(void)
105100
if (!mtx1_wdt_device.queue) {
106101
mtx1_wdt_device.queue = 1;
107102
mtx1_wdt_device.gstate = 1;
108-
gpio_direction_output(mtx1_wdt_device.gpio, 1);
103+
gpio_set_value(mtx1_wdt_device.gpio, 1);
109104
mod_timer(&mtx1_wdt_device.timer, jiffies + MTX1_WDT_INTERVAL);
110105
}
111106
mtx1_wdt_device.running++;
@@ -120,7 +115,7 @@ static int mtx1_wdt_stop(void)
120115
if (mtx1_wdt_device.queue) {
121116
mtx1_wdt_device.queue = 0;
122117
mtx1_wdt_device.gstate = 0;
123-
gpio_direction_output(mtx1_wdt_device.gpio, 0);
118+
gpio_set_value(mtx1_wdt_device.gpio, 0);
124119
}
125120
ticks = mtx1_wdt_device.default_ticks;
126121
spin_unlock_irqrestore(&mtx1_wdt_device.lock, flags);
@@ -214,6 +209,12 @@ static int __devinit mtx1_wdt_probe(struct platform_device *pdev)
214209
int ret;
215210

216211
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+
}
217218

218219
spin_lock_init(&mtx1_wdt_device.lock);
219220
init_completion(&mtx1_wdt_device.stop);
@@ -239,11 +240,13 @@ static int __devexit mtx1_wdt_remove(struct platform_device *pdev)
239240
mtx1_wdt_device.queue = 0;
240241
wait_for_completion(&mtx1_wdt_device.stop);
241242
}
243+
244+
gpio_free(mtx1_wdt_device.gpio);
242245
misc_deregister(&mtx1_wdt_misc);
243246
return 0;
244247
}
245248

246-
static struct platform_driver mtx1_wdt = {
249+
static struct platform_driver mtx1_wdt_driver = {
247250
.probe = mtx1_wdt_probe,
248251
.remove = __devexit_p(mtx1_wdt_remove),
249252
.driver.name = "mtx1-wdt",
@@ -252,12 +255,12 @@ static struct platform_driver mtx1_wdt = {
252255

253256
static int __init mtx1_wdt_init(void)
254257
{
255-
return platform_driver_register(&mtx1_wdt);
258+
return platform_driver_register(&mtx1_wdt_driver);
256259
}
257260

258261
static void __exit mtx1_wdt_exit(void)
259262
{
260-
platform_driver_unregister(&mtx1_wdt);
263+
platform_driver_unregister(&mtx1_wdt_driver);
261264
}
262265

263266
module_init(mtx1_wdt_init);

drivers/watchdog/wm831x_wdt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,11 @@ static int __devinit wm831x_wdt_probe(struct platform_device *pdev)
320320
struct wm831x_watchdog_pdata *pdata;
321321
int reg, ret;
322322

323+
if (wm831x) {
324+
dev_err(&pdev->dev, "wm831x watchdog already registered\n");
325+
return -EBUSY;
326+
}
327+
323328
wm831x = dev_get_drvdata(pdev->dev.parent);
324329

325330
ret = wm831x_reg_read(wm831x, WM831X_WATCHDOG);

0 commit comments

Comments
 (0)