Received: by 10.223.185.116 with SMTP id b49csp20493wrg; Sat, 10 Feb 2018 01:21:00 -0800 (PST) X-Google-Smtp-Source: AH8x224vpnE9QSvZrhibfN0TINpQJEAAK1Mmdmz6Qh17hzWUs5qmErMgIL5QaPE++NlY4wq90pRp X-Received: by 10.99.189.26 with SMTP id a26mr4544220pgf.373.1518254460627; Sat, 10 Feb 2018 01:21:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518254460; cv=none; d=google.com; s=arc-20160816; b=MSi1q6v/uJ97cctD7TlfZ0dNnX/sRoctEkAHYa27ojGSBIOo9dWV+k3epClypgWJGj zuCsVpIHFJ6iZMNfIvxl/z3AIDBKme6RUqFWR2iaPn1lbAm9jNuHrEbZH1vOL6lZcEPQ 2Dup5mgtGhN/06oHtjpFQUaXPqYFFxyEmxHqZsIoMDXmPnP1dlAstOsFdjvaW06ulUsC /R1rV6Kc0A0iXE2aYSI5IqYsAhDwDoasnvU8egvF0Lwyf7+k/5kor2NjDtQD8sH4sWui dDO6p+n9QAITPfTXavipj001iN+ifZuJN+H+RCMNV/vigjSuW31NV1BOe8irl6hTLOdb jt8w== 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=j1ApF4jt8BovR70XpiAilM+LgFAzFw4UOdhesh3SFLQ=; b=j86CfUXK9Q0aFlf6jEKTF1sWMFxubK32hz0XgQtmY1fJyQG9splns3LGRTkTMiJKct DmvbfuypJDxGEt8N8MmGGv/Qqh2tXhKObsqaulxGuUeClf+8tP4vMR0o9EWCXpkG4Lmd UKiBITRmzO/oYpRDqXzgzv/fViKYTc4ltMRXDyJ3p2o/f1yhX+E3vn5lu5aYfPC/BQ2r 4dpxSWPojzjh5CA4ozGhIzhobj/CneLF4yghfs5CZ569jixLUNlinWom5x6EcmaI911P 6yFLln3diuiQ+L5WZn4B3QLdhoTRavG82XtmwPa/TBBfR+BdA55UrW/2ekrigh7k3Bo+ KTkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YD0LoN+z; 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 k13-v6si1169775pll.388.2018.02.10.01.20.46; Sat, 10 Feb 2018 01:21:00 -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=YD0LoN+z; 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 S1752170AbeBJJTo (ORCPT + 99 others); Sat, 10 Feb 2018 04:19:44 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:43783 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751859AbeBJJTj (ORCPT ); Sat, 10 Feb 2018 04:19:39 -0500 Received: by mail-lf0-f68.google.com with SMTP id a25so5100047lfg.10; Sat, 10 Feb 2018 01:19:38 -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=j1ApF4jt8BovR70XpiAilM+LgFAzFw4UOdhesh3SFLQ=; b=YD0LoN+z3sn/F/x42itdvfkQKLf2UrpGoIjkdHt2mTQcRnvizkv4/EJe+DSsW9cPr3 gUOaVlDMdZADmiXX4qG9D368qlalLyyMduaBzPMtdaVJ/hh2ILmgyLPG0uqhWVNGQ+NN rwqqkBomZ0mXjPcqsTLk9DHRbSvIwv6pFTKUIO+hggQz93uYLNB/sRD6cdgBzi+TNWFo OkOTSpUXgGaHPlzfa0O5oNK7Li+94VT2a3TsO2V2ZIrATCGKUWmhL8tt0mROghq+y0bC +lHAFlBUILcjhvOSm0RA4aC/WQcolRnJ4SRmMn/zuymmPXuUuUpYTCpK6+sIBxlQG261 tbTg== 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=j1ApF4jt8BovR70XpiAilM+LgFAzFw4UOdhesh3SFLQ=; b=dqrgfPmwRLAY0byMivXASBwt/Dy+JnwovWuW1pKDhTMJMpbsx4w0sgY0iwSqu2l0zY +eRAr+Hx5jQzofago3yE1ntVfG/p3D73QOlBKfUJbLmo0i3bxrTWnrqIrgte+BJbS0sp 84543bo8SEZKZUkx48sZvX9ce2ZXH7INNwWQ65K00E2sZYgWlvZ3HJtf0slt6g44k2Y7 w4qhmWr9K97NkW+ZrqCz8i1gAtfMadZfGQuJL2rzmbp4wrLqSC8A5yN4s6vugx/TfOWt F4oelhf6a/TrNDsKWGBZ/5UKs6fgQzZByMA69gpL9yPY/nruyBw8efquvUml9XWNZKDx vTpA== X-Gm-Message-State: APf1xPDGg6d53QN7rDu51+d+2rKYViVS3hCexlzEgl43BviYBHazONzN uHlk3Loi00Ukd3B1WjUFrcU= X-Received: by 10.46.101.26 with SMTP id z26mr3457212ljb.37.1518254378065; Sat, 10 Feb 2018 01:19:38 -0800 (PST) Received: from localhost.localdomain ([46.194.112.145]) by smtp.gmail.com with ESMTPSA id s9sm794551lfe.48.2018.02.10.01.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 01:19:36 -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 5/7] watchdog: mtk: allow setting timeout in devicetree Date: Sat, 10 Feb 2018 10:19:09 +0100 Message-Id: <20180210091911.3644-5-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/mtk-wdt.txt | 4 ++++ drivers/watchdog/mtk_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt index 5b38a30e608c..859dee167b91 100644 --- a/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/mtk-wdt.txt @@ -11,9 +11,13 @@ Required properties: - reg : Specifies base physical address and size of the registers. +Optional properties: +- timeout-sec: contains the watchdog timeout in seconds. + Example: wdt: watchdog@10000000 { compatible = "mediatek,mt6589-wdt"; reg = <0x10000000 0x18>; + timeout-sec = <10>; }; diff --git a/drivers/watchdog/mtk_wdt.c b/drivers/watchdog/mtk_wdt.c index 7ed417a765c7..fcdc10ec28a3 100644 --- a/drivers/watchdog/mtk_wdt.c +++ b/drivers/watchdog/mtk_wdt.c @@ -57,7 +57,7 @@ #define DRV_VERSION "1.0" static bool nowayout = WATCHDOG_NOWAYOUT; -static unsigned int timeout = WDT_MAX_TIMEOUT; +static unsigned int timeout; struct mtk_wdt_dev { struct watchdog_device wdt_dev; -- 2.15.1