From patchwork Sat Feb 10 09:19:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10210419 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 C7B0760247 for ; Sat, 10 Feb 2018 09:20:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD701286B1 for ; Sat, 10 Feb 2018 09:20:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1AB12968C; Sat, 10 Feb 2018 09:20:44 +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 77343286B1 for ; Sat, 10 Feb 2018 09:20: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=RJlFUiWA5tAVEsx/kaqkTr8ICDQhn8kQkhKcsgnohro=; b=QQrjgtRXOyugrr4mU2JPUvBftf AAyFv3llOHQ9/6jgn1f/VXOA1sWK/AJpBAzt02khQKNc+sI0mlghknFWLa3/0BIet302m3mfqqWi+ j4PN2R3+Zmey5pP7DieWGG9B0we2jIwhDNv5+7uqMDuczhy7bnnH4SJ8xvY7pqpNOUMJAMITNV1l3 vKM5Jk0Be3FIZozsi6Rs8j7eQBsUOdeZF6h1XtTS/gnKvjTNdhB2gOkhfW84DmzwOr3lUp8VLcrcu HFTWHCeZrxhH5VsRGtuLL+/DACkmueDnfi65pg0LwUEEFX3HMabVRYWoEbmBiLj77v0jCS3+sFTWN FPwjEkiA==; 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 1ekRKs-0007JM-91; Sat, 10 Feb 2018 09:20:42 +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-00058D-ME; Sat, 10 Feb 2018 09:19:48 +0000 Received: by mail-lf0-x242.google.com with SMTP id i24so11244311lfc.7; Sat, 10 Feb 2018 01:19:42 -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=PBpcmdyJHAx2PpJ4IMRbXi9hCAVKCZS2AqVlixHadKBjkfUQaOlUKsryCbBar+5DtN IjwPLK7sF2D65rkeZKxViW8IPEk3RkPUMgH7o0uklajSmxa4kacyxUd9T/yWhm4w0zmb eI6LPaOKwBB1KIZNyhYTcx/o+YzghyUeqNWvGmr68F6D/bdEiykByTm9swfCq0hAiLTQ I+MhhHOmEyjZMb8qbFIfXOa7InQ0lOuXZiQuuyzTZFO/7D0YJaGlVMTMrdQq4MQmKV1+ q+SRHlXSoWFDSWZPrbgJ3oMa1gZXq5ZOZn10yBtrKAdw0Z5QDMO7s8bKHhGmbDZUW4mS fjrA== 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=nRyaVTr7XQ5hDiyHh/QFurJHvZ9A9VgzyHEy6Lv5m2SrF4bofOtJDPReU+qJvlufOD B9lgdKJLEhwE3EAhZRA1PAbF+TZZhBD5drUKHOn9EehbSmCwW6e44BaVb1PcYEqCwWef kWT8S7pHt/KUSvr5gyE7J69rowjP61Vs4gH9oSN7ZYnuIVa3BWpwGHVPYLbQ+QR08pa8 AlDLgpwvMx4nAITZkcovRmLWUDD8lKPkiQ7QA4VRPyEqLu6S6scDHJLhlau1LNEmDZ7Z lYgH49SC6vd+j2DgY7Bq1ZO6bXHmVTG9Z8i17VK6s9j/7IEsO5i2sgvZr63yo2ck7/lg zxKQ== X-Gm-Message-State: APf1xPBVXfq8k+FR8ixPO2VMq6iegTEn6T53AFjcbML/BmbF83s5947z /BkS99gFDp+1ZDlI+r3oFoA= X-Google-Smtp-Source: AH8x225jE6fqLbgt/T1mu+hUz/A0zc492mYCItmF9W4gQRNoIDYiQaqWLBi4lFN6vNW/eNTzrjX7RA== X-Received: by 10.25.155.194 with SMTP id d185mr3727955lfe.65.1518254380957; Sat, 10 Feb 2018 01:19:40 -0800 (PST) Received: from localhost.localdomain ([46.194.112.145]) by smtp.gmail.com with ESMTPSA id s9sm794551lfe.48.2018.02.10.01.19.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 01:19:39 -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 6/7] watchdog: meson: allow setting timeout in devicetree Date: Sat, 10 Feb 2018 10:19:10 +0100 Message-Id: <20180210091911.3644-6-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/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;