From patchwork Sun Feb 11 20:08:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10211445 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 7184960467 for ; Sun, 11 Feb 2018 20:12:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6104E28AEA for ; Sun, 11 Feb 2018 20:12:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5569228AF5; Sun, 11 Feb 2018 20:12:16 +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 8BC7828AEA for ; Sun, 11 Feb 2018 20:12:15 +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=tCSX3h4M9IHDEyDnvucfl/M8YaQA4kDwZ1XWd/TR18I=; b=FaiMswLaAFrOKgeM3+VwcS/qol 7sYqOKqsDtqT51uriE8KH2uXFLiDZtwfVnsHZz6EfWzwbuRhV14oqVzBJ0RVi0hHmWIVBc6IBZP5r UQw4o81n1uPxjGPv30YVSxveMEkp1rBYEKRLDjcH6C50g2STDQc3fwZE+nsQexC6hfJEQovFlLcu4 GFJDxmvhVNj/PY4MTdsv8byxs6QLC4ohxqmHe3u5qFTPgq5W9zzrZiqB6yrRQlOTp9dVxmQIgJH/U 5zJo/jadQdsTAbBmGin+F/N1C8CJjRJIL19WbAyjq4ZW7oKR+fyuxMq0UIBRpRzKjOMw077j8Ar2Y 405kKm0A==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekxyl-0004hV-Kc for patchwork-linux-amlogic@patchwork.kernel.org; Sun, 11 Feb 2018 20:12:04 +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=tCSX3h4M9IHDEyDnvucfl/M8YaQA4kDwZ1XWd/TR18I=; b=pDX4RiWOsBcwv6/haSnUhxwJXX TL+e5fgpgNWSa5CrZeSqNXfWW4pEVovRZNCtzOsLDhPCA9I0jfZ91EN5q/lEvwDEQNsnzuCwhs5vg C7s0Th20uqfcELpNygwZKQvhh9WgMLbWs5oc/pym3cn6ipQNQ48OHZnndgta1/4Uh/eZKIku4S7XY nfZxPyC18+QlcQYyOg49//Z6v/WKoeCUBqfjxu8wlZnsda+THsrq9bUUJJ1hXshnmjSpNYv7AwPBE /JIuNJ4KrzYxeu/RzK+4UpZfsvkPf5b6SuwZdU/frwVm9J+Iwz1u0FAUcs9md47u9uP1xTRgod0Dm PHqLem+A==; 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 1ekxyd-0008Am-B7; Sun, 11 Feb 2018 20:11:55 +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 1ekxwU-0003BQ-Iq; Sun, 11 Feb 2018 20:09:43 +0000 Received: by mail-lf0-x242.google.com with SMTP id w10so5031522lfc.9; Sun, 11 Feb 2018 12:09:32 -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=VrGv2WvWQyUe4izivlUHGcP2xc0NGjrT2z86wIJ1iPc=; b=suSymsmYAmG1bM3WCeVvsTW6Tj53SWUVeyyjc+tY8D6rWukXo91iCDcUdJmPT7mbrn FG3UVwCXxIDK6mNjyoKFIi2oJ/J0j3nVZgmmn2tWTQeQgoCcSrwutUtUdREzSdgrY12D H5cZvqYiStj+6fQVSdkK2OYhWel8UXpMwRof89a82PU9gZox+XN+V2xnEoo9C0zAbqBF OW91wx3JnTumQSUVrvxaDUryEKH8TPtzA51oiYadKCKSGXNPBWJvToUMVd7CO6GeiG6J 3yGnFPAffjT60MJa984zGeR8B6b+V0Ozl9m/qlrs+AgFXMicqnW8gxFK7CxPblB662xu 4ZIg== 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=VrGv2WvWQyUe4izivlUHGcP2xc0NGjrT2z86wIJ1iPc=; b=U/F3R4/dQ9BTFJ89Pe0bQYN1VnthIqYC9JiKmpIhO2316yH87Zt3Vs9QDg/qmrTbU5 OB0YhoH04h2ZFIg+ne0Brtzy0+EltVVqOTp1SY6G3oDB8ugd08ZTx/0ge2FtEOWSsz8/ 95ZZyXJ9zHRqFRLyEg6BE7h9uMKh2ORyEoJ8tnaj+3gZ63vEQB2suZvS1A6PmYA4xILt a25q4w6g37bgG91n7X5HKo7BQ3duw49xGS1t1Fpa4Hp3xvXjvBznuVtTbPDa++mn6rl9 biF/UvCdCOoLJRdp2WmW6HaTMZgDUVWFraXJYCgSlsnBDgjdh8Gu+CCroGZ4ePnABspf JPHg== X-Gm-Message-State: APf1xPBfSHuusjPMA5YPNa7u8jBAhlPobbjEcAEvWoawzwPs9dS3ngDc JRO4kjMooMxIt9UTqS3zkwE= X-Google-Smtp-Source: AH8x2254g0X9teEGrFSMJgkw2OwPx/SCjdgRN6+lXkdiEcDKclhDYxVU+xgxbLhaQp6/J1AoElZkVQ== X-Received: by 10.46.62.6 with SMTP id l6mr5992526lja.57.1518379770988; Sun, 11 Feb 2018 12:09:30 -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.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 12:09:29 -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 6/7] watchdog: meson: allow setting timeout in devicetree Date: Sun, 11 Feb 2018 21:08:46 +0100 Message-Id: <20180211200847.25000-6-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 --- 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;