From patchwork Sun Feb 11 20:08:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10211437 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 84BAE60467 for ; Sun, 11 Feb 2018 20:10:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 716A728AEA for ; Sun, 11 Feb 2018 20:10:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6260728AF5; Sun, 11 Feb 2018 20:10:49 +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 725B228AEA for ; Sun, 11 Feb 2018 20:10:48 +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=pY4yREUmCjZlk3UIixaKm2g+Ojj0Wv8RhXfcaPioUJQ=; b=AUKpMizakorwE68vWOsw2z4Fte XLE5GK/mK4inARjSrd7T5Iy36YkgLOSkjlGYF+ORwAlb+wNoOTZCPbtLT0xS1RaLgdUPq6wOCkSTd M88H7jL18tfKoxa/Ng6r166gCWuAVA4Xd2xNmtCVGT67SLvl3iG1UAGmlu00Cv7NRL7bKx4DfwoXc RqD3d+G3q8gSDB10LHtMEtqq+YhJenrHVXmihk1t5WHnh9mF6guvDZlSWCSnTcFh7dRhDK5eM3omx PShx1D5a2F2OV6vHNdKvifyhYffWzfkRMAFP8n6DDMf28MH+klCVYzkG35k3gh20a6dih4XgUv+o2 SCJ64PXg==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekxxO-00044u-LD for patchwork-linux-amlogic@patchwork.kernel.org; Sun, 11 Feb 2018 20:10:38 +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=pY4yREUmCjZlk3UIixaKm2g+Ojj0Wv8RhXfcaPioUJQ=; b=GTakURz0TaZPXuOyjFUdNG48OK ofa0RNuHE3CBTDviRvckFs63Sd+c28cio47rFvAzK7O5Dn66Y15FIhZPJVFEQaBXpt6Z5EM0pZanL N6TPTWo0uq+zr67fryxtcBnQRPquswdAwVduLlh0W3gRoBpo3QtvIB4+/LjanqVPw5WF99aVIe62L rT3mQMIEdZ6vwg6MhIxwVW0JBP7uzSbAlCU2p59E9VFHqg1vjPtf8ZZc2lxf5Pq29QN6TWhKV09U5 96yJvtIpzE5Ky/RNAKGbipi7+TWDIU72+gmew9xlXbsw6CKZHeBtrtyR1RT1rBBLzFEIVkRm1papW zHYJGyxg==; 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 1ekxxH-0005gA-OK; Sun, 11 Feb 2018 20:10:31 +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-00039j-Hk; Sun, 11 Feb 2018 20:09:32 +0000 Received: by mail-lf0-x241.google.com with SMTP id h78so10631138lfg.6; Sun, 11 Feb 2018 12:09:19 -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=f9YL/tlwKNxJT86apGY2qKDLMi2t2gIWuLtfoomWQXlt/e+QJG+FBVZsxWJWFqPNOB ousvxk6WpbaGI7N0njgkc2Ga8XEpdH0oY9WjmBlDfsFk29a+Y7Qyn/Zpdnkk2u/+C40E Ax/R8YbZgG4BugVgoddD6mJiLAHBgGyzbUl4r1UGT2rZXmfYtuTFWBJHpZYHsmEng4LS UDlQ4LWayJgXzoDkQ1cEk+HVChcdjhUQIyHDh1KpWWCYMBqw3cQkwWEAPHtIHH1MJdMC 6K20WyPliXl2gYzF9HzqajFVMCpFP/LacyEEytRQzssyekKIFgBcV4Yd1QQGWanHtUk2 YoLQ== 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=kfgJLNN6iVAgpzpnMeRTiIeBRRqyqSjLsZsxVxSJxkpaMyxrrMFtbG0wH9E/vTEuMt fS8rFNtRWwwjCY2T3JE/S/VJp+/P9fabUjqP0/+Cqkedv6whqlVJr5IeEMO3rz2cVOef VxWnL9fuVwqiTqeEnK1D6UhrbMax2Y6B7Z3TdmV72EPSsq0C0F5X6dRs+w7fiL4DcV5W oIAYW9pRxNbZMJFKKznB/RamQ+HvHqsHO9b6ASGWZpcE0siasNsZ9jmr+46bMbO4juN9 1tnhmvqkQZNvx8BsQcw5Kk1x2ZpSb6iI9F1YCGEMrb7EawxY83rFrKQO7wGnTwTOgzv+ p8Aw== X-Gm-Message-State: APf1xPDHQQHX4wCSlsmCwt0xySAHcPbNKN3zF5t6CupN2o9aOMVvwHNa xy5Z6PUS+l66jmC3THwjvb8= X-Google-Smtp-Source: AH8x2253GLP9FEozWkGj4+0Ew0ACAFo22wmx6hZ/eFgq6JoX1DhtL/eKOBC8tBwgg9n5+jQt6PggAg== X-Received: by 10.25.0.20 with SMTP id 20mr233158lfa.69.1518379758239; Sun, 11 Feb 2018 12:09:18 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 12:09:17 -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 2/7] watchdog: sunxi: allow setting timeout in devicetree Date: Sun, 11 Feb 2018 21:08:42 +0100 Message-Id: <20180211200847.25000-2-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 Reviewed-by: Rob Herring Reviewed-by: Chen-Yu Tsai --- 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