From patchwork Sun Feb 11 20:08:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10211451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 03BD7602D8 for ; Sun, 11 Feb 2018 20:15:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E642F28AEA for ; Sun, 11 Feb 2018 20:15:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D970628AF5; Sun, 11 Feb 2018 20:15:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 455A328AEA for ; Sun, 11 Feb 2018 20:15:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RJlFUiWA5tAVEsx/kaqkTr8ICDQhn8kQkhKcsgnohro=; b=Du/XJDlKDCa/rAYlSb4Wtfi3cG L4YJaPR89FHMSoC4A20RskbysstOZo4viExAkxTOO37I8E+C621ZDPp0nHMM5W7X7IqG5UbnJmjKw PGA/hWUGl8B7r2KSgmJ09X5/Nl+KmpiCiaSEzPrFJECxAd+YxsJX8H7v0x1XA1NUAoGOznmN3z9ec RLBI4sCLZg1kRI8OmyRmd8jj50G1RC6MEkVykmIws9+4AoJAhMJbAqQSVlqIPYlKvjb0VciweCH9q f8nDxcpAj2QvQURqUqScSx6uY99n0/QklwdaCZhPbXWD1B4KTDNAFkZubNIUkmPcELNjUnf6mNkJd qmQI9u7g==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eky1s-00067K-5s for patchwork-linux-arm@patchwork.kernel.org; Sun, 11 Feb 2018 20:15:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RJlFUiWA5tAVEsx/kaqkTr8ICDQhn8kQkhKcsgnohro=; b=N3Nvx4C9fLm1eH6Q+TxGTP61IS PH8r7sRKEWFt6pItpkL9+LKWBEfBc1i2WW9FmKV28fTNo6OQi94tHYXWG5RHZzU82BAvRmejLEan4 tpPBfYJiEF/LDJzQfHy1rRLC1QaN7LHYxzXUYi9N2kQuXI/WJL6ocDOHMm/w4VqxiR+zwlVbc0Obm +3fbzAKSTLCa6sj6RSA6bV8jkryFsi6A/FFF18nurJJEADIbBSVZjk/c9E+WyM9tLZAlUYIWPq3YU GQnz3GGXS2u2X1I5BJUJkGYIuv88tEz4dMWTKu1Wh03qOBfDBLndtgTf+oc9kYAxEmXkiSVR16Mdf 6XooFyCw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ekxyI-0007Xp-KF; Sun, 11 Feb 2018 20:11:34 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekxwU-0003BQ-Iq; Sun, 11 Feb 2018 20:09:43 +0000 Received: by mail-lf0-x242.google.com with SMTP id w10so5031522lfc.9; Sun, 11 Feb 2018 12:09:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VrGv2WvWQyUe4izivlUHGcP2xc0NGjrT2z86wIJ1iPc=; b=suSymsmYAmG1bM3WCeVvsTW6Tj53SWUVeyyjc+tY8D6rWukXo91iCDcUdJmPT7mbrn FG3UVwCXxIDK6mNjyoKFIi2oJ/J0j3nVZgmmn2tWTQeQgoCcSrwutUtUdREzSdgrY12D H5cZvqYiStj+6fQVSdkK2OYhWel8UXpMwRof89a82PU9gZox+XN+V2xnEoo9C0zAbqBF OW91wx3JnTumQSUVrvxaDUryEKH8TPtzA51oiYadKCKSGXNPBWJvToUMVd7CO6GeiG6J 3yGnFPAffjT60MJa984zGeR8B6b+V0Ozl9m/qlrs+AgFXMicqnW8gxFK7CxPblB662xu 4ZIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VrGv2WvWQyUe4izivlUHGcP2xc0NGjrT2z86wIJ1iPc=; b=U/F3R4/dQ9BTFJ89Pe0bQYN1VnthIqYC9JiKmpIhO2316yH87Zt3Vs9QDg/qmrTbU5 OB0YhoH04h2ZFIg+ne0Brtzy0+EltVVqOTp1SY6G3oDB8ugd08ZTx/0ge2FtEOWSsz8/ 95ZZyXJ9zHRqFRLyEg6BE7h9uMKh2ORyEoJ8tnaj+3gZ63vEQB2suZvS1A6PmYA4xILt a25q4w6g37bgG91n7X5HKo7BQ3duw49xGS1t1Fpa4Hp3xvXjvBznuVtTbPDa++mn6rl9 biF/UvCdCOoLJRdp2WmW6HaTMZgDUVWFraXJYCgSlsnBDgjdh8Gu+CCroGZ4ePnABspf JPHg== X-Gm-Message-State: APf1xPBfSHuusjPMA5YPNa7u8jBAhlPobbjEcAEvWoawzwPs9dS3ngDc JRO4kjMooMxIt9UTqS3zkwE= X-Google-Smtp-Source: AH8x2254g0X9teEGrFSMJgkw2OwPx/SCjdgRN6+lXkdiEcDKclhDYxVU+xgxbLhaQp6/J1AoElZkVQ== X-Received: by 10.46.62.6 with SMTP id l6mr5992526lja.57.1518379770988; Sun, 11 Feb 2018 12:09:30 -0800 (PST) Received: from localhost.localdomain (c-2ec27091-74736162.cust.telenor.se. [46.194.112.145]) by smtp.gmail.com with ESMTPSA id c21sm927549lfb.13.2018.02.11.12.09.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 12:09:29 -0800 (PST) From: Marcus Folkesson To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Mark Rutland , Carlo Caione , Kevin Hilman , Matthias Brugger , Barry Song , Maxime Ripard , Chen-Yu Tsai , Linus Walleij , Vladimir Zapolskiy , Sylvain Lemieux , Nicolas Ferre , Alexandre Belloni Subject: [PATCH v3 6/7] watchdog: meson: allow setting timeout in devicetree Date: Sun, 11 Feb 2018 21:08:46 +0100 Message-Id: <20180211200847.25000-6-marcus.folkesson@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180211200847.25000-1-marcus.folkesson@gmail.com> References: <20180211200847.25000-1-marcus.folkesson@gmail.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Marcus Folkesson , linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP watchdog_init_timeout() will allways pick timeout_param since it defaults to a valid timeout. By following best practice described in Documentation/watchdog/watchdog-kernel-api.txt, it also let us to set timout-sec property in devicetree. Signed-off-by: Marcus Folkesson Reviewed-by: Guenter Roeck --- Documentation/devicetree/bindings/watchdog/meson-wdt.txt | 4 ++++ drivers/watchdog/meson_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/meson-wdt.txt b/Documentation/devicetree/bindings/watchdog/meson-wdt.txt index 8a6d84cb36c9..7588cc3971bf 100644 --- a/Documentation/devicetree/bindings/watchdog/meson-wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/meson-wdt.txt @@ -9,9 +9,13 @@ Required properties: "amlogic,meson8m2-wdt" and "amlogic,meson8b-wdt" on Meson8m2 SoCs - reg : Specifies base physical address and size of the registers. +Optional properties: +- timeout-sec: contains the watchdog timeout in seconds. + Example: wdt: watchdog@c1109900 { compatible = "amlogic,meson6-wdt"; reg = <0xc1109900 0x8>; + timeout-sec = <10>; }; diff --git a/drivers/watchdog/meson_wdt.c b/drivers/watchdog/meson_wdt.c index 304274c67735..cd0275a6cdac 100644 --- a/drivers/watchdog/meson_wdt.c +++ b/drivers/watchdog/meson_wdt.c @@ -36,7 +36,7 @@ #define MESON_SEC_TO_TC(s, c) ((s) * (c)) static bool nowayout = WATCHDOG_NOWAYOUT; -static unsigned int timeout = MESON_WDT_TIMEOUT; +static unsigned int timeout; struct meson_wdt_data { unsigned int enable;