From patchwork Fri Feb 9 19:27:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcus Folkesson X-Patchwork-Id: 10209925 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 1EE2560236 for ; Fri, 9 Feb 2018 19:32:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B35C29759 for ; Fri, 9 Feb 2018 19:32:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3D9229767; Fri, 9 Feb 2018 19:32:43 +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 AB6BA29759 for ; Fri, 9 Feb 2018 19:32:43 +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=naYNqRbWSfBvJ1qNyZ+Itu32CQ6OGJwI8wTrIkb9mg8=; b=hbH1Xv+DpSXoUoH8D1Dgc2Vjd5 P5tMagebJ0HWw9xyry0atq84j+U214hFcvt2clkX5KICLe6VanMKISDJUOQtR9IIcduMiyN49YOWh F5lq/HQvCwjoeXHCltD8JclTDoJtRUHl+peiaAt1PrGX96ptevdx68tCQJa1u/COaSlZoY3xejM5N 3pZwsDNoXN4ThGijS5OqB2Hpl/ck6RxyS3X1zNnczzrdOyUfS7xAyKsZUgmjiONMXuSvSsJ5qSsbz OgQFQfJVSNnG+eZN3Bpm93KwG3lXHoR7U/1wr0+UWJbmLeLmMd999C2Ge6MMnRTA5Q3NicNyLjIfq fypJWOIg==; 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 1ekEPX-0005vU-Ta; Fri, 09 Feb 2018 19:32:39 +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 1ekELE-0001eR-Jt; Fri, 09 Feb 2018 19:28:14 +0000 Received: by mail-lf0-x243.google.com with SMTP id t79so12683104lfe.3; Fri, 09 Feb 2018 11:28:07 -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=4pxBQETC5Z++4w9nQj2rEflqBnCgGVaPHKoV52VJ9rU=; b=h1LgCU5+0oPWy11wWjnXc+IBZVPGmHczCWyNARpkXt+jMeRRvO3ZJFMQByujfWrEhs mhC21dmkbiYepW52xxsuT+sUAYd3Efq6h/vjkoaCq/SK0LXyUStU+xOOZ82+njz8md+w jWzByojDRAZsxDBGAyEzxLwXF7FCRzdppULgONEnf2a4kAQevRAqjuwoLXrKhy+gN8L6 cpgpV6Iu0cIO4qQjPsoVOWHDKSS8tEXa+xAjOyCcGhdxng8cr2fF+AdJvsKh5Gm7FN/h wCrHpotPxGQTJjAloB8kAI77WlZ1QTGCO3k2ngzR0JVEaFlP10EvjmAsuGxJguxcL2L8 JPlw== 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=4pxBQETC5Z++4w9nQj2rEflqBnCgGVaPHKoV52VJ9rU=; b=gd0ABYwXwBR3Bz+r1f4BLPeZgWo0Twy22w6VVwmuDxnQZ54DSh0oin8PYhoHevyOGQ dtMGIcSep0jNcr0TbNydrjC27z1BQMn0ZzOjFSkKILtLRGy9yN82Pf7KCq7rJzuChJfj GsCKDG77O3RaLsSQBvRsfvWz/03x3Uh0qqjUah271xsc2w2QWimGCOJ6caOFh95DcGAo QV1utSHQ85mQ6upNx73lr2f/UJvp+O2YjKuovTEoBlWokG/az7D9ktBP3cb7POKqOT0A fUGxHcNNlIOmkVca5c8DNzSrL6GeV3wOuW4GcDZyD6ulw0es5gfoQvYvJnhfGsFNR6o4 9hFw== X-Gm-Message-State: APf1xPBm5KnM251g6qM8wTu13MFSRHOpcqEopWsG+3hDu5xSWCx5QYer KDbjQ8ECNZowTBwNteHC+KE= X-Google-Smtp-Source: AH8x226W+z0MOJLXVEIKLF23UeJafRiYsG6jJzA68WgYTrvEInQUns4aEzrZT6caaDkICWz4oKbLxg== X-Received: by 10.25.156.20 with SMTP id f20mr2562951lfe.12.1518204485994; Fri, 09 Feb 2018 11:28:05 -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.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 11:28:04 -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 3/7] watchdog: sirfsoc: allow setting timeout in devicetree Date: Fri, 9 Feb 2018 20:27:20 +0100 Message-Id: <20180209192724.1227-4-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-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 --- 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);