Skip to content

Commit 4d3d50f

Browse files
t-8chWim Van Sebroeck
authored andcommitted
watchdog: sp5100_tco: Add support for get_timeleft
Tested on a Gigabyte X570 I AORUS PRO WIFI. Signed-off-by: Thomas Weißschuh <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 59b0f51 commit 4d3d50f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/watchdog/sp5100_tco.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* https://www.kernelconcepts.de
1111
*
1212
* See AMD Publication 43009 "AMD SB700/710/750 Register Reference Guide",
13+
* AMD Publication 44413 "AMD SP5100 Register Reference Guide"
1314
* AMD Publication 45482 "AMD SB800-Series Southbridges Register
1415
* Reference Guide"
1516
* AMD Publication 48751 "BIOS and Kernel Developer’s Guide (BKDG)
@@ -144,6 +145,13 @@ static int tco_timer_set_timeout(struct watchdog_device *wdd,
144145
return 0;
145146
}
146147

148+
static unsigned int tco_timer_get_timeleft(struct watchdog_device *wdd)
149+
{
150+
struct sp5100_tco *tco = watchdog_get_drvdata(wdd);
151+
152+
return readl(SP5100_WDT_COUNT(tco->tcobase));
153+
}
154+
147155
static u8 sp5100_tco_read_pm_reg8(u8 index)
148156
{
149157
outb(index, SP5100_IO_PM_INDEX_REG);
@@ -386,6 +394,7 @@ static const struct watchdog_ops sp5100_tco_wdt_ops = {
386394
.stop = tco_timer_stop,
387395
.ping = tco_timer_ping,
388396
.set_timeout = tco_timer_set_timeout,
397+
.get_timeleft = tco_timer_get_timeleft,
389398
};
390399

391400
static int sp5100_tco_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)