From patchwork Sat Feb 10 09:19:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10210409 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 D113260247 for ; Sat, 10 Feb 2018 09:20:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6F08286B1 for ; Sat, 10 Feb 2018 09:20:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB5572968C; Sat, 10 Feb 2018 09:20:28 +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 bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 71BC4286B1 for ; Sat, 10 Feb 2018 09:20:28 +0000 (UTC) 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=xKXiHByGnHPEjt4ffo16t2za8zKX+eQWMyxzk4nVIqI=; b=Ftdt1V8Zv1kdgqLr7DRTjtKJGW wCoMGqhXYP2T4BPNCZ1njQ5CbN9Bw05fubFae9IE93Svq05EZsJyR1m7zk+DLA+c1st9+oWLG9334 K1I5VuuHvpRKAW4kCOUYQFFUKQtn5y3zGjK3NQoVGVd6PtdGG/F+W1frmBmpxf4mlVgHkVPHbv4uu h0bvKlodqpLSwq05tqN1iqp+1p4lUIXDUQ7Xq3dighSwt0fRuVwD4fQeT0Jrw18oiojQvJAX+WECl zCeANGmLu2YzkN8oIIRWTXuoR7njuyAFu9VZgbz9vo0d4T+HGdpSpXeRELAryOmJHCnfSQ55Wsukb 8AT81qwQ==; 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 1ekRKW-0006w9-G1; Sat, 10 Feb 2018 09:20:20 +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 1ekRJu-00057L-Eb; Sat, 10 Feb 2018 09:19:44 +0000 Received: by mail-lf0-x242.google.com with SMTP id g72so14382706lfg.5; Sat, 10 Feb 2018 01:19:39 -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=j1ApF4jt8BovR70XpiAilM+LgFAzFw4UOdhesh3SFLQ=; b=YD0LoN+z3sn/F/x42itdvfkQKLf2UrpGoIjkdHt2mTQcRnvizkv4/EJe+DSsW9cPr3 gUOaVlDMdZADmiXX4qG9D368qlalLyyMduaBzPMtdaVJ/hh2ILmgyLPG0uqhWVNGQ+NN rwqqkBomZ0mXjPcqsTLk9DHRbSvIwv6pFTKUIO+hggQz93uYLNB/sRD6cdgBzi+TNWFo OkOTSpUXgGaHPlzfa0O5oNK7Li+94VT2a3TsO2V2ZIrATCGKUWmhL8tt0mROghq+y0bC +lHAFlBUILcjhvOSm0RA4aC/WQcolRnJ4SRmMn/zuymmPXuUuUpYTCpK6+sIBxlQG261 tbTg== 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=j1ApF4jt8BovR70XpiAilM+LgFAzFw4UOdhesh3SFLQ=; b=U6DaRm2LdSJ7iuzZUyaQ5UFuQuDPX8eDpoJRI5QYiGyoV948qiYlzDTpE4sxew/zDD q19bRwgzFxlVJUvAduxcgbW9akquhdLC73G7FoezefPMWWeRtmC6DeA8G8oEVpizksVy jh9xfiOlx6KV1+p/ZrCF2CSQdQRi65cjxG3SOP5p+ICfhp0tauN/n4jscc+QZwLz0129 h5FFZ18F0B//NINXLpRRCVcmTa8oj5ILCFsjtAeZlMfYlqF7CglMqqM0yDgDona6u6Rm 4M/sng3Ou5DYDt/1gbE0et0Xgr1B2cLWcIpXg5h5jIgcmSeSSpfmW0N8IUjdH6BoSAV3 ru4g== X-Gm-Message-State: APf1xPCD7TEb0tXiJVzIuTeE2RRuvMhfgs03cHFFMljbTRqVHX+ey67n tIdCiShsq/sW7iETERowevc= X-Google-Smtp-Source: AH8x224RWx+vYbVby3K45khiWAgqcCF/6fv9UhqQvPB50vRjSOaNLZiefOAisN0e+7aVHgKIU1SJDg== X-Received: by 10.46.101.26 with SMTP id z26mr3457212ljb.37.1518254378065; Sat, 10 Feb 2018 01:19:38 -0800 (PST) Received: from localhost.localdomain ([46.194.112.145]) by smtp.gmail.com with ESMTPSA id s9sm794551lfe.48.2018.02.10.01.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 01:19:36 -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 v2 5/7] watchdog: mtk: allow setting timeout in devicetree Date: Sat, 10 Feb 2018 10:19:09 +0100 Message-Id: <20180210091911.3644-5-marcus.folkesson@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180210091911.3644-1-marcus.folkesson@gmail.com> References: <20180210091911.3644-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/mtk-wdt.txt | 4 ++++ drivers/watchdog/mtk_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt index 5b38a30e608c..859dee167b91 100644 --- a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt @@ -11,9 +11,13 @@ Required properties: - reg : Specifies base physical address and size of the registers. +Optional properties: +- timeout-sec: contains the watchdog timeout in seconds. + Example: wdt: watchdog@10000000 { compatible = "mediatek,mt6589-wdt"; reg = <0x10000000 0x18>; + timeout-sec = <10>; }; diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c index 7ed417a765c7..fcdc10ec28a3 100644 --- a/drivers/watchdog/mtk_wdt.c +++ b/drivers/watchdog/mtk_wdt.c @@ -57,7 +57,7 @@ #define DRV_VERSION "1.0" static bool nowayout = WATCHDOG_NOWAYOUT; -static unsigned int timeout = WDT_MAX_TIMEOUT; +static unsigned int timeout; struct mtk_wdt_dev { struct watchdog_device wdt_dev;