From patchwork Fri Feb 9 19:27:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10209895 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 B328360245 for ; Fri, 9 Feb 2018 19:29:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F0A82960C for ; Fri, 9 Feb 2018 19:29:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93AC629619; Fri, 9 Feb 2018 19:29:45 +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 AA8C02960E for ; Fri, 9 Feb 2018 19:29:44 +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=jbPI0kGcgB0o/e/uZ6UDH6K05udbk1Sy8LmRcUEgj9o=; b=UfE89yaJfPm1B8JiJNOFv32Cp6 RctmwbNNJCC0rRwObrk2aJnlFTnDhnJKQ06uTVEGYJ9aa3w4WeEEvO5myUjWPwxaPTYJB36+dghnc tePQKVWkogseoS1ecRWp6DdLL9RNVLKenNUZD0n0UcX1AV0uoerpy1wn+LokWFU3bgmsxZDLIIKjM VVDRTwrnz1hx5QzwiXOG+JKySspSiT/2uPSwtBLw4nKJ/kEXdJa0dkohQd0Ndlb0rjsZwfeYM8jX8 qtKUi0jatVXjpYzC7xWd4Yc9MRcKucfvXfp7D37ufpW0zxsXKM2NtrOaobAMb6Pt98Sc2yTgPricV Nli4IEsA==; 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 1ekEMg-0003Dg-FL; Fri, 09 Feb 2018 19:29:42 +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 1ekELP-0001gR-27; Fri, 09 Feb 2018 19:28:26 +0000 Received: by mail-lf0-x241.google.com with SMTP id a25so3388565lfg.10; Fri, 09 Feb 2018 11:28:15 -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=m1tg8faqKFGkGZ+JnQFHqOyCXTyvzBufWa4mO0F2/o0=; b=lhrpBepcWLdBmB+NFaMtUDScZX05xj+drcRs4VCo85cdplGS8nYPtMI+2/pJDNte09 QGQTNIUqCD/DDhQsHrm16v+KFvPnyQv9Cf58I8NVSdXV1S7qcbWfYSILgdl+67E9Hi4U v2q4f9lBTl08b81nJy+FzdcQprObsVHcJ+AQ4zhGISurebyacpjXbu+suK8brPmX+kt5 baq+TYKkDB5GU4h6/4iih3S5eAY0k8YWccPaL3psj+1ouWy8HQ4HCs+cMm+b+QgApKix GGSyrsUaxB8fXoJ4OP2fR0kUhEFQ2X6n6Zq4Elub08cd2ksMhjjPR4+pgNPQGVtnnxEA h6xw== 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=m1tg8faqKFGkGZ+JnQFHqOyCXTyvzBufWa4mO0F2/o0=; b=OS81EmztiMr6lBAY4gGlD+sf+8XmJY3GQsiy9QY9JJWLcbeC0Y3cbYz/k9HPdsbMGP fzTr+RF5s3dj68EyGKE7DAJbDXVaFQTQmuOilh0XKskIvrfgsRpYX2hMJJVMhGz8EoOG ZksZ2gYDihDSwz280xVZExbQy2ZzTF5JoAsE1/h34d20Yc0t5+zHDe7IAZYWM7UdMgS1 lsd7bhly9JSea7UqQj8Kj4wWH3SO24uDWJee7v+NietD48a/Ogbh67JAgnXb/VKlRZzn z0I104Ka0ieysAzf+DjcU8WGaTWXBiM5emHnkAPxx1R7yjMzVfG6iC4Q2meW2Y67PZ0q 3Gug== X-Gm-Message-State: APf1xPAajRCTRyQ83EFtUwkKqqIldbatfJKN8O+YOWu09P3nBhVmpCtw XijM9KT4VT8S0or7dzrTXlM= X-Google-Smtp-Source: AH8x225LGMLVyvCxnOLgzyEuWehv7a9miCYmAIijCnTLJ1NAAZmnilkS/wf2ZwNTkJWjaP3q28/CrA== X-Received: by 10.25.212.68 with SMTP id l65mr2616325lfg.5.1518204493693; Fri, 09 Feb 2018 11:28:13 -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.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 11:28:12 -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 6/7] watchdog: meson: allow setting timeout in devicetree Date: Fri, 9 Feb 2018 20:27:23 +0100 Message-Id: <20180209192724.1227-7-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: Guenetr Roeck --- Documentation/devicetree/bindings/watchdog/meson-wdt.txt | 4 ++++ drivers/watchdog/meson_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/meson-wdt.txt b/Documentation/devicetree/bindings/watchdog/meson-wdt.txt index 8a6d84cb36c9..7588cc3971bf 100644 --- a/Documentation/devicetree/bindings/watchdog/meson-wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/meson-wdt.txt @@ -9,9 +9,13 @@ Required properties: "amlogic,meson8m2-wdt" and "amlogic,meson8b-wdt" on Meson8m2 SoCs - reg : Specifies base physical address and size of the registers. +Optional properties: +- timeout-sec: contains the watchdog timeout in seconds. + Example: wdt: watchdog@c1109900 { compatible = "amlogic,meson6-wdt"; reg = <0xc1109900 0x8>; + timeout-sec = <10>; }; diff --git a/drivers/watchdog/meson_wdt.c b/drivers/watchdog/meson_wdt.c index 304274c67735..cd0275a6cdac 100644 --- a/drivers/watchdog/meson_wdt.c +++ b/drivers/watchdog/meson_wdt.c @@ -36,7 +36,7 @@ #define MESON_SEC_TO_TC(s, c) ((s) * (c)) static bool nowayout = WATCHDOG_NOWAYOUT; -static unsigned int timeout = MESON_WDT_TIMEOUT; +static unsigned int timeout; struct meson_wdt_data { unsigned int enable;