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: 10211439 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 D709760467 for ; Sun, 11 Feb 2018 20:10:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7CE728AED for ; Sun, 11 Feb 2018 20:10:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC3B528AF8; Sun, 11 Feb 2018 20:10:54 +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 1F9F028AED for ; Sun, 11 Feb 2018 20:10:54 +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=eIp0k8qKYKYPO57LCyVrspPz3mNXRk9pk7WYEiyxDFA=; b=BDM5sITbhPT8J6trqYwwNc8HCY s8JZbdPr7HERvpLXNurszEtx+1QL3EzzPKUyX7tKKLjMpE2wSJnpif16r/pTlG/oGmJGZonANuY9/ ijbTvmSypGw+XOWlXIxSg5UvXRZncWAnHjVaQMFcIsYaSUCCmO4XHCg/5vE5BRZ+C7I1y67Q+HXeo RHfGGpNU/lNKd1cP82qaVLtH7cuvYHRx6APEcv3r0SZAZUcda4GZuJGFQf2h6yzFcbvRrklcoDNtY hZmCrQVILhlfzX9W5t/dZJZpHLCRUbMvW6Xq6rH3d6vG14Dh2s8yNE6osMBbM2dd+tzNX+C7TdjOC ahuLydCA==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekxxV-00046X-7P for patchwork-linux-amlogic@patchwork.kernel.org; Sun, 11 Feb 2018 20:10:45 +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=eIp0k8qKYKYPO57LCyVrspPz3mNXRk9pk7WYEiyxDFA=; b=cBSIvVT0WIkmZvLtVyzgwSMlqI zNX7+FHlwwnwxFebH1yrjaIsGQW3NFZjHOumw5FG5ajbFNaiBKELiYniCQZp4ax2kZSPGnJ404kf5 cv51vUnwW/zayN78Of0Qf1Ire8BmsW4uVfO4HfLdD4S5Mln5X2vDqAhkYlyEuG2Or3IeVOPHgcj/K B5yeYjeUuzinOaH9WbqGPaM4rfeors7patSIhelxDR2mxCy50UgyYMixfd1ucPxglTeU2sa50yxif sGCIaU7k0+icOWq/Rvy9l6FHmSn2McMR+bcbQpgLpQL1LS4Y/DBtjLzJwyhlwDDPi9DOuKtBmyzAh uxZk8XAg==; 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 1ekxxL-0005nH-BJ; Sun, 11 Feb 2018 20:10:35 +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-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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;