From patchwork Fri May 31 09:18:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 17320 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 83BFB25CAB for ; Fri, 31 May 2013 09:20:22 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l13sf1330509yen.2 for ; Fri, 31 May 2013 02:20:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=d2h6H82CLu1ns5JEmAcoe/BFpaO9eAs/OgF431tlfaA=; b=LUC9m5S3S6RsG1LGPp2+cFM6OoUtrA6nHUY5y1PlcG5WqfdZkSeK98r0uCOsj7GVOu oxiHjqcvkYGxEbfTMF62gm4+zez2h04uyQRRmNG68g6uL7GTqKCsHIF5UYStjUBpJhw2 4Q+f5/3lwBdq2g9JwawT2tL/O1vVLl34KyqCqK/pQwhdYm0yytTtXksenWHEyI73z5QM oMI1AN91VMVNzsI49w/fnYX51U1FFLYIYq6HmtKW11FqVFgXSonsMw8kdE8H9PAFusP8 5nzPJH6r+pKs1GqFGHwoPJLtsZx1HMgH+BAW3/VgdZ3mUyfwRuM838T4yCTJezWeld0B nL9w== X-Received: by 10.224.59.205 with SMTP id m13mr6285880qah.7.1369992022232; Fri, 31 May 2013 02:20:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.4.1 with SMTP id g1ls799927qeg.64.gmail; Fri, 31 May 2013 02:20:22 -0700 (PDT) X-Received: by 10.52.233.34 with SMTP id tt2mr7814388vdc.70.1369992021950; Fri, 31 May 2013 02:20:21 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id tq4si27811546vdc.92.2013.05.31.02.20.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 02:20:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id hf12so907121vcb.3 for ; Fri, 31 May 2013 02:20:21 -0700 (PDT) X-Received: by 10.58.187.164 with SMTP id ft4mr9226618vec.5.1369992021800; Fri, 31 May 2013 02:20:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.229.199 with SMTP id jj7csp42384vcb; Fri, 31 May 2013 02:20:21 -0700 (PDT) X-Received: by 10.14.202.130 with SMTP id d2mr12694064eeo.95.1369992020710; Fri, 31 May 2013 02:20:20 -0700 (PDT) Received: from eu1sys200aog119.obsmtp.com (eu1sys200aog119.obsmtp.com [207.126.144.147]) by mx.google.com with SMTP id c5si30063675eep.93.2013.05.31.02.19.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 May 2013 02:20:20 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.147 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.147; Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob119.postini.com ([207.126.147.11]) with SMTP ID DSNKUahrPbqgKheO/5EmnWIi+alBAzhDSDUK@postini.com; Fri, 31 May 2013 09:20:20 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id B9A9326F; Fri, 31 May 2013 09:19:56 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 432E14A27; Fri, 31 May 2013 09:19:39 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 21228A8065; Fri, 31 May 2013 11:19:52 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Fri, 31 May 2013 11:19:56 +0200 From: Linus Walleij To: Cc: Arnd Bergmann , Linus Walleij Subject: [PATCH 08/39] watchdog: coh901327: devicetree support Date: Fri, 31 May 2013 11:18:43 +0200 Message-ID: <1369991954-17406-9-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1369991954-17406-1-git-send-email-linus.walleij@stericsson.com> References: <1369991954-17406-1-git-send-email-linus.walleij@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlZQfeGIj3pqe4Ggkcxf6l8CccEVhHJdvm7P6hDo3LdfpGyEC+NJDZ6CckUUVUyAPBlg0zs X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Linus Walleij This adds support for probing the COH 901 327 watchdog from the device tree and also adds associated bindings. Acked-by: Wim Van Sebroeck Reviewed-by: Guenter Roeck Signed-off-by: Linus Walleij --- .../bindings/watchdog/stericsson-coh901327.txt | 19 +++++++++++++++++++ drivers/watchdog/coh901327_wdt.c | 12 +++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt diff --git a/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt b/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt new file mode 100644 index 0000000..8ffb88e --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/stericsson-coh901327.txt @@ -0,0 +1,19 @@ +ST-Ericsson COH 901 327 Watchdog timer + +Required properties: +- compatible: must be "stericsson,coh901327". +- reg: physical base address of the controller and length of memory mapped + region. +- interrupts: the interrupt used for the watchdog timeout warning. + +Optional properties: +- timeout-sec: contains the watchdog timeout in seconds. + +Example: + +watchdog: watchdog@c0012000 { + compatible = "stericsson,coh901327"; + reg = <0xc0012000 0x1000>; + interrupts = <3>; + timeout-sec = <60>; +}; diff --git a/drivers/watchdog/coh901327_wdt.c b/drivers/watchdog/coh901327_wdt.c index b9b8a8b..4bd070f 100644 --- a/drivers/watchdog/coh901327_wdt.c +++ b/drivers/watchdog/coh901327_wdt.c @@ -354,9 +354,9 @@ static int __init coh901327_probe(struct platform_device *pdev) clk_disable(clk); - if (margin < 1 || margin > 327) - margin = 60; - coh901327_wdt.timeout = margin; + ret = watchdog_init_timeout(&coh901327_wdt, margin, &pdev->dev); + if (ret < 0) + coh901327_wdt.timeout = 60; ret = watchdog_register_device(&coh901327_wdt); if (ret == 0) @@ -441,10 +441,16 @@ void coh901327_watchdog_reset(void) /* Return and await doom */ } +static const struct of_device_id coh901327_dt_match[] = { + { .compatible = "stericsson,coh901327" }, + {}, +}; + static struct platform_driver coh901327_driver = { .driver = { .owner = THIS_MODULE, .name = "coh901327_wdog", + .of_match_table = coh901327_dt_match, }, .remove = __exit_p(coh901327_remove), .suspend = coh901327_suspend,