From patchwork Sat Feb 10 09:19:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10210405 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 DE20560247 for ; Sat, 10 Feb 2018 09:20:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3661294BF for ; Sat, 10 Feb 2018 09:20:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7D0F299AB; Sat, 10 Feb 2018 09:20:00 +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 8BACD294BF for ; Sat, 10 Feb 2018 09:20:00 +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=n5DeyfRM2drrxYJtWmihsyFC4Q8X8fj9dvSkqaf0dVw=; b=Q85aTKdtjBEtnXOczNSKze16qF 1YOyc2PCydmFfjrkEQNmBqnTrvERdWsKqir4vGd4bHamppN86NjfF5zU0o/TyDxpHGmyXKATl8S/6 oSIXxhwNysDEM7IQgNPCPki8tMhBUt654fGicBeUH28p5AARs3obMyyagvnLKhOvLpbuzkTwYSv6u 4aOm449zArXblOBdaQU8OjBx9FnajM/rAEYfW+PDhEoOl2Rr2cEXkh0065K33KhK9s0o7cHlu/Lt4 hwyBlZWphPoDIM2rHOpAWAfBzzWCFzAcnVHPzcSA7SLtaJJaFho2Y0yFtIqae6vYqLWtZ+x+f6ehN lqpxO+7Q==; 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 1ekRKA-0005Pd-Dl; Sat, 10 Feb 2018 09:19:58 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekRJu-00056z-F9; Sat, 10 Feb 2018 09:19:45 +0000 Received: by mail-lf0-x242.google.com with SMTP id t79so14388963lfe.3; Sat, 10 Feb 2018 01:19:31 -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=sav+Ucdqs1xBNJ2ZCj6HGRjkaCWzdj9azTfQ9JXmx0+iUPZGdOukRQ9G4FcSM44/e+ IZOyMXUo+jihYNBeB+V+gy0aruec6b3ooLX/LyJ8UWJo5fthD6s6NWdpz8m4dxV9pf4Z CyrCsPgXyqXIEwfBmyA0DQU7k2PLPahUTIWzsbwyQ9/NGO9E08I7xh1Sw6i7KtKglzUu cLcQP9yc2o/bALYILHZ6+XVCHQxm8DYMxaF1uGjH7eZ9UmSFvVm21+jqTjDC6VMKp3+B cCcDp+8G+t9B8+D1gewze1961dRNNxk9c7Z2WmBoX0W+7xCFFfbgC74lD8vs990WwitE FCaQ== X-Gm-Message-State: APf1xPDuGUIuX3zxvkRY8jS+OiQXB7IJ3ifpcXqrlqP3ciph7OO/JKge sEbXjnG17/Jfcbvm3pPY5Qc= X-Google-Smtp-Source: AH8x2265K0qy8qFtkAMJv3a3qGmknlTss9bFMkGLi/8vDRIQMWhjEdx8cR7dbds5gm2MMqrrpBZKGg== 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 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> 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 --- 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