From patchwork Mon Jul 18 03:15:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2734 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9BB242435D for ; Mon, 18 Jul 2011 03:03:33 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3424CA181B6 for ; Mon, 18 Jul 2011 03:03:33 +0000 (UTC) Received: by qyk30 with SMTP id 30so1975914qyk.11 for ; Sun, 17 Jul 2011 20:03:32 -0700 (PDT) Received: by 10.229.25.212 with SMTP id a20mr4537619qcc.148.1310958212627; Sun, 17 Jul 2011 20:03:32 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.229.217.78 with SMTP id hl14cs42944qcb; Sun, 17 Jul 2011 20:03:32 -0700 (PDT) Received: by 10.42.91.139 with SMTP id p11mr6250795icm.402.1310958211187; Sun, 17 Jul 2011 20:03:31 -0700 (PDT) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id hu5si10160575icc.111.2011.07.17.20.03.29 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jul 2011 20:03:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by iyb26 with SMTP id 26so3027014iyb.37 for ; Sun, 17 Jul 2011 20:03:29 -0700 (PDT) Received: by 10.231.112.150 with SMTP id w22mr5582050ibp.61.1310958209617; Sun, 17 Jul 2011 20:03:29 -0700 (PDT) Received: from localhost.localdomain ([117.82.25.202]) by mx.google.com with ESMTPS id v3sm2610614ibh.33.2011.07.17.20.03.18 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Jul 2011 20:03:28 -0700 (PDT) From: Shawn Guo To: linux-watchdog@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org, patches@linaro.org, Shawn Guo , Grant Likely , Wolfram Sang , Wim Van Sebroeck Subject: [PATCH] watchdog: imx2_wdt: add device tree probe support Date: Mon, 18 Jul 2011 11:15:21 +0800 Message-Id: <1310958921-18083-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 It adds device tree probe support for imx2_wdt driver. Signed-off-by: Shawn Guo Cc: Grant Likely Cc: Wolfram Sang Cc: Wim Van Sebroeck --- .../devicetree/bindings/watchdog/fsl-imx-wdt.txt | 14 ++++++++++++++ drivers/watchdog/imx2_wdt.c | 6 ++++++ 2 files changed, 20 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt diff --git a/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt b/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt new file mode 100644 index 0000000..2144af1 --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/fsl-imx-wdt.txt @@ -0,0 +1,14 @@ +* Freescale i.MX Watchdog Timer (WDT) Controller + +Required properties: +- compatible : Should be "fsl,-wdt" +- reg : Should contain WDT registers location and length +- interrupts : Should contain WDT interrupt + +Examples: + +wdt@73f98000 { + compatible = "fsl,imx51-wdt", "fsl,imx21-wdt"; + reg = <0x73f98000 0x4000>; + interrupts = <58>; +}; diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c index 86f7cac..b8ef2c6 100644 --- a/drivers/watchdog/imx2_wdt.c +++ b/drivers/watchdog/imx2_wdt.c @@ -329,12 +329,18 @@ static void imx2_wdt_shutdown(struct platform_device *pdev) } } +static const struct of_device_id imx2_wdt_dt_ids[] = { + { .compatible = "fsl,imx21-wdt", }, + { /* sentinel */ } +}; + static struct platform_driver imx2_wdt_driver = { .remove = __exit_p(imx2_wdt_remove), .shutdown = imx2_wdt_shutdown, .driver = { .name = DRIVER_NAME, .owner = THIS_MODULE, + .of_match_table = imx2_wdt_dt_ids, }, };