From patchwork Thu Feb 14 21:59:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joachim Eastwood X-Patchwork-Id: 220533 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-lb0-f190.google.com (mail-lb0-f190.google.com [209.85.217.190]) (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 261052C02A4 for ; Fri, 15 Feb 2013 08:59:47 +1100 (EST) Received: by mail-lb0-f190.google.com with SMTP id q12sf792796lbc.7 for ; Thu, 14 Feb 2013 13:59:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-received:mime-version:x-beenthere:x-received:x-received :received-spf:x-received: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=qiLgw6vjmp6P2ZYuEKHP3incYX81CZSg6InJq8sI+IE=; b=BCQs8cG21wiP1UyWYY1lX9stBJBaFQqywyR4U+zzaoCiAwb0Zx4UkYYTIB/aAJEja2 qs1tcqd7nvllLV6cnGbYZ5eGBR4DKPgmSyN1GzBKLW+fh/Mz/Owd+iubs0RjDrARqa77 CpALOUXim7lxXqQeUM17TMrk7hmABdjD5ohN0uJmCKxDdNVFN/+FqfRnTPZEYsV13rPP 22BA5cJDjs8u56QvHzvTAIGQ8lEcdDfqFcVmTS1HOy6m/K+Pd0UhuQm/xolBHmSlhy3M c3+i1vpmToPEnIehyO9O4HlH0YPboBaBuHR5lS4rVFPUJrbi9nl5p7X3M7Vfb7yRYS0t CBHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:x-received :received-spf:x-received: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=qiLgw6vjmp6P2ZYuEKHP3incYX81CZSg6InJq8sI+IE=; b=Chf+pvOBjlO4QNaDhxxaOGwQIajCCn0kTGh5SVgjbV09kTknbdap9LfxSXyUr5PTDH Yxza2S/xF+CWSHy9gY3jI6Camsp+o47+QHz/jNKdudklDCStonXBwMVeavebKhK/0S4l YdLemNvKfuVDfgGGomj4u3q+/i2F3C+sCehAPl69UBHzFtebCqKOXVujSHHJQmiXmEJd y+W030k224Et/pMgx1jhlza6u4t2/3UDqeg6ZN6Y/ce2lb0jTBTDKkfPkOK/1V9sATPl QW4kszoB2r/JMp2g5frYQqHxUnPbFGrrO72JZYpuvrz6qFjKWDOcv0n5jSNIfHE69qYu otSA== X-Received: by 10.180.86.66 with SMTP id n2mr18790wiz.11.1360879182596; Thu, 14 Feb 2013 13:59:42 -0800 (PST) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.180.76.167 with SMTP id l7ls91587wiw.52.canary; Thu, 14 Feb 2013 13:59:41 -0800 (PST) X-Received: by 10.204.9.140 with SMTP id l12mr36408bkl.7.1360879181292; Thu, 14 Feb 2013 13:59:41 -0800 (PST) X-Received: by 10.204.9.140 with SMTP id l12mr36407bkl.7.1360879181274; Thu, 14 Feb 2013 13:59:41 -0800 (PST) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com [209.85.217.174]) by gmr-mx.google.com with ESMTPS id i9si3957928bki.2.2013.02.14.13.59.41 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 13:59:41 -0800 (PST) Received-SPF: pass (google.com: domain of manabian@gmail.com designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id l12so2128507lbo.5 for ; Thu, 14 Feb 2013 13:59:41 -0800 (PST) X-Received: by 10.152.147.130 with SMTP id tk2mr215953lab.24.1360879180944; Thu, 14 Feb 2013 13:59:40 -0800 (PST) Received: from localhost.localdomain ([90.149.223.57]) by mx.google.com with ESMTPS id l1sm2240171lbn.8.2013.02.14.13.59.38 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 14 Feb 2013 13:59:39 -0800 (PST) From: Joachim Eastwood To: a.zummo@towertech.it Cc: rtc-linux@googlegroups.com, devicetree-discuss@lists.ozlabs.org, nicolas.ferre@atmel.com, plagnioj@jcrosoft.com, Joachim Eastwood Subject: [rtc-linux] [PATCH] rtc: at91rm9200: add DT support Date: Thu, 14 Feb 2013 22:59:07 +0100 Message-Id: <1360879147-17273-1-git-send-email-manabian@gmail.com> X-Mailer: git-send-email 1.8.0 X-Original-Sender: manabian@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of manabian@gmail.com designates 209.85.217.174 as permitted sender) smtp.mail=manabian@gmail.com; dkim=pass header.i=@gmail.com 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: , Signed-off-by: Joachim Eastwood Acked-by: Nicolas Ferre --- .../devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt | 15 +++++++++++++++ drivers/rtc/rtc-at91rm9200.c | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt new file mode 100644 index 0000000..2a3feab --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/atmel,at91rm9200-rtc.txt @@ -0,0 +1,15 @@ +Atmel AT91RM9200 Real Time Clock + +Required properties: +- compatible: should be: "atmel,at91rm9200-rtc" +- reg: physical base address of the controller and length of memory mapped + region. +- interrupts: rtc alarm/event interrupt + +Example: + +rtc@fffffe00 { + compatible = "atmel,at91rm9200-rtc"; + reg = <0xfffffe00 0x100>; + interrupts = <1 4 7>; +}; diff --git a/drivers/rtc/rtc-at91rm9200.c b/drivers/rtc/rtc-at91rm9200.c index b6469e2..2ea0ee3 100644 --- a/drivers/rtc/rtc-at91rm9200.c +++ b/drivers/rtc/rtc-at91rm9200.c @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include @@ -382,12 +384,19 @@ static const struct dev_pm_ops at91_rtc_pm = { #define at91_rtc_pm_ptr NULL #endif +static const struct of_device_id at91_rtc_dt_ids[] = { + { .compatible = "atmel,at91rm9200-rtc" }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, at91_rtc_dt_ids); + static struct platform_driver at91_rtc_driver = { .remove = __exit_p(at91_rtc_remove), .driver = { .name = "at91_rtc", .owner = THIS_MODULE, .pm = at91_rtc_pm_ptr, + .of_match_table = of_match_ptr(at91_rtc_dt_ids), }, };