Received: by 10.223.185.116 with SMTP id b49csp21791wrg; Sat, 10 Feb 2018 01:23:11 -0800 (PST) X-Google-Smtp-Source: AH8x226sjYlL3zTcWKwZw1DgCpN9zAQxEOHccg3Hg3BYxV0VRYXlmEPnUj6cdasC8vMAVLH1Zvve X-Received: by 10.99.143.88 with SMTP id r24mr3183634pgn.375.1518254591167; Sat, 10 Feb 2018 01:23:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518254591; cv=none; d=google.com; s=arc-20160816; b=P98JHXJF39L9C4YeF1CsaviJ8JwbYK6AQcIWaQvd5E53YZQzku5kJsVdUQ8nGvFFQt QXXgnuXGPKZ6XZRVUxwkSb6xWBAColp9AyL+GRddaac8rpZRgxpR+z0GU2j07xoZNgYY 847+XcZWs4iH4EkXjMwnuFoWk7xzH77zSgmVYbdWZhEgoO7y+83wdw9Uthud8Ja87d+3 /np1gVnS3Y+qFGWTgj9Szow3ArA+O6Gr4yf95sLQxNgaJ9rd127I6FigFwIqrG3X6VGR sln7U7ZSm3R3eZej152406/K+EpGdl+M3itdESDE0GeHws8Bxx2k3I5BxbJIOdPEvhGi p1MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=C6u9U04gWgqIMOXZt9ZIOZ9jsu6XW5p1uuJvRU1OXbI=; b=kOXtY7+XzMmL4ydVNE8qp7ZNAoHfjMwjVbELhxCqEnhy1attCUbFzi/wV5zNtX3rRd 15pUixfQPY6ABMH2xidv1M7bUn7bSExFTgJmbvPQadMkan4D458wRkDSkxY2e6Njg9jG QkgC/NTcYUNm5GrfmzRreSXLT4f1Q8P0Ed3KvDKp8mkxmy9HqOhT6ep3nL/Jg0v6q8Vb u0drZKAaxv739M4+boF0+4P6WCWhRpqAN+g2NLsFcayUbluwBxp0VXyVIUjWGEI3PCvd FZVyPnYOdGmzUNLql5ZT70rCXcFq69jsfscqLGlHTjifX8FKgO77jLzg8VrBOtezlvs6 h5hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A6kQTFon; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o86si112788pfi.370.2018.02.10.01.22.57; Sat, 10 Feb 2018 01:23:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A6kQTFon; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751695AbeBJJTf (ORCPT + 99 others); Sat, 10 Feb 2018 04:19:35 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:42429 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbeBJJTb (ORCPT ); Sat, 10 Feb 2018 04:19:31 -0500 Received: by mail-lf0-f68.google.com with SMTP id w10so1596039lfc.9; Sat, 10 Feb 2018 01:19:30 -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=C6u9U04gWgqIMOXZt9ZIOZ9jsu6XW5p1uuJvRU1OXbI=; b=A6kQTFonyCWdZ0069QMnnKdpnq8E09NnzNIWCjIfVykAnRm7HLLEOiQEnduU11wXM2 xGBRG3XX37v0EnTcVLhWWc6S/5I2zRwHZsVBUeiNOA7qH4bUbWwQt81Fb6jLeng5YN27 rTSYtZYkS7iTW1bqSrGb0znpVjj0WTIDO4mFNwR5Gmuf97w0+M0iMv0m11alaSIF/Cte XxxvE+3X+/mgOBEsmZCxuBTJQhM/64cWHXvjP7lun7F7uRp/dEN9hJOtpjywEsh6EHC6 Uh1qBHYkw5695PUHPwvUod2jR0FtA2jB1m8wT3bzE/GjFKS0AdYVPB1GzF78qVZEX0s4 7XQQ== 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=C6u9U04gWgqIMOXZt9ZIOZ9jsu6XW5p1uuJvRU1OXbI=; b=a/YGvHZWQ/gANjeONq+A/bxkRiWlncjqPYfMN/9d9k3+wLwTDFQXjOuCl3GBf/upmT 9KZVPh2ySEyL9FBmaqfHv/Gf+Y4jR1TCZwA0xaTjb+mLY32z6t1mqfgmyubX+A+oUOa2 8YFaktTj9zvTEIwsMnvH4z+Llys7VfDIFhCamSSu3z3YWd067gjwZyhDVuqzeR2USnFe iSLlwGJHJ6XNs69oeGtT6FO8hMogrVNArEOjDIwZHHIiNEkKdoYvjr5vFdsadEB/aLIg y0aMLa9ACv5MMTF53ZIjIfpY0PIHkXx3t5Kl8NQIIv4GbQHIE2amCdrQBvPLGMGjPNP3 Qyfg== X-Gm-Message-State: APf1xPDbB7YJQKdIhXym00G7WkYdekRuh72CokAxIZR+2pCg1/LIIUH6 5sB8JhIU67EAyrKAchIHxtA= X-Received: by 10.46.80.88 with SMTP id v24mr3864698ljd.86.1518254370179; Sat, 10 Feb 2018 01:19:30 -0800 (PST) Received: from localhost.localdomain ([46.194.112.145]) by smtp.gmail.com with ESMTPSA id s9sm794551lfe.48.2018.02.10.01.19.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 01:19:28 -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 Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Marcus Folkesson Subject: [PATCH v2 2/7] watchdog: sunxi: allow setting timeout in devicetree Date: Sat, 10 Feb 2018 10:19:06 +0100 Message-Id: <20180210091911.3644-2-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/sunxi-wdt.txt | 4 ++++ drivers/watchdog/sunxi_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt index 62dd5baad70e..49900e72f6b1 100644 --- a/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/sunxi-wdt.txt @@ -6,9 +6,13 @@ Required properties: "allwinner,sun6i-a31-wdt" - reg : Specifies base physical address and size of the registers. +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: wdt: watchdog@1c20c90 { compatible = "allwinner,sun4i-a10-wdt"; reg = <0x01c20c90 0x10>; + timeout-sec = <10>; }; diff --git a/drivers/watchdog/sunxi_wdt.c b/drivers/watchdog/sunxi_wdt.c index 9728fa32c357..55f166bec0ca 100644 --- a/drivers/watchdog/sunxi_wdt.c +++ b/drivers/watchdog/sunxi_wdt.c @@ -39,7 +39,7 @@ #define DRV_VERSION "1.0" static bool nowayout = WATCHDOG_NOWAYOUT; -static unsigned int timeout = WDT_MAX_TIMEOUT; +static unsigned int timeout; /* * This structure stores the register offsets for different variants -- 2.15.1