From patchwork Wed Jun 22 09:54:32 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas.abraham@linaro.org X-Patchwork-Id: 2157 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 1971123F4D for ; Wed, 22 Jun 2011 09:45:00 +0000 (UTC) Received: from mail-vw0-f52.google.com (mail-vw0-f52.google.com [209.85.212.52]) by fiordland.canonical.com (Postfix) with ESMTP id BD42FA18119 for ; Wed, 22 Jun 2011 09:44:59 +0000 (UTC) Received: by vws16 with SMTP id 16so696185vws.11 for ; Wed, 22 Jun 2011 02:44:59 -0700 (PDT) Received: by 10.52.100.72 with SMTP id ew8mr611349vdb.247.1308735899088; Wed, 22 Jun 2011 02:44:59 -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.52.183.130 with SMTP id em2cs125442vdc; Wed, 22 Jun 2011 02:44:58 -0700 (PDT) Received: by 10.236.192.201 with SMTP id i49mr735775yhn.525.1308735898332; Wed, 22 Jun 2011 02:44:58 -0700 (PDT) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by mx.google.com with ESMTP id j68si2051619yhe.79.2011.06.22.02.44.57; Wed, 22 Jun 2011 02:44:58 -0700 (PDT) Received-SPF: neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) client-ip=203.254.224.34; Authentication-Results: mx.google.com; spf=neutral (google.com: 203.254.224.34 is neither permitted nor denied by best guess record for domain of thomas.abraham@linaro.org) smtp.mail=thomas.abraham@linaro.org Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LN600K2VR2FRHE0@mailout4.samsung.com> for patches@linaro.org; Wed, 22 Jun 2011 18:44:47 +0900 (KST) X-AuditID: cbfee61a-b7c59ae000003b70-a3-4e01b98e76c5 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 91.69.15216.E89B10E4; Wed, 22 Jun 2011 18:44:46 +0900 (KST) Received: from localhost.localdomain ([107.108.73.37]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LN600D60R2IPD@mmp2.samsung.com> for patches@linaro.org; Wed, 22 Jun 2011 18:44:47 +0900 (KST) Date: Wed, 22 Jun 2011 15:24:32 +0530 From: Thomas Abraham Subject: [PATCH] watchdog: s3c2410: Add support for device tree based probe To: linux-watchdog@vger.kernel.org Cc: wim@iguana.be, devicetree-discuss@lists.ozlabs.org, grant.likely@secretlab.ca, kgene.kim@samsung.com, ben-linux@fluff.org, patches@linaro.org Message-id: <1308736472-22380-1-git-send-email-thomas.abraham@linaro.org> X-Mailer: git-send-email 1.6.6.rc2 Content-transfer-encoding: 7BIT X-Brightmail-Tracker: AAAAAA== This patch adds the of_match_table to enable s3c2410-wdt driver to be probed when watchdog device node is found in the device tree. Signed-off-by: Thomas Abraham Acked-by: Grant Likely --- .../devicetree/bindings/watchdog/samsung-wdt.txt | 12 ++++++++++++ drivers/watchdog/s3c2410_wdt.c | 10 ++++++++++ 2 files changed, 22 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/watchdog/samsung-wdt.txt diff --git a/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt new file mode 100644 index 0000000..f2617e8 --- /dev/null +++ b/Documentation/devicetree/bindings/watchdog/samsung-wdt.txt @@ -0,0 +1,12 @@ +* Samsung's Watchdog Timer Controller + +The Samsung's Watchdog controller is used for resuming system operation +after a preset amount of time during which the WDT reset event has not +occured. + +Required properties: +- compatible : should be "samsung,s3c2410-wdt" +- reg : base physical address of the controller and length of memory mapped + region. +- interrupts : interrupt number to the cpu. + diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index f7f5aa0..30da88f 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -589,6 +589,15 @@ static int s3c2410wdt_resume(struct platform_device *dev) #define s3c2410wdt_resume NULL #endif /* CONFIG_PM */ +#ifdef CONFIG_OF +static const struct of_device_id s3c2410_wdt_match[] = { + { .compatible = "samsung,s3c2410-wdt" }, + {}, +}; +MODULE_DEVICE_TABLE(of, s3c2410_wdt_match); +#else +#define s3c2410_wdt_match NULL +#endif static struct platform_driver s3c2410wdt_driver = { .probe = s3c2410wdt_probe, @@ -599,6 +608,7 @@ static struct platform_driver s3c2410wdt_driver = { .driver = { .owner = THIS_MODULE, .name = "s3c2410-wdt", + .of_match_table = s3c2410_wdt_match, }, };