Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1938470imm; Tue, 22 May 2018 11:49:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq4OJ26sbAECx2+955R0lqoffrtiCV3aCsafPdQmnAgGLFwYm+2Dovq/NgtmI96iFfH7cBR X-Received: by 2002:a62:c95c:: with SMTP id k89-v6mr25174666pfg.47.1527014976811; Tue, 22 May 2018 11:49:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527014976; cv=none; d=google.com; s=arc-20160816; b=UXrM/3KVMfHVDxunQ8xpe5eD3XeReAR0NKchSzKgD9BuRQ2Xh/0Id/gE22WyRb4mhh qXowbxyHEjYB7/kEIDm5R0TQwW09NIYiAQDdTkTUMfubr/qlWytZARNpBDTdqjdsC2/5 unS+jg60Tdv/HR8z0zppDRfNUEP+29rboYfakrdNNuv4tUzD9XpoUyOl8LgHV+0lafH1 qBR/dStYqWRYGbr9xxDO0/HyKTde65lFJBkR4dJmdDK6ScZA3HH5UYsZtZTAN2HsWiM3 7LmkS9rCI35X8DHJq0xImG1HI1by3oLlEPMsw5TH8mmMO95DPa/KJZ+wqToOOmMCsWxW NM7Q== 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=exZylvMJwEHexVLYkrmf6JJVuwwCpK/mmoDKYkpd+mI=; b=wkyBTUwsbWl6M2OOU2zZlc4vGa1AS2+fhbCR0PWQdvsFkS7gds7P4payUOtb7uE6kX 2xd4s5/00ZlE5ZECgzsi+C8lJDzHowj8X5OrK/BGub8PD3ZfOqW3JIOAu9rvCBHgmeDB wZeRiZ4ZoJre6j8npqKuHhjr9O9C0JlB5lkr9yoDLKg+vcEoeoNWQ5XKuYQIJ+NXqSXT t2A6Iqoy09IaqhTeX8+JWRh97CV0dC3gPxYxQotjZpq7BhMi0bxvEiNVILgAnbtut4ry cieOVym7bSJL0VMW7Ja08fhyXq0ZLQmUxMgTI5H+kJcV6GBysNZGEv3n7qMApD0zFKYP LNeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=U4QnSZbT; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h185-v6si16586881pfe.332.2018.05.22.11.49.22; Tue, 22 May 2018 11:49:36 -0700 (PDT) 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=@broadcom.com header.s=google header.b=U4QnSZbT; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751880AbeEVSro (ORCPT + 99 others); Tue, 22 May 2018 14:47:44 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:44535 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751737AbeEVSrk (ORCPT ); Tue, 22 May 2018 14:47:40 -0400 Received: by mail-qt0-f195.google.com with SMTP id d3-v6so24804089qtp.11 for ; Tue, 22 May 2018 11:47:40 -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=exZylvMJwEHexVLYkrmf6JJVuwwCpK/mmoDKYkpd+mI=; b=U4QnSZbTE+h9hdeNWS57zxAhZ3w5sj1ADuf4UTFVSohlE7+oCc6Oz+lJpO34TYqeva QfHTKKPO8j4Izk7CQ04h6WihzlTeirJGqV9GHXx0PJiUAc7agnKtj28Pa+/fGl8Gbvsd 370YukWutSTLVICcLqLcnjjJJVeozJYCzjSxk= 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=exZylvMJwEHexVLYkrmf6JJVuwwCpK/mmoDKYkpd+mI=; b=d4N4WZnElXQJZcJz6/0/4h2+2Pj9iXDZYbepBeHTG0PkwhkXwikeZM1zYibZe1Kf6W xhOEq54hvBeeRiM8chzeYctLf0pq76xWquhBsZfGs0HYbPOtYiZM4cO4WtC+x3VymATt u9kRyctfyqsaPMELsra//I/IOZknn8OeZBLg8bIO4VDn6ub3pmdR5rwXjoqBZIaJAclE XDDX4n/bN32IcKaxKHGrzCrcPO7575YQWM6q/voxpqA4NqdzuUjFof/LEkJ27zCisinP yYpgmPL9wO0fHFJYN2o0Fj0aOHcJQQxV6mBhOzngTDZTPvC/2Q3R4KLOdlpmiymuFvKi WD5Q== X-Gm-Message-State: ALKqPwdy5JEcu/oISNqH015vFm4xmzm6BByFWhsz1lF+06vtSxOwoaoX ZWEXMgx8TTWQsxURJjAQWYK88Q== X-Received: by 2002:ac8:8b8:: with SMTP id v53-v6mr24706690qth.373.1527014860184; Tue, 22 May 2018 11:47:40 -0700 (PDT) Received: from lbrmn-lnxub44-1.ric.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id i69-v6sm192501qke.87.2018.05.22.11.47.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 11:47:39 -0700 (PDT) From: Ray Jui To: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Mark Rutland , Frank Rowand , Catalin Marinas , Will Deacon Cc: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Ray Jui Subject: [PATCH 2/5] watchdog: sp805: add 'timeout-sec' DT property support Date: Tue, 22 May 2018 11:47:17 -0700 Message-Id: <1527014840-21236-3-git-send-email-ray.jui@broadcom.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1527014840-21236-1-git-send-email-ray.jui@broadcom.com> References: <1527014840-21236-1-git-send-email-ray.jui@broadcom.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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) { -- 2.1.4