From patchwork Sun May 27 02:11:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 161517 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ee0-f56.google.com (mail-ee0-f56.google.com [74.125.83.56]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 99696B6F62 for ; Sun, 27 May 2012 12:11:42 +1000 (EST) Received: by eeke53 with SMTP id e53sf1097919eek.11 for ; Sat, 26 May 2012 19:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=mime-version:x-beenthere:received-spf:x-virus-scanned:from:to:cc :subject:date:message-id:x-mailer:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=5YbnMjOzDO09FbUt4kxGiWbNsRJK1yhIgcCVSKKW1VA=; b=VauVHQuj1D6byf6WEVy5ZzMqbs4v6NKDl1un1DjRynkyqhDY/VE0Z8C7BaAnMrPkuW YalmHLkkMoWgK13XHfsJEPFNU3R0GmQPs+Ry8+q55lus/CW2MGSxecxvHU9At3PiPO87 PoLvMGmzixdOSy9PzxJljffKDe5sTKgp1tKgo= Received: by 10.216.142.78 with SMTP id h56mr68854wej.9.1338084698113; Sat, 26 May 2012 19:11:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.180.75.78 with SMTP id a14ls847464wiw.4.gmail; Sat, 26 May 2012 19:11:37 -0700 (PDT) Received: by 10.216.29.9 with SMTP id h9mr209163wea.13.1338084697509; Sat, 26 May 2012 19:11:37 -0700 (PDT) Received: by 10.216.29.9 with SMTP id h9mr209162wea.13.1338084697493; Sat, 26 May 2012 19:11:37 -0700 (PDT) Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.10]) by gmr-mx.google.com with ESMTPS id a10si1450648wix.2.2012.05.26.19.11.37 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 May 2012 19:11:37 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of marex@denx.de) client-ip=212.18.0.10; Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3W0Pnz3mkXz3hhXj; Sun, 27 May 2012 04:11:35 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id 3W0Pnz3f50z4KK2Q; Sun, 27 May 2012 04:11:35 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from smtp-auth.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id s85uFAZua47r; Sun, 27 May 2012 04:11:35 +0200 (CEST) Received: from mashiro.lan (unknown [195.140.253.167]) by smtp-auth.mnet-online.de (Postfix) with ESMTPA; Sun, 27 May 2012 04:11:34 +0200 (CEST) From: Marek Vasut To: linux-arm-kernel@lists.infradead.org Cc: Marek Vasut , Alessandro Zummo , devicetree-discuss@lists.ozlabs.org, Grant Likely , Rob Herring , rtc-linux@googlegroups.com, Shawn Guo Subject: [rtc-linux] [PATCH] MXS: Add DT binding support into stmp3xxx-rtc Date: Sun, 27 May 2012 04:11:29 +0200 Message-Id: <1338084689-12003-1-git-send-email-marex@denx.de> X-Mailer: git-send-email 1.7.10 X-Original-Sender: marex@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.10 is neither permitted nor denied by best guess record for domain of marex@denx.de) smtp.mail=marex@denx.de Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Add simple binding for the stmp3xxx-rtc. Signed-off-by: Marek Vasut Cc: Alessandro Zummo Cc: devicetree-discuss@lists.ozlabs.org Cc: Grant Likely Cc: Rob Herring Cc: rtc-linux@googlegroups.com Cc: Shawn Guo --- .../devicetree/bindings/rtc/stmp3xxx-rtc.txt | 20 ++++++++++++++++++++ arch/arm/boot/dts/imx28.dtsi | 1 + drivers/rtc/rtc-stmp3xxx.c | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt diff --git a/Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt b/Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt new file mode 100644 index 0000000..a49dd52 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/stmp3xxx-rtc.txt @@ -0,0 +1,20 @@ +* STMP3xxx/i.MX28 Time Clock controller + +Required properties: +- compatible: should be one of the following. + * "fsl,stmp3xxx-rtc" + * "fsl,imx28-rtc" +- reg: physical base address of the controller and length of memory mapped + region. +- interrupts: Two interrupt numbers to the cpu should be specified. First + interrupt number is the rtc rick interupt and second interrupt number + is the rtc alarm interrupt. The number of cells representing a interrupt + depends on the parent interrupt controller. + +Example: + + rtc@80056000 { + compatible = "fsl,imx28-rtc"; + reg = <0x80056000 2000>; + interrupts = <28 29>; + }; diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi index d470276..119f183 100644 --- a/arch/arm/boot/dts/imx28.dtsi +++ b/arch/arm/boot/dts/imx28.dtsi @@ -370,6 +370,7 @@ }; rtc@80056000 { + compatible = "fsl,imx28-rtc"; reg = <0x80056000 2000>; interrupts = <28 29>; status = "disabled"; diff --git a/drivers/rtc/rtc-stmp3xxx.c b/drivers/rtc/rtc-stmp3xxx.c index 1028786..dea9764 100644 --- a/drivers/rtc/rtc-stmp3xxx.c +++ b/drivers/rtc/rtc-stmp3xxx.c @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -265,6 +266,12 @@ static int stmp3xxx_rtc_resume(struct platform_device *dev) #define stmp3xxx_rtc_resume NULL #endif +static const struct of_device_id rtc_dt_ids[] = { + { .compatible = "fsl,stmp3xxx-rtc", }, + { .compatible = "fsl,imx28-rtc", }, + { /* sentinel */ } +}; + static struct platform_driver stmp3xxx_rtcdrv = { .probe = stmp3xxx_rtc_probe, .remove = stmp3xxx_rtc_remove, @@ -273,6 +280,7 @@ static struct platform_driver stmp3xxx_rtcdrv = { .driver = { .name = "stmp3xxx-rtc", .owner = THIS_MODULE, + .of_match_table = rtc_dt_ids, }, };