Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac461103 authored by Guenter Roeck's avatar Guenter Roeck Committed by Wim Van Sebroeck
Browse files

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: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 8f526389
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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 */