Skip to content

Commit

Permalink
watchdog: w83627hf: Enable watchdog device only if not already enabled
Browse files Browse the repository at this point in the history
There is no need to enable the watchdog device if it is already enabled.
Also, when enabling the watchdog device, only set the watchdog device
enable bit and do not touch other bits; depending on the chip type,
those bits may enable other functionality.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
  • Loading branch information
Guenter Roeck authored and Wim Van Sebroeck committed Nov 18, 2013
1 parent 8f52638 commit ac46110
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/watchdog/w83627hf_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ static void w83627hf_init(struct watchdog_device *wdog)
}

outb_p(0x30, WDT_EFER); /* select CR30 */
outb_p(0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */
t = inb(WDT_EFDR);
if (!(t & 0x01))
outb_p(t | 0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */

outb_p(0xF6, WDT_EFER); /* Select CRF6 */
t = inb_p(WDT_EFDR); /* read CRF6 */
Expand Down

0 comments on commit ac46110

Please sign in to comment.