From patchwork Thu May 24 00:15:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Jui X-Patchwork-Id: 10422523 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 02A9E6019D for ; Thu, 24 May 2018 00:18:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED0A9292DD for ; Thu, 24 May 2018 00:18:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E183D292E3; Thu, 24 May 2018 00:18:03 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 7B19E292E2 for ; Thu, 24 May 2018 00:18:03 +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=SQ/CzyhUgfL6nE/K+sgXrEP67HGTn+N7Ow7wCAL36Bo=; b=IHhD3g5zb3ABwnB0Z+Q9quYDl5 mj7i6YiOa9M9WHc0tZHW7fQ7JrotkMWWI+rBNECC7gKljbxK1tGMzOP5eqLrI21aNL+K+Yq8WzMR1 MLzzggZCA9v3SqQ5VzbkF8aS0GgrpFaQjDYD8g3oMI7fTw5kCkdeTRPxOgkmfoP5VfEZBil8dvZGz JM55BOjjkN2bkqzmBqoPNcxTmYW+hwg3HtXxhNdNCiNK+itG6VxOYkSI1lnJWxpzVt8SZ5qsoKmfr f0T45wDsNEHK83Fm6OmCvzsFdz3txPWe2tmc6LgnHmPJJh0hfHys/vAW8mkR+qpPsXMWHh8gEgREb hJPPFrVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLdx5-0003xL-CT; Thu, 24 May 2018 00:17:55 +0000 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLdvC-0002n5-5Y for linux-arm-kernel@lists.infradead.org; Thu, 24 May 2018 00:16:05 +0000 Received: by mail-qt0-x244.google.com with SMTP id q13-v6so30523185qtp.4 for ; Wed, 23 May 2018 17:15:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7U2YbvrMgsvjeAIPsnIuI9sG2Ge/TSI1Bmbq6FUhwCs=; b=GdRLeJoOiAe+Q+zc/x2GZbbdk/tMAuckVzQkNXemFodhOEodYSxeRX1Js5/CRjV53d zE48o/LLPk7VQVAzYziCoojcXLC5Dt48vegjDGUskmjYOvq/tH2gMkZX7smozJDy2kwN K1fSu5iD9lktRUhFyZCydWgzb9vklQu05tbF4= 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=7U2YbvrMgsvjeAIPsnIuI9sG2Ge/TSI1Bmbq6FUhwCs=; b=kk+Hsb6ry2x4dkIHY3ayD4vlf7979i2tZxzj2Hzdru4rU45a1HUj7M/Vsf1SlCm7B2 oLMkMv1dhAKyfc0JD5UVopLiIzgjuTr12auT67nw/qRBsIcW5GoK+dRxjzo8EgVbdNVj beklAkPoSr+ZRNUxEK6PYQmtX7OhIbonDcLAzBDiu6T4ff9bTeGIRjQkN1rKEkW1ewgy qcHGEsfWnzzN1d0XqZcLUDryetziWFjFunsTEweOb+lrdd5U5TYgB07iXrnxFDYcJtp0 OIbS1iHsvPajHRcb8QpokUwyDSU8RUc0pDdYSsjALYd0WP3kOD/HnLvCZ4QJWZZKpOtD TdNg== X-Gm-Message-State: ALKqPwcnBcnm1DnAjaXKB5n7d+mokQ6HjjFm/qHkqyVC7XPg+DKGgB8l MyO5SfDG9/FmO7jGynrw0iP7Nw== X-Google-Smtp-Source: AB8JxZpkm03NBT6t0+N6p3PjUHfrQOIRfNjRkJMjMbDuYgzLvG2KvRR1Qcm0GbMJVOjpSl9ol4I5cw== X-Received: by 2002:a0c:920d:: with SMTP id a13-v6mr4775801qva.128.1527120947020; Wed, 23 May 2018 17:15:47 -0700 (PDT) Received: from lbrmn-lnxub44-1.ric.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id p72-v6sm3028874qkh.5.2018.05.23.17.15.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 May 2018 17:15:45 -0700 (PDT) From: Ray Jui To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Mark Rutland , Frank Rowand , Catalin Marinas , Will Deacon , Robin Murphy Subject: [PATCH v3 3/6] watchdog: sp805: add 'timeout-sec' DT property support Date: Wed, 23 May 2018 17:15:21 -0700 Message-Id: <1527120924-12131-4-git-send-email-ray.jui@broadcom.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1527120924-12131-1-git-send-email-ray.jui@broadcom.com> References: <1527120924-12131-1-git-send-email-ray.jui@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180523_171558_236572_8F16EBA2 X-CRM114-Status: GOOD ( 13.56 ) 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, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Ray Jui , bcm-kernel-feedback-list@broadcom.com, 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 Add support for optional devicetree property 'timeout-sec'. 'timeout-sec' is used in the driver if specified in devicetree. Otherwise, fall back to driver default, i.e., 60 seconds Signed-off-by: Ray Jui Reviewed-by: Scott Branden Reviewed-by: Guenter Roeck --- drivers/watchdog/sp805_wdt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 03805bc..1484609 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -230,7 +230,14 @@ sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id) spin_lock_init(&wdt->lock); watchdog_set_nowayout(&wdt->wdd, nowayout); watchdog_set_drvdata(&wdt->wdd, wdt); - wdt_setload(&wdt->wdd, DEFAULT_TIMEOUT); + + /* + * If 'timeout-sec' devicetree property is specified, use that. + * Otherwise, use DEFAULT_TIMEOUT + */ + wdt->wdd.timeout = DEFAULT_TIMEOUT; + watchdog_init_timeout(&wdt->wdd, 0, &adev->dev); + wdt_setload(&wdt->wdd, wdt->wdd.timeout); ret = watchdog_register_device(&wdt->wdd); if (ret) {