mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/4] watchdog: dw_wdt: Detect if running initially
Date: Thu, 10 Jun 2021 15:06:11 +0200	[thread overview]
Message-ID: <20210610130613.27983-2-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20210610130613.27983-1-s.hauer@pengutronix.de>

Let the watchdog core know if the watchdog is currently running or not.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/watchdog/dw_wdt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c
index bc5d4a889a..bc5af810ea 100644
--- a/drivers/watchdog/dw_wdt.c
+++ b/drivers/watchdog/dw_wdt.c
@@ -164,6 +164,9 @@ static int dw_wdt_drv_probe(struct device_d *dev)
 	wdd->hwdev = dev;
 	wdd->set_timeout = dw_wdt_set_timeout;
 
+	wdd->running = readl(dw_wdt->regs + WDOG_CONTROL_REG_OFFSET) &
+		WDOG_CONTROL_REG_WDT_EN_MASK ? WDOG_HW_RUNNING : WDOG_HW_NOT_RUNNING;
+
 	dw_wdt->rate = clk_get_rate(clk);
 	if (dw_wdt->rate == 0)
 		return -EINVAL;
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-06-10 13:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-10 13:06 [PATCH 1/4] watchdog: dw_wdt: Write counter restart register Sascha Hauer
2021-06-10 13:06 ` Sascha Hauer [this message]
2021-06-10 13:06 ` [PATCH 3/4] watchdog: dw_wdt: set maximum timeout Sascha Hauer
2021-06-10 13:06 ` [PATCH 4/4] watchdog: dw_wdt: denote message to debug level Sascha Hauer

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=20210610130613.27983-2-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --subject='Re: [PATCH 2/4] watchdog: dw_wdt: Detect if running initially' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox