Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254213
b: refs/heads/master
c: 2ea4e76
h: refs/heads/master
i:
  254211: 87449ab
v: v3
  • Loading branch information
Florian Fainelli authored and Wim Van Sebroeck committed Jun 28, 2011
1 parent d4cb76d commit 9b692d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9b19d40aa3ebaf1078779da10555da2ab8512422
refs/heads/master: 2ea4e76e997019ae25ac3417aa46e31ddf7ecb17
13 changes: 5 additions & 8 deletions trunk/drivers/watchdog/mtx-1_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ 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)
Expand All @@ -78,11 +78,8 @@ static void mtx1_wdt_trigger(unsigned long unused)
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 +102,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 +117,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

0 comments on commit 9b692d6

Please sign in to comment.