Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4637897pxb; Tue, 28 Sep 2021 00:00:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGTEjZwF5yKRLyunS5UvCZG809ywqZDcQjll5I+ccyY+YManRxnGmnVWJ3jAPqtSGbGxwf X-Received: by 2002:a50:cf4e:: with SMTP id d14mr5716553edk.292.1632812415470; Tue, 28 Sep 2021 00:00:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632812415; cv=none; d=google.com; s=arc-20160816; b=usZF19nx0ON2ZRsdRWobMjpWlH45lvYBB6LBwe8nfkPwIGJTzuQlz7gCwyKGxIA9aR TMTe4NVmukYAN/7bDozM2VMKCuiOKy+0y3Q87y3rYE0KJerQHQtXhZQt3bDQ6U7iSzQI WGN/Sb/Tp0A5yWUAAD7r1OkE0+kw92ndaLmn8O6yeGch0vQLV0MVDNkDV2rU9+/eQPEl 03E5u8J0enZDjB9Kmthx0Nb4SVhIyCuBYbRTPbAVobSz1LjV0oSHkoW7I5n03tXH30/S psZ17rihLcFuqA9JXyNVOQKl9zXbbstsIIAsAuOc2HnJnrHBOCT3w2cHOgy22lukxpBp zsJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:dkim-signature:from; bh=QZCb/11njLsdjEVo0oDVQzU+6og83cG38/ym01MM/E8=; b=OHaO4/EVPRxlbVZ4cNVBf+j4r2VDScpcPLytWhiGJP6DN8Ibj8BjpqS/kzYDZVHHd4 5363zqSI/ACK80MgTsGQ6lQe2+Vu4+MMfb1hhrTHZNyoRUw4XUbkQ4hZ/6Qo1mFqKPMD JbQcdlBKuCZLqnOdZOqvAKPUBk9Ep1NVw9TTOMWabarzPmvjkieHfVPzV3/zTqkkf/aQ fhacPXr1r1QwXOeJOuyVp/fvAt/rTRBGl59qNOGcFNYsVO7nEyH9vK+fD3UZwMvDBTBU F02CgbTBo4gBybkYOnUjl220KIxP/SEFzdtG2CIbuwwGzB7uJ19ZzgvVY7MfTeKExkU1 wP/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b="r+jxOP1/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si23688147edt.211.2021.09.27.23.59.52; Tue, 28 Sep 2021 00:00:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b="r+jxOP1/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239111AbhI1G7l (ORCPT + 99 others); Tue, 28 Sep 2021 02:59:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239116AbhI1G7a (ORCPT ); Tue, 28 Sep 2021 02:59:30 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6192FC061604; Mon, 27 Sep 2021 23:57:51 -0700 (PDT) From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1632812268; bh=5SWZyzA521WWQk9YTYVm2Mdu+LIwCBNb7lp4LyA75Jk=; h=From:To:Cc:Subject:Date:From; b=r+jxOP1/u9niWBn9LKuOFrPS+ujmSHdyBGMjAuT1ytivnFws7vg08U5cJmDwwc7D0 yZixcjRo4NMtViGVnWFtp9F4NPT/nXlUKCJdP+swz/P/GeleZkN7y+YfOWcrnMWsU/ ETUgUnnYT4nqFiHlQLZTPzbkvN8Pv/fZBXQZwDxw= To: Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org Cc: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , linux-kernel@vger.kernel.org Subject: [PATCH] watchdog: sp5100_tco: Add support for get_timeleft Date: Tue, 28 Sep 2021 08:57:35 +0200 Message-Id: <20210928065735.548966-1-linux@weissschuh.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tested on a Gigabyte X570 I AORUS PRO WIFI. Signed-off-by: Thomas Weißschuh --- drivers/watchdog/sp5100_tco.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index a730ecbf78cd..dd9a744f82f8 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c @@ -10,6 +10,7 @@ * https://www.kernelconcepts.de * * See AMD Publication 43009 "AMD SB700/710/750 Register Reference Guide", + * AMD Publication 44413 "AMD SP5100 Register Reference Guide" * AMD Publication 45482 "AMD SB800-Series Southbridges Register * Reference Guide" * AMD Publication 48751 "BIOS and Kernel Developer’s Guide (BKDG) @@ -144,6 +145,13 @@ static int tco_timer_set_timeout(struct watchdog_device *wdd, return 0; } +static unsigned int tco_timer_get_timeleft(struct watchdog_device *wdd) +{ + struct sp5100_tco *tco = watchdog_get_drvdata(wdd); + + return readl(SP5100_WDT_COUNT(tco->tcobase)); +} + static u8 sp5100_tco_read_pm_reg8(u8 index) { outb(index, SP5100_IO_PM_INDEX_REG); @@ -386,6 +394,7 @@ static const struct watchdog_ops sp5100_tco_wdt_ops = { .stop = tco_timer_stop, .ping = tco_timer_ping, .set_timeout = tco_timer_set_timeout, + .get_timeleft = tco_timer_get_timeleft, }; static int sp5100_tco_probe(struct platform_device *pdev) base-commit: 41e73feb1024929e75eaf2f7cd93f35a3feb331b -- 2.33.0