aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-08-17 16:58:41 -0400
committerWim Van Sebroeck <wim@iguana.be>2013-11-18 15:34:13 -0500
commitac461103c57ac46cd6778f1fd0352ff0e4a2d38e (patch)
tree720b6be69743d35460470f9eca953c0531755e02
parent8f526389599fc543b204c12a36de8345eb298085 (diff)
watchdog: w83627hf: Enable watchdog device only if not already enabled
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>
-rw-r--r--drivers/watchdog/w83627hf_wdt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
index 910d43736821..c5d34f46e7ad 100644
--- a/drivers/watchdog/w83627hf_wdt.c
+++ b/drivers/watchdog/w83627hf_wdt.c
@@ -107,7 +107,9 @@ static void w83627hf_init(struct watchdog_device *wdog)
107 } 107 }
108 108
109 outb_p(0x30, WDT_EFER); /* select CR30 */ 109 outb_p(0x30, WDT_EFER); /* select CR30 */
110 outb_p(0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */ 110 t = inb(WDT_EFDR);
111 if (!(t & 0x01))
112 outb_p(t | 0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */
111 113
112 outb_p(0xF6, WDT_EFER); /* Select CRF6 */ 114 outb_p(0xF6, WDT_EFER); /* Select CRF6 */
113 t = inb_p(WDT_EFDR); /* read CRF6 */ 115 t = inb_p(WDT_EFDR); /* read CRF6 */