From patchwork Sun Feb 11 20:08:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10211435 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 6821C60467 for ; Sun, 11 Feb 2018 20:10:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 583C228AEA for ; Sun, 11 Feb 2018 20:10:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4CE2028AF5; Sun, 11 Feb 2018 20:10:30 +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 A963028AEA for ; Sun, 11 Feb 2018 20:10:29 +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=xKXiHByGnHPEjt4ffo16t2za8zKX+eQWMyxzk4nVIqI=; b=hlEPg3SoGtMrHpnxJaO0aDFidm qu2vRgGdQksLD3eeW/5J3E0L6NqvpTHnvE+YCLyq/marSmR30LNjdeEnvmwcMBvmdU/y4/AM5X/8C WtFHx3Qify8yiXhvHUuim/8tJV+0AD3R9kpfk78pFNjbkVNyWQt7CwaKeegKUQW8p5qMQx3awVEAs 8/XHUaIaoanasYzWB+W3ny99KmEVFpeheceXeGZ1OtCo4z6/S+//bGaEqCGUd6jX6kDLkd3tfVd5K W92qDCghYNhjH0MmEn/yAOD3xrwioG3Jqw3TQKWf0n7sILxv9cxPw5E9GOwcenTPJYu7G3iSW5eTr 2xzkrOKw==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekxx7-0003zL-V1 for patchwork-linux-arm@patchwork.kernel.org; Sun, 11 Feb 2018 20:10:22 +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=xKXiHByGnHPEjt4ffo16t2za8zKX+eQWMyxzk4nVIqI=; b=rDVeCyqfYDXZx0QRE/qtJvv2IC J6UiIRo3bs4v5f1GkEWBD+5oAHG7JjNbu9+au8eYz4DcJH39raKvojuPiF1kreJBA1oaHG6qBG8hF SLvNhz4IPLGmfFhfkiYrz62cT1MkPhIlDCl8TMEyjFpRsEJPKXGuXcje4Utk236pHxhShQZVNzeS5 XWWgdm0Xpsk9deSucwb/QuweVBOLORC3gtze5YuI22n0epQn00R9gjDOoSHmmTFAzkLxZV4WFwMOg Sk8d1qR+qmUbCZHpQX8u19jhUMGo5Y3crUSqTUhIli0APS1EnjYzQmf+bxSPcSDa2r7K759WCESm9 L/b4p0Yg==; 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 1ekxx3-0004sU-71; Sun, 11 Feb 2018 20:10:17 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekxwJ-0003Az-Hi; Sun, 11 Feb 2018 20:09:32 +0000 Received: by mail-lf0-x241.google.com with SMTP id f137so17821534lfe.4; Sun, 11 Feb 2018 12:09:29 -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=Sds9+gzb23Oby2EhX55brmUkvpejf9ZMZqoSqq5bJPq5SVurDJohVcLGUA3tukaewM HaEpI2u+GyHHgY1eIVWGNlSw3Obiz/pxepc58otcV/2hdsYY/3qEzBAbzJHCdRCcpfMg hUBSEhUFo8BslW+XrgKA0q+wKeNgTqEIHh8DUs79QLX6gqAuSrUjDTUUGGAeTMy0/uxN hwioFEG7Y2ghuWqeag9ecC3E6a3DE4PNnMiYg5o7G4Pp/vzmp/Ei7ZbLmCDRSp91N6L9 JX7XudcSaFumqgiUGsMsD3s6H89fDFR3OI5q7h4RDvLPTMNDSI3Ij1T1GY0F/b5Fzi4D swKg== 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=qZd2/Yr5PzA62u7qyaDiVSOEUDgcQ1wVDztXbNyENGjo8wVf4688PsdQLhmSEJzXVS 0N+Txcqzp1p9nlFjDAocil6KfYIXmoAHHAJYWdHSHDAOklP0dm22J37PwDf1Fz/NLj62 6hD8n/Z2R/sAbvWHfTYikxT56qE7ClPXaGW5PEB/vwOK1rAbgNSVJrGiF9f+y0VuKw73 dEpxzyGi1dBHzHvHyc+r16XulH222aHqgIlK0dSwTVudMzaUjRDNhrFrFv20XIQfBV4w fXSaeKvF+3G9TtHak7gVkfor3vTlHw+TNIijNWGYyQhYa8cQm7bXVoRnOriCTyYWSpka SLAQ== X-Gm-Message-State: APf1xPAv0n7X0tvmrMdgNWXIIqWTJrCqhK6Hky7Jv9TLohuuh0jpixak CDYy3llhKnrHz89Dwb7oGaQ= X-Google-Smtp-Source: AH8x2276wwAj9oIemnSI6ovFprl/2GN3JBMKsvyO39cov8cHUWXY9cgQXjLxx50FiuTgwtFgr1CIhQ== X-Received: by 10.25.25.208 with SMTP id 199mr6142332lfz.146.1518379767809; Sun, 11 Feb 2018 12:09:27 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 12:09:26 -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 5/7] watchdog: mtk: allow setting timeout in devicetree Date: Sun, 11 Feb 2018 21:08:45 +0100 Message-Id: <20180211200847.25000-5-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 Acked-by: Matthias Brugger --- 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;