All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: linux-watchdog@vger.kernel.org
Cc: Wim Van Sebroeck <wim@iguana.be>,
	linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 3/8] watchdog: w83627hf: Enable watchdog device only if not already enabled
Date: Mon,  4 Mar 2013 20:54:14 -0800	[thread overview]
Message-ID: <1362459259-9733-4-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1362459259-9733-1-git-send-email-linux@roeck-us.net>

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>
---
 drivers/watchdog/w83627hf_wdt.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c
index 98a4fd0..6f023e1 100644
--- a/drivers/watchdog/w83627hf_wdt.c
+++ b/drivers/watchdog/w83627hf_wdt.c
@@ -95,7 +95,9 @@ static void w83627hf_init(void)
 	}
 
 	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 */
-- 
1.7.9.7


  parent reply	other threads:[~2013-03-05  4:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05  4:54 [PATCH 0/8] watchdog: w83627hf: Convert to watchdog infrastructure Guenter Roeck
2013-03-05  4:54 ` [PATCH 1/8] " Guenter Roeck
2013-03-05  4:54   ` Guenter Roeck
2013-03-05  4:54 ` [PATCH 2/8] watchdog: w83627hf: Enable watchdog only once Guenter Roeck
2013-03-05  4:54 ` Guenter Roeck [this message]
2013-03-05  4:54 ` [PATCH 4/8] watchdog: w83627hf: Use helper functions to access superio registers Guenter Roeck
2013-03-05  4:54 ` [PATCH 5/8] watchdog: w83627hf: Auto-detect IO address and supported chips Guenter Roeck
2013-03-05  4:54 ` [PATCH 6/8] watchdog: w83627hf: Add support for additional chips Guenter Roeck
2013-03-05  4:54 ` [PATCH 7/8] watchdog: w83627hf: Add support for W83697HF and W83697UG Guenter Roeck
2013-03-05  4:54 ` [PATCH 8/8] watchdog: Remove drivers " Guenter Roeck
2013-03-05  4:54   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362459259-9733-4-git-send-email-linux@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.