From patchwork Fri Feb 9 19:27:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10209891 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 B175160245 for ; Fri, 9 Feb 2018 19:29:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9ED2E2960C for ; Fri, 9 Feb 2018 19:29:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 936BA29619; Fri, 9 Feb 2018 19:29:29 +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 4EAAA2960C for ; Fri, 9 Feb 2018 19:29:29 +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=z3MlN107tIlMo5ZKtrnpfG180Z8YzByfnxIN8LM8wfo=; b=McxsQ30mVSm5OXvq8OrrZmzngu P2GBDXNd1fy6/7i/9dg8crHoa/JxNu2APdsrYTQwLrL2xDKRgCM/5Wy0LR9RZQmFadCT0FK70OZx8 me1O2ZuN4Pm7II7xcjyUGvNUQhd6B+ipuu5ewXifZXh4klHfhB19ZtI5+hMH0A0ohXGMjltlo1yxW kvdAEjrDx2rp5tB9K3eLKq0g357THsmGGLRa+A/jQVX1zbbleuZWoV+AM3TWI0BfCJ+4rC03YsGV7 lehlN+oTRsfX+Ratnutn/O5CIN345IKVjPvEEdVcjzqWuDPq6NyO+UEBHCpTPSOrFPXrU1cSnJrz7 6VDwHGCw==; 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 1ekEMN-0002te-Sb; Fri, 09 Feb 2018 19:29:23 +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 1ekELH-0001eP-QO; Fri, 09 Feb 2018 19:28:18 +0000 Received: by mail-lf0-x242.google.com with SMTP id a25so3387971lfg.10; Fri, 09 Feb 2018 11:28:05 -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=xeiAJw+XISyEHDNCLURCMlUN5lzOLAbJqXyCSYJTj5Y=; b=Ot0tDbDNW1iVYRxauZ7OdN/sgnvOGE/ShzhPELzAOI4f+m/ze7AAu0SX6feJG9TWpQ cvBDx7BwH4RRDqYSsnxJWtSQtY2lB78wSKS6y5sKusP8MUeX00fdBHprZSPhqCDLxuLI abi+OzSJuajEizCEM8OXmsGGvmphZkG8DR1uAsvScx5UZH40BkPf5HcS4VjPZZpq8tT6 JsygO3eOVhLQvQ3AN8ApH9Es/lXWC/28nUtOXGxKVbnz+TwIsekx6o9z1eBOVgIQHjXM LhS2kgFA/7TvJuutqp+lvKcXx5KBkkloI4xa4bUK6etLAmNCfzD5zaEa7uGtlADnvltT NQZw== 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=xeiAJw+XISyEHDNCLURCMlUN5lzOLAbJqXyCSYJTj5Y=; b=oQR1QhHg4+ENtna0Y3lVbT15KPHwTQTm0Jv1NHMSrID/WqEj+VHHSQkkRB2NtjUFrQ H3OlaAIiRJUpU0lbwX5qNV4kUZjbjR0AvvZPodGAQAs+N4SGLoRS5uPCuETi4VYQhQ85 iSsJlWPOHvAQy8bnZH1YcHtnx9eJeew3wzuFLEaqOu1AB6Aw/XNUXnSpKLHFuEWdmTVx ETMUFvv0ye7fiFMH4YDMd48C9YmrmbyMMyYIZgdmN3gVHPDRgZNsqJ5Nil+3WblBw82O ZEYE5zP4rU/rG2RO5jAk79UlnBnfaedtIexUq6SlokM2cIHAZ4GMNg2ES0G3PlKEdA5p Zw0A== X-Gm-Message-State: APf1xPBUatuBmAMlwYnqkI6cPgi5InCMcYIP3ENc+AfOaVdNjXh8RnUW k0NvSp03xdlWLs/Dvl8QxF8= X-Google-Smtp-Source: AH8x225UIHaccei9YlPAvearP9VXhf/zxjQouuPjCYhe8iiDZQgEb4ejHWbejHvVBOkeX8Kkzx+i6w== X-Received: by 10.25.235.86 with SMTP id j83mr2810356lfh.20.1518204483577; Fri, 09 Feb 2018 11:28:03 -0800 (PST) Received: from localhost.localdomain (c-2ec27091-74736162.cust.telenor.se. [46.194.112.145]) by smtp.gmail.com with ESMTPSA id e21sm570315lfb.51.2018.02.09.11.28.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 11:28:02 -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 2/7] watchdog: sunxi: allow setting timeout in devicetree Date: Fri, 9 Feb 2018 20:27:19 +0100 Message-Id: <20180209192724.1227-3-marcus.folkesson@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180209192724.1227-1-marcus.folkesson@gmail.com> References: <20180209192724.1227-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