From: Eddie James <eajames@linux.vnet.ibm.com>
To: linux-watchdog@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux@roeck-us.net,
wim@linux-watchdog.org, joel@jms.id.au, openbmc@lists.ozlabs.org,
Eddie James <eajames@linux.vnet.ibm.com>
Subject: [PATCH] aspeed: watchdog: Add status function
Date: Mon, 26 Mar 2018 16:17:08 -0500 [thread overview]
Message-ID: <1522099028-20347-1-git-send-email-eajames@linux.vnet.ibm.com> (raw)
Populate the status watchdog operation to return the "timeout status"
register of the ASPEED watchdog.
Signed-off-by: Eddie James <eajames@linux.vnet.ibm.com>
---
drivers/watchdog/aspeed_wdt.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
index a5b8eb2..d6dd5c9 100644
--- a/drivers/watchdog/aspeed_wdt.c
+++ b/drivers/watchdog/aspeed_wdt.c
@@ -55,6 +55,7 @@ struct aspeed_wdt_config {
#define WDT_CTRL_WDT_INTR BIT(2)
#define WDT_CTRL_RESET_SYSTEM BIT(1)
#define WDT_CTRL_ENABLE BIT(0)
+#define WDT_TIMEOUT_STATUS 0x10
/*
* WDT_RESET_WIDTH controls the characteristics of the external pulse (if
@@ -138,6 +139,13 @@ static int aspeed_wdt_ping(struct watchdog_device *wdd)
return 0;
}
+static unsigned int aspeed_wdt_status(struct watchdog_device *wdd)
+{
+ struct aspeed_wdt *wdt = to_aspeed_wdt(wdd);
+
+ return readl(wdt->base + WDT_TIMEOUT_STATUS);
+}
+
static int aspeed_wdt_set_timeout(struct watchdog_device *wdd,
unsigned int timeout)
{
@@ -171,6 +179,7 @@ static int aspeed_wdt_restart(struct watchdog_device *wdd,
.start = aspeed_wdt_start,
.stop = aspeed_wdt_stop,
.ping = aspeed_wdt_ping,
+ .status = aspeed_wdt_status,
.set_timeout = aspeed_wdt_set_timeout,
.restart = aspeed_wdt_restart,
.owner = THIS_MODULE,
--
1.8.3.1
next reply other threads:[~2018-03-26 21:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-26 21:17 Eddie James [this message]
2018-03-26 22:00 ` [PATCH] aspeed: watchdog: Add status function Guenter Roeck
2018-03-26 22:08 ` Eddie James
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=1522099028-20347-1-git-send-email-eajames@linux.vnet.ibm.com \
--to=eajames@linux.vnet.ibm.com \
--cc=joel@jms.id.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=openbmc@lists.ozlabs.org \
--cc=wim@linux-watchdog.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox