diff options
| -rw-r--r-- | drivers/watchdog/sch311x_wdt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/watchdog/sch311x_wdt.c b/drivers/watchdog/sch311x_wdt.c index f8477002b728..9681ada0f252 100644 --- a/drivers/watchdog/sch311x_wdt.c +++ b/drivers/watchdog/sch311x_wdt.c | |||
| @@ -136,6 +136,8 @@ static void sch311x_wdt_set_timeout(int t) | |||
| 136 | 136 | ||
| 137 | static void sch311x_wdt_start(void) | 137 | static void sch311x_wdt_start(void) |
| 138 | { | 138 | { |
| 139 | unsigned char t; | ||
| 140 | |||
| 139 | spin_lock(&sch311x_wdt_data.io_lock); | 141 | spin_lock(&sch311x_wdt_data.io_lock); |
| 140 | 142 | ||
| 141 | /* set watchdog's timeout */ | 143 | /* set watchdog's timeout */ |
| @@ -149,7 +151,8 @@ static void sch311x_wdt_start(void) | |||
| 149 | * Bit 4-6 (Reserved) | 151 | * Bit 4-6 (Reserved) |
| 150 | * Bit 7, Output Type: 0 = Push Pull Bit, 1 = Open Drain | 152 | * Bit 7, Output Type: 0 = Push Pull Bit, 1 = Open Drain |
| 151 | */ | 153 | */ |
| 152 | outb(0x0e, sch311x_wdt_data.runtime_reg + GP60); | 154 | t = inb(sch311x_wdt_data.runtime_reg + GP60); |
| 155 | outb((t & ~0x0d) | 0x0c, sch311x_wdt_data.runtime_reg + GP60); | ||
| 153 | 156 | ||
| 154 | spin_unlock(&sch311x_wdt_data.io_lock); | 157 | spin_unlock(&sch311x_wdt_data.io_lock); |
| 155 | 158 | ||
| @@ -157,10 +160,13 @@ static void sch311x_wdt_start(void) | |||
| 157 | 160 | ||
| 158 | static void sch311x_wdt_stop(void) | 161 | static void sch311x_wdt_stop(void) |
| 159 | { | 162 | { |
| 163 | unsigned char t; | ||
| 164 | |||
| 160 | spin_lock(&sch311x_wdt_data.io_lock); | 165 | spin_lock(&sch311x_wdt_data.io_lock); |
| 161 | 166 | ||
| 162 | /* stop the watchdog */ | 167 | /* stop the watchdog */ |
| 163 | outb(0x01, sch311x_wdt_data.runtime_reg + GP60); | 168 | t = inb(sch311x_wdt_data.runtime_reg + GP60); |
| 169 | outb((t & ~0x0d) | 0x01, sch311x_wdt_data.runtime_reg + GP60); | ||
| 164 | /* disable timeout by setting it to 0 */ | 170 | /* disable timeout by setting it to 0 */ |
| 165 | sch311x_wdt_set_timeout(0); | 171 | sch311x_wdt_set_timeout(0); |
| 166 | 172 | ||
