From patchwork Sat Feb 10 09:19:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10210439 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 70F5460247 for ; Sat, 10 Feb 2018 09:21:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7609E286B1 for ; Sat, 10 Feb 2018 09:21:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AA742968C; Sat, 10 Feb 2018 09:21:47 +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 1EDC5286B1 for ; Sat, 10 Feb 2018 09:21:47 +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=YWsJ+wMrS/d4NNPeQhSCVLj88q0J4jv/tGHLltrxPjE=; b=oLpNp+4uS6JjefJt/MW2QaDs0s 2tdECNFLdk8dPtX/QCOvlvC+iJDOCu15Un2+6Dcp5uf6/654yDXxAaMS2XkUAoNVHp9GhfqpCytFC d9QY45lH7c7QvOF//SBQaq3AOnR0mF5ZvLpO+7PhKJOcv2Fn1wi6SQUCDZwABuPZd6IzWCcTcgQxB 7/gM9V1x+FaEcPrWWmgcl1Cu4LKkFrrYIvo2LCq/m6Y0BA5QNm5yat4c4Me43f82SQNX0YItowO9s GoHQ5Ge5TsLi+Y5DpbA5AaGbkxLxp2ZwDhnm5OqpHk0UFn2aBa9mPYXja6iFRORL8taM7TW5ESdvr bEZXNuzA==; 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 1ekRLs-0008NB-Nt; Sat, 10 Feb 2018 09:21:44 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekRJx-00057A-H7; Sat, 10 Feb 2018 09:19:48 +0000 Received: by mail-lf0-x243.google.com with SMTP id a204so14371222lfa.2; Sat, 10 Feb 2018 01:19:34 -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=8YcBHPSO6OHE3zPi/Lolt6I4qqC5i6SjQDa3lBvJSJo=; b=HeDMO9Z0bNlTCCfLfkhE2gODToljlbB4Am8Xtss9M3w58w/+h3EtDki53xSTQHkJ+4 8esPGC+stZ/kWHnZx9uNKQfiUW0elOrm+IxirLrGeea+HwegHVOS3mo7E1aj9QZSC6Ls zWfAkgKLQYEisvX1hdLX4EXcQo45OReQIvXAtlcyY3n8IFuOH2+o+6gRQpnHtKK5ViZ3 vrdkWE4lkhQDfyUwXXVXw6LZcKt82j5QuAgu1KEIcJho/mc8FWtE/11zHXf/RZW7Pweh IY+rAcu77CX6wVG754KcxQWMvaydxxIuj2ytq5bf332RcyQG1yIHcKcaQVkt0ne3l+Mi e0hg== 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=8YcBHPSO6OHE3zPi/Lolt6I4qqC5i6SjQDa3lBvJSJo=; b=dq5jKa2o+V87YL9lbfmF0DIsZOWYHp5vnlXNvJVSn45Yqg6CoFXrnJ1KlDySGWFL35 P7v+lG+igqulsSfLcUx1UOpCtrqOxpG/ZCsm00TCNY5jwGbKiv608ClS62G1vDdJs7hM gAvU3V8eJod6x5qcFlJsnhe8kL8cHmjRqOIASdCYUy/1SLxp1W9po9mEiVTcUpuNJq9Z NROBXNDeNmFnEBC0yVkqo2QhVgaAtWbwihGOyED4Gl8z8Yxip/Rkv3y/jX9SfZaf1/wA C55BS5a7aSBBhaDA1ADRd4eCiu3dl4Tyv/v+3KcvuziMqrbEHS8hBlRsFjzMxEAvTscH rpYA== X-Gm-Message-State: APf1xPDsitwq2hHGdDTibpzvRJSwhURVFrdsuZK83evtfKUqGyI7Q5t5 3HWPMGz48ePSg8irXxgAF20= X-Google-Smtp-Source: AH8x226MRmI3n+PzGpr6LNKDv2FyGCRf0ljL/BSFYo3iKXAzdtmd4mgCqikOikbRe7MRluAyEbyHGg== X-Received: by 10.46.99.135 with SMTP id s7mr1354282lje.17.1518254372670; Sat, 10 Feb 2018 01:19:32 -0800 (PST) Received: from localhost.localdomain ([46.194.112.145]) by smtp.gmail.com with ESMTPSA id s9sm794551lfe.48.2018.02.10.01.19.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 01:19:31 -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 3/7] watchdog: sirfsoc: allow setting timeout in devicetree Date: Sat, 10 Feb 2018 10:19:07 +0100 Message-Id: <20180210091911.3644-3-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-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/sirfsoc_wdt.txt | 4 ++++ drivers/watchdog/sirfsoc_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt index 9cbc76c89b2b..0dce5e3100b4 100644 --- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt @@ -5,10 +5,14 @@ Required properties: - reg: Address range of tick timer/WDT register set - interrupts: interrupt number to the cpu +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: timer@b0020000 { compatible = "sirf,prima2-tick"; reg = <0xb0020000 0x1000>; interrupts = <0>; + timeout-sec = <30>; }; diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c index 4eea351e09b0..ac0c9d2c4aee 100644 --- a/drivers/watchdog/sirfsoc_wdt.c +++ b/drivers/watchdog/sirfsoc_wdt.c @@ -29,7 +29,7 @@ #define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60) /* 10 mins */ #define SIRFSOC_WDT_DEFAULT_TIMEOUT 30 /* 30 secs */ -static unsigned int timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT; +static unsigned int timeout; static bool nowayout = WATCHDOG_NOWAYOUT; module_param(timeout, uint, 0);