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: 10211449 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 87C2660467 for ; Sun, 11 Feb 2018 20:12:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7778D28687 for ; Sun, 11 Feb 2018 20:12:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B6B328AED; Sun, 11 Feb 2018 20:12:34 +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 D351028687 for ; Sun, 11 Feb 2018 20:12:33 +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=yC46pWg1gVhOCCuVqY7TUVbvyehUy3wW8RYcUPAaebo=; b=qX2AHCsHB5wgJ/852w30IPBKnA GSTjqQeKP5R+NDntvMMxGmQxsDr8NBTXlZxvoP6uh5heqil/Nj/fIrEHU/QeuXn1nMqr1naJdSfnF 2sxDDnL1rFaCghJ+bnPLt39KYpMjqleLTQ6BzupZEHY4bWyFTJVyBAPlAPzZbLs059/hxWgrHAzgB +372QrDQAdYLosdEf18gk89+aTavY26tx1nnYssC1Yeu6r2enjq6PywLat1Yexpetk0LWCIp0VnVV uEE4A1YCdojzHO1T9EfQ5nam4mHZ7+t0F1j90vwg5lsBr1UyULHpeFnK9LjUbLHX09IwaFM588O2l oJYXW+5w==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekxz5-0004qq-AK for patchwork-linux-mediatek@patchwork.kernel.org; Sun, 11 Feb 2018 20:12:23 +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=yC46pWg1gVhOCCuVqY7TUVbvyehUy3wW8RYcUPAaebo=; b=obSQ2f5AIgrQpd1SKC4paeRygh qztZE1EBE+c1rNIFcnAKmiNLzNXI8M1euyzamNFdouRwh3UjKEJ0W8Te6vWrnGg79WJ4YRFuzr9C1 pkkvNCYMQbkE7wW8fCkb8GPAsDG7YAqz2xdue655M7qZce6gGRVqm7or3zWrFunj7i4hDWW/cA60I Bv47EAjqxEeTKk/pz6ZwXFyGMeUAjoWIoGMontA/YLl+/vxdYG0EdiM7EbHHmuYiQAnRf0plIKwil IiD++YxqXPfsrSmtrJ1VWK2fFLJ1eG8NxY1AqyCZL/JTiHlZEXpBXe4tyjynsLlpgutctIJhqKq6p 1CGmXBFw==; 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-0008KO-MW; Sun, 11 Feb 2018 20:12:00 +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-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=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;