From patchwork Sun Feb 11 20:08:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10211459 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 68F88602CB for ; Sun, 11 Feb 2018 20:19:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 564D9289E8 for ; Sun, 11 Feb 2018 20:19:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47EE728A9A; Sun, 11 Feb 2018 20:19:15 +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 6AEA8289E8 for ; Sun, 11 Feb 2018 20:19:14 +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=Lvg1vx+M+h9O9pfexSWvl+GcFcfufy1BLm00C6i97ew=; b=ivL/VTUGDUpG1pO/Qzu4Oo37/p PZaTaM0BEoXwESj+4dkslgTowR2PUbUyJz2Oilp6VVnUH/MPO8zhFA6C+GV5AehuDHF/KrC3Opolk u5mCXNamkwOW0O6nWRbjCp/usEqfP1ugI7eMFz7Hcyauo420ENVESmNGxqkxMiYDXFXepj6OHT8/U UTBserY7bZpXTODiH2R1QwXOtOIXFZEDrAZ2gsxCa9VxtiAdEctjI6W7tA+r95t+YUF+hyt4NRv7F 75eLeJyskmFMwRjfy8Pnc7zhbNJ7ZYZlwcMIvgIIsBCVwOFa8CqORJCxXa/REYPRCn5NDnI5+AU2M kOkiQ/sA==; Received: from [198.137.202.133] (helo=bombadil.infradead.org) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eky5Z-0007l6-WA for patchwork-linux-amlogic@patchwork.kernel.org; Sun, 11 Feb 2018 20:19:06 +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=Lvg1vx+M+h9O9pfexSWvl+GcFcfufy1BLm00C6i97ew=; b=DStTVI0uyaeJDeMUrW/n7aOOCm zUpK40JPRJbi5efoYfYtN2KhOD4Xhv15wMVGU8H9zW1tykyHEn9gr3oABhAnAH8woYsWgCjWa84Ka tD/zZ2fAz3i+QkYln1WGldkS8GH6KVGKjS2BxW1dfNc+PzDFxsKZdgDNyti6ueVQbcT/EgvIjyfSY 7Ubs+ACchGhI2KqixGnPKP1rpUNGrAwGqj0HwLhLCF3Y4P208PuzZm7Xii0Bzsl76kgiWq3Zpndyi Tj7Zehrdfjh+k8rK0CxxLpB2fUKE2jBAMOZplY0cS3TiR0Uqp3qhC10X8ij53ALYYIYNK7U7oOv0c K37mssOg==; 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 1ekxxg-0006M6-CY; Sun, 11 Feb 2018 20:10:56 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ekxwL-00039x-TC; Sun, 11 Feb 2018 20:09:35 +0000 Received: by mail-lf0-x243.google.com with SMTP id a204so17797514lfa.2; Sun, 11 Feb 2018 12:09:23 -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=8YcBHPSO6OHE3zPi/Lolt6I4qqC5i6SjQDa3lBvJSJo=; b=qzrG1hvUkq7yWuI5fP1lBn6lQuBtthmKn3OL9599U1Ph2cDmXDjxDxj2mXBNgep3n8 dvOBPrR/m7InPnxDCsXT8cSERZp7zKN2AC/9FZi+cm7vtkeS/b1IWjqmPWMB70yiuNj7 ckmfd+DlpA2j8uDNU5KvmhFJ6erH+ABrLsyU85zprQo51MpgGiDAW10zCIexO9BLWYFx Z1nVmHr8DowmqgBByPEe9qDA3o6yUxBXRoXWLoqlHObzT5IkrdBqQ8ulRI1GTK3zU9/1 RXb9OoC1KZIRDviTdTstbJEXV50tihRkBftxK6yH+zopQL2/IqB0sZ6iqfwrAhg14Sqk 9FwQ== 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=8YcBHPSO6OHE3zPi/Lolt6I4qqC5i6SjQDa3lBvJSJo=; b=eqMyNVPaNJ3R1XTYdbYTJwK3I2sSI4R9SigVA1JZN7gDPmgV2cc6mKukLrGO0Sei12 /PidnrjMpfPGySCMKOnXvBQ88FKGzdbgE0Tvslk/L6xZBl37HozeJxjPQHp4c4+8fzuz /YYFBVE4WSHR64daKT6oidRx0e5rucSv3nle5/1Tkn2kYLwV5+lNlCevjHTiS+3KU/38 TLlnpPyzzf9BYm2xK2B0TJEnCQ0PuFUW4VJXMedLDiNK1QAri39GWEX1l9oFupv/IAnQ YbyDjjg2riZHP5TqG3bUsObOBR3B4XfUhiR/034SYNHFDUf2aX/6DpzBH50hZSrrCD1Q GjGw== X-Gm-Message-State: APf1xPB/YYMfLf9OgtEgOvneh3LsIb7irP127ZvhZ/w++qeer/0deZZH xGfRFHuxhtbFV227039Dbk8= X-Google-Smtp-Source: AH8x227IOn/cqxygiOSPRjPRHQWXrkRKRTzJ/OLrZSvdBmwonAEyY8LEz0sWoELLwH9bONbuE6Co4A== X-Received: by 10.25.168.141 with SMTP id r135mr6369761lfe.80.1518379761906; Sun, 11 Feb 2018 12:09:21 -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.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Feb 2018 12:09:20 -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 3/7] watchdog: sirfsoc: allow setting timeout in devicetree Date: Sun, 11 Feb 2018 21:08:43 +0100 Message-Id: <20180211200847.25000-3-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 Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt | 4 ++++ drivers/watchdog/sirfsoc_wdt.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt index 9cbc76c89b2b..0dce5e3100b4 100644 --- a/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt +++ b/Documentation/devicetree/bindings/watchdog/sirfsoc_wdt.txt @@ -5,10 +5,14 @@ Required properties: - reg: Address range of tick timer/WDT register set - interrupts: interrupt number to the cpu +Optional properties: +- timeout-sec : Contains the watchdog timeout in seconds + Example: timer@b0020000 { compatible = "sirf,prima2-tick"; reg = <0xb0020000 0x1000>; interrupts = <0>; + timeout-sec = <30>; }; diff --git a/drivers/watchdog/sirfsoc_wdt.c b/drivers/watchdog/sirfsoc_wdt.c index 4eea351e09b0..ac0c9d2c4aee 100644 --- a/drivers/watchdog/sirfsoc_wdt.c +++ b/drivers/watchdog/sirfsoc_wdt.c @@ -29,7 +29,7 @@ #define SIRFSOC_WDT_MAX_TIMEOUT (10 * 60) /* 10 mins */ #define SIRFSOC_WDT_DEFAULT_TIMEOUT 30 /* 30 secs */ -static unsigned int timeout = SIRFSOC_WDT_DEFAULT_TIMEOUT; +static unsigned int timeout; static bool nowayout = WATCHDOG_NOWAYOUT; module_param(timeout, uint, 0);