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: 10211471 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 C12D6602CB for ; Sun, 11 Feb 2018 20:24:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFA0C28A5A for ; Sun, 11 Feb 2018 20:24:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0B9628A9C; Sun, 11 Feb 2018 20:24:23 +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 C110128A5A for ; Sun, 11 Feb 2018 20:24:22 +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=n5DeyfRM2drrxYJtWmihsyFC4Q8X8fj9dvSkqaf0dVw=; b=Op9OWTVBv3+e9UksxztvICmHXF gOoAlxfY2jZgH+si1XnTwcXFhUR7S/d47ZYWc2chL1yA7gaonqnRMrrf7ApzJEfCjNG5X7iGXj5tW hfWzz4O/szWU9jxUpZkFkkcg73XS7aZ1cTjqS82hiMs2dXkcrW3Fj97bg/A01XIHBhHXohj8b+/IS hEQ3AL8OOi9uxOy9LQkGEw+5aAAlyA/LTHRJomvdm2Kqe9DFt64o1akxCONuh45jqi8PnzUb87e2R 0MHQJm6s7rqmC0wmYHM9WfOKwwomIvIAtcyfjq7csY2IGlgm6FqNaSWFOsZnBJS7IE839BfssFOW6 scXya9pA==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekyAX-0001fH-PE for patchwork-linux-arm@patchwork.kernel.org; Sun, 11 Feb 2018 20:24:13 +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=n5DeyfRM2drrxYJtWmihsyFC4Q8X8fj9dvSkqaf0dVw=; b=TJUZGSSSFOLVqHPze+6m42wMiO JA8CHhrQ8R5muekEuYJJlkHMsws1Juv4hNY5o/Xr7z3nMcYSOmbqnlPz6+xCPAeCi1P3h3THspeka OytU4Awd2RVLwSXPNGmiXxNlSu9UbAntWQXIfwAbQWDdb8/EcKSrcJ2jVx0IeLZ14fOZqg00XD8fb 0JUkoWxm9nw2oGXiiR7DxZ/UBpOUNXnncpE2a1R2IV2ADsiaxNe6ogukEntdUgBZgYTBOcjekPCIa zu+n0i5I7iceiSSaCfsIgXQBVt7K7EWMh/tTvkMp5OkFUCNMtjR3gfynYORXYsk2Vb6K6SrKB4G27 pn5uy+9A==; 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 1ekxwh-0003bl-Ff; Sun, 11 Feb 2018 20:09:55 +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-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 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