From patchwork Wed Nov 14 22:52:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 1744521 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id D1BA9DF264 for ; Wed, 14 Nov 2012 22:55:01 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TYlpN-0006F7-G7; Wed, 14 Nov 2012 22:53:01 +0000 Received: from mail.linuxfoundation.org ([140.211.169.12]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TYlpJ-0006Eo-Nf for linux-arm-kernel@lists.infradead.org; Wed, 14 Nov 2012 22:52:58 +0000 Received: from akpm.mtv.corp.google.com (216-239-45-4.google.com [216.239.45.4]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 997309EE; Wed, 14 Nov 2012 22:52:54 +0000 (UTC) Date: Wed, 14 Nov 2012 14:52:53 -0800 From: Andrew Morton To: Sascha Hauer Subject: Re: [PATCH resend] rtc: i.MX dryice: Add devicetree support Message-Id: <20121114145253.aa79fb48.akpm@linux-foundation.org> In-Reply-To: <1352709770-5919-1-git-send-email-s.hauer@pengutronix.de> References: <1352709770-5919-1-git-send-email-s.hauer@pengutronix.de> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121114_175257_888032_E3BE7FD5 X-CRM114-Status: GOOD ( 18.96 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Roland Stigge , Alessandro Zummo , rtc-linux@googlegroups.com, kernel@pengutronix.de, Shawn Guo , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org On Mon, 12 Nov 2012 09:42:50 +0100 Sascha Hauer wrote: > Add devicetree probing, fixing some whitespace damage along the way. > I've already merged the below. It has better code but a little less documentation: From: Roland Stigge Subject: drivers/rtc/rtc-imxdi.c: add devicetree support Add device tree support to the rtc-imxdi driver. Signed-off-by: Roland Stigge Cc: Alessandro Zummo Cc: Grant Likely Cc: Sascha Hauer Cc: Russell King Signed-off-by: Andrew Morton --- Documentation/devicetree/bindings/rtc/imxdi-rtc.txt | 17 ++++++++++ drivers/rtc/rtc-imxdi.c | 11 ++++++ 2 files changed, 28 insertions(+) diff -puN /dev/null Documentation/devicetree/bindings/rtc/imxdi-rtc.txt --- /dev/null +++ a/Documentation/devicetree/bindings/rtc/imxdi-rtc.txt @@ -0,0 +1,17 @@ +* i.MX25 Real Time Clock controller + +This binding supports the following chips: i.MX25, i.MX53 + +Required properties: +- compatible: should be: "fsl,imx25-rtc" +- reg: physical base address of the controller and length of memory mapped + region. +- interrupts: rtc alarm interrupt + +Example: + +rtc@80056000 { + compatible = "fsl,imx53-rtc", "fsl,imx25-rtc"; + reg = <0x80056000 2000>; + interrupts = <29>; +}; diff -puN drivers/rtc/rtc-imxdi.c~rtc-imxdi-add-devicetree-support drivers/rtc/rtc-imxdi.c --- a/drivers/rtc/rtc-imxdi.c~rtc-imxdi-add-devicetree-support +++ a/drivers/rtc/rtc-imxdi.c @@ -37,6 +37,7 @@ #include #include #include +#include /* DryIce Register Definitions */ @@ -495,10 +496,20 @@ static int __devexit dryice_rtc_remove(s return 0; } +#ifdef CONFIG_OF +static const struct of_device_id dryice_dt_ids[] = { + { .compatible = "fsl,imx25-rtc" }, + { /* sentinel */ } +}; + +MODULE_DEVICE_TABLE(of, dryice_dt_ids); +#endif + static struct platform_driver dryice_rtc_driver = { .driver = { .name = "imxdi_rtc", .owner = THIS_MODULE, + .of_match_table = of_match_ptr(dryice_dt_ids), }, .remove = __devexit_p(dryice_rtc_remove), };