Received: by 10.223.185.116 with SMTP id b49csp20950wrg; Sat, 10 Feb 2018 01:21:45 -0800 (PST) X-Google-Smtp-Source: AH8x22608pHNCOmEIQRgiv9U45eiS6WNsM2CcfULXz7qN8L3znrGW83TvMaVnSdoT/xqlQvDm25Q X-Received: by 2002:a17:902:2702:: with SMTP id c2-v6mr5145355plb.342.1518254505708; Sat, 10 Feb 2018 01:21:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518254505; cv=none; d=google.com; s=arc-20160816; b=FOvCt58OGYx8L4moVwCcJXUEaarX4d5gYQGLkQLgm6XD+wQ6KPS1TQNWOySnlV7JBn HD2ih3Fjlstym7ooo9bv0X56nZzbO2nwYsiIcjBMWETOkj04J+LS53hU1Pt7Tk9OJCbb uTh6Ts3rmyVGVaQeSMYFa9M1THQpE6gGP8XJSgWuyKQdycISqXgHx7sOKETHri5rNzKt j+OvT1SdWI02Pw3bX7g+Zm0KqhSM7L8Kpo9fbWxJGJgayYCui3EGBQsVQZrSfbgK7An2 OoLw3ryvnVTEpH5XOop1XTF0lwnpIbxz760I+y1oEItZtgNNTcLOt6W+b4baq1Oi/Opm GmoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=VrGv2WvWQyUe4izivlUHGcP2xc0NGjrT2z86wIJ1iPc=; b=dV0iRvFJ9iS/xtsI8eRWQtg3ZEwd3bn8E/VsfdEOTG8uWwmKg6GgRCwe6B/Opw8ZpJ E1+QvQp6vSyY55DbbDUXBDH2h0snZ27IVFQNz6icHswBKww3pjl0oc2olZGl6uIzoCfa qS+U/hQwa+ZCo8gM/mF9DJCjX5d4zHgF9osstJHiyEbDhKRxTO+RdQbvhQQvjt0clfGK K8hArMULvgZ1KantTobFjNUL8Im6LzBQqXUOMnQLLH/aVVyHUq62XGd82u0l6KMDVHs2 GPhcmYkYs0LMCulparUroVqB44vB2xcdp16zej5Bll3Miy124kG1xhYO4xqUstaacRyz vO4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PBpcmdyJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 28si1250702pfl.53.2018.02.10.01.21.32; Sat, 10 Feb 2018 01:21:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PBpcmdyJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752331AbeBJJU1 (ORCPT + 99 others); Sat, 10 Feb 2018 04:20:27 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:43788 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752049AbeBJJTm (ORCPT ); Sat, 10 Feb 2018 04:19:42 -0500 Received: by mail-lf0-f68.google.com with SMTP id a25so5100121lfg.10; Sat, 10 Feb 2018 01:19:41 -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=QnvE3+a8EcRxkeMR8gkIl2xFUmN42qsl/YOM/7msVeEARILEE6q0p+ehq6zswZlVDj jkEAMqDNk8IYAUZ7ZceNnyJID4+QNDXNS/msoecPG3RYWxAjuDV3/NBoIM8R+H5BXovZ tmJNJpb4lVaMv3Nx5/EC3kQRpZ0kV/MvqRcfZU9LKrrSbxQiuXjXiCvupVi8f7VdDhAr 9ZgBNYwJVNfCKJNEZNdpfH2Nfp+HifvBtajQ+oOOnidXvlBZTz0H9IhCsDzLR95vWSLV +7lGasVoUt/668zGs/GR0hKo66+e55AiqVJHGj47pwn+b0ErvZxdaWa3lVWQsqj2B6Vz tEJQ== X-Gm-Message-State: APf1xPCbozyHnsxT64xiBUpokxagya5IkBgVI2uK9vqeUz/pG54IqWZA LA2ELUPMa/afYSeDgnMDcBn2oU/c 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 Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Marcus Folkesson 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.15.1