From patchwork Sat Dec 11 21:26:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 523346 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1109CC433FE for ; Sat, 11 Dec 2021 21:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbhLKV02 (ORCPT ); Sat, 11 Dec 2021 16:26:28 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:2584 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229615AbhLKV02 (ORCPT ); Sat, 11 Dec 2021 16:26:28 -0500 X-IronPort-AV: E=Sophos;i="5.88,199,1635174000"; d="scan'208";a="103588517" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 12 Dec 2021 06:26:27 +0900 Received: from localhost.localdomain (unknown [10.226.92.13]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6F2B44106FDB; Sun, 12 Dec 2021 06:26:25 +0900 (JST) From: Biju Das To: Wim Van Sebroeck , Guenter Roeck Cc: Biju Das , linux-watchdog@vger.kernel.org, Geert Uytterhoeven , Chris Paterson , Biju Das , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: [PATCH 3/4] watchdog: rzg2l_wdt: Add set_timeout callback Date: Sat, 11 Dec 2021 21:26:16 +0000 Message-Id: <20211211212617.19639-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211211212617.19639-1-biju.das.jz@bp.renesas.com> References: <20211211212617.19639-1-biju.das.jz@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org Add support for set_timeout() callback. Signed-off-by: Biju Das --- drivers/watchdog/rzg2l_wdt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/watchdog/rzg2l_wdt.c b/drivers/watchdog/rzg2l_wdt.c index 58fe4efd9a89..c81b9dd05e63 100644 --- a/drivers/watchdog/rzg2l_wdt.c +++ b/drivers/watchdog/rzg2l_wdt.c @@ -117,6 +117,15 @@ static int rzg2l_wdt_stop(struct watchdog_device *wdev) return 0; } +static int rzg2l_wdt_set_timeout(struct watchdog_device *wdev, unsigned int timeout) +{ + wdev->timeout = timeout; + rzg2l_wdt_stop(wdev); + rzg2l_wdt_start(wdev); + + return 0; +} + static int rzg2l_wdt_restart(struct watchdog_device *wdev, unsigned long action, void *data) { @@ -160,6 +169,7 @@ static const struct watchdog_ops rzg2l_wdt_ops = { .start = rzg2l_wdt_start, .stop = rzg2l_wdt_stop, .ping = rzg2l_wdt_ping, + .set_timeout = rzg2l_wdt_set_timeout, .restart = rzg2l_wdt_restart, };