From patchwork Fri Feb 9 19:27:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10209899 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 C100E60245 for ; Fri, 9 Feb 2018 19:30:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABBF72960C for ; Fri, 9 Feb 2018 19:30:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E35529619; Fri, 9 Feb 2018 19:30:09 +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 42F542960C for ; Fri, 9 Feb 2018 19:30:09 +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=l+yvhKYZMhQpevHlrnlff9/vyWyrCxB3YQlqJ/kDsoc=; b=D81xFjkbZlt3+OL8XKqYp0Hcyl 9JDIVSU1P8e3vm6TI072Tjm5OYtXho90u+UUWBsbtU5RtIV19gZcZSiYR82HDetqNBkwuk/epCG99 0FSO81joMd6qCnpjRDTh4xo9pz5zkuVvsuTNCMeM39KPaVyRwHRbzI9qYXmNUMzAQFLkTaofFP6kQ rZzJOCG0l6aTkyoscjX533akJ1mRWRcD+u3enMf09IS7nhJBion4bDzz1I/TgkRTtRSZq13mLFPny /ScljJRbohyP0amJG4+cgEOC3jAjanPbFLExba1kXch2/fVBEmSRXrWDCDR2i1X1GvRg8L+41fK11 gh0mfiXw==; 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 1ekEN2-0003gx-Vx; Fri, 09 Feb 2018 19:30:05 +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-0001fN-2a; Fri, 09 Feb 2018 19:28:26 +0000 Received: by mail-lf0-x241.google.com with SMTP id h78so5496741lfg.6; Fri, 09 Feb 2018 11:28:12 -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=vaoSMdN1bxzoXVSTTEy2Hh53KIcTF4Zp9Ir1AGeiubk=; b=jm12Dv12kxQGQi17Jc1KtoDh54Ptn2MeP108Rtv0GhbOTEKBT+25RndXNxFgc7qY+x ePCsbhQvOAyd6QPSTcqPsUcT9nTVwv0mLJjgE1sJPeR++873SvLBV3CdRrrQyIid9Y5V DjjNtzdG3KEtG/bv8iryEFMyuXX6d+KHO4zh/9BOmYjYykOqyyHopp4o8YFimn1lVW9v n2gEap6c4ZD/IKSNF7MuBMxI8mxN3VXN2zm0gGI9c+Tm5uzabp0ymttB7a3isLXlzPhT x06U4hm9bONShvIl5kcSaUfwxYAqLGBOQasYT+IfHAgEpy6UmFP1PZcp3ers1+D50ZhB GUXA== 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=vaoSMdN1bxzoXVSTTEy2Hh53KIcTF4Zp9Ir1AGeiubk=; b=eHLIgntXD83SsA6jiCG2TwHPtUEksI5puBtsAxrIn/QLUhO+HV4BcPbF2MXbKrefuS XVPFPs+KztGDccWIXj+WdIoAQvnIfj4CtxT40HIF1hIGtlD0nBcKJGILsCq0ifOos8ro 41caT1kYG4Vofelp217CxAIM6nYoSrWgtBC3CarReBj/s8VL9uDvvCdROzWhhWV4T+31 SZvS40GZS+cFSXg45rB2YsZXaa5UI3BVu8p4dJ5PWHBtmYHvSvmkY1+K+FaKd5PrdiBf RodVWEXh93HzriODS6rRaw2aE/zqoj7VPV/EnxKhExTy3VPxf7eHWbIfejRRKEVix09Z OR+A== X-Gm-Message-State: APf1xPDxTwJ+EmQGcFXbH5MMnfE3ZzJITWD/N/OS5g7L5PAQz1/nOkqr 0tVXctl8cp9MbO9oitJT9yc= X-Google-Smtp-Source: AH8x225Xmfqm+1oIf3+CmxK8KqvFo1uLgXKCUdOdLo0bqpQTdJQQ7RMr+lirKLVknvneutcUC+r3KQ== X-Received: by 10.46.85.17 with SMTP id j17mr2882716ljb.55.1518204490863; Fri, 09 Feb 2018 11:28:10 -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.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 11:28:09 -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 5/7] watchdog: mtk: allow setting timeout in devicetree Date: Fri, 9 Feb 2018 20:27:22 +0100 Message-Id: <20180209192724.1227-6-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: 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;