From patchwork Wed May 23 20:32:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ray Jui X-Patchwork-Id: 10422395 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 EB54360545 for ; Wed, 23 May 2018 20:39:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA1CC2922A for ; Wed, 23 May 2018 20:39:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE30D2922C; Wed, 23 May 2018 20:39:58 +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 4EE622922A for ; Wed, 23 May 2018 20:39:58 +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=N+7sGszoLdTBxe710kpx3BjSRE wcFT8hRwm6IROdmWv+bnXmiylCVrJGKkQ2sQoGqBadai/i5HyUDvMj9tkHaNSKLmHrtETNdqTXjR1 OOGXgHj+nGUVQDTCIMdCx2d6CXw+ErHuLUj1YWA5/wzJPwt8WFRSdAjtpFEp+7d25wHANpT0cr1tO pc9BnmHBXCGzxgmzU3nogFo/NYoPWbx1Sf8MTNtkPQuZ8MSHSRACLoVKKX/PBJlyCaWFZDpr3QHLM DlaaMct7J+fn345JCfCgLEmLFueoHhYjtPxLC3cQHZkwwaXn6GMLv6Qy5+BnT4m1fQFAt0ukn92Wh m3CZf93g==; 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 1fLaXz-00008P-EO; Wed, 23 May 2018 20:39:47 +0000 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLaRA-0005Q1-E2 for linux-arm-kernel@lists.infradead.org; Wed, 23 May 2018 20:32:54 +0000 Received: by mail-qk0-x241.google.com with SMTP id r28-v6so16301015qkk.4 for ; Wed, 23 May 2018 13:32:34 -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=AMOQEiUS9FhllZABckCIayi8H+zZJd5EOYBWDu4RRGqNsL6c/N5NHomAZ4C/Ivrek4 7KdV8aZtZtPcTLJFVzIZtFLpfe0x/ieVOcW49C2RMIr96ZrbWEr7PPLXT46v9zLK2KoF R2pdgOf39io4LkIkCMyug/cxW49/6zWmB5Ydw= 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=K0VaZVK8iR/FVOc35RumiCtifGfEr/vTeSFaRJBAQy1sS7gkeCC8v+pA/l4lToBK9l 4w3nexUmwcDh68G2bDfd/Touijtp6ZE7mw18kf7KzmQNzBp5IziMQ5nyZT1RCuXhndnd KM2IDZVwgvPrTe6cA+AhGddszWd4yB57oXoS8CR5ORdwr30FZ+C2Nyh1vLYm9M8UXbdb cGhzHp2eL9phIfTLkUZTIRRFI3zsB8ogAGlf+sB6oXrBHlLTR0kY8wgUxsroWyAqZPRO JJhlVWGQ1WaWbfxIvOTdp7Kovlc3vEDjfla0dbJ+wrX27Fo9TQ7oJG5bnMHHmwoOzVeD sibQ== X-Gm-Message-State: ALKqPwfRqxgcdheDDfJt7s7tv4Lowz/dLgLh3y7kzwouu6twdrVR6VVn bXN1pOwo9snT3S2EQwCkqs45Fw== X-Google-Smtp-Source: ADUXVKKyMlAxTSVqP5L2Or1CUlRYWZ+sx6/CRWwTfnjRBIZ9DXftvIbL3s9CWSYfTTT9pipNNn1Pig== X-Received: by 2002:a37:a396:: with SMTP id m144-v6mr4018819qke.121.1527107553224; Wed, 23 May 2018 13:32:33 -0700 (PDT) Received: from lbrmn-lnxub44-1.ric.broadcom.com ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id z64-v6sm14598151qke.66.2018.05.23.13.32.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 May 2018 13:32:32 -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 v2 3/6] watchdog: sp805: add 'timeout-sec' DT property support Date: Wed, 23 May 2018 13:32:04 -0700 Message-Id: <1527107527-8093-4-git-send-email-ray.jui@broadcom.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1527107527-8093-1-git-send-email-ray.jui@broadcom.com> References: <1527107527-8093-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_133244_533878_09D7B35D X-CRM114-Status: GOOD ( 15.49 ) 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) {