From patchwork Tue Jan 13 01:57:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Robinson X-Patchwork-Id: 5617241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 68B4A9F2ED for ; Tue, 13 Jan 2015 02:01:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B13F204C9 for ; Tue, 13 Jan 2015 02:01:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3014203AC for ; Tue, 13 Jan 2015 02:01:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YAqkt-0006XI-HY; Tue, 13 Jan 2015 01:58:51 +0000 Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YAqkq-0006Vg-AR for linux-arm-kernel@lists.infradead.org; Tue, 13 Jan 2015 01:58:48 +0000 Received: by mail-pa0-f46.google.com with SMTP id lf10so503449pab.5 for ; Mon, 12 Jan 2015 17:58:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=zWh/+Y48WgoHHIXXrCWfbS83M1jGqh2ex+7MInzA7wE=; b=dooXBnCLScJE+4x9MWuze9rHIrka9SgWDk9uajRTU6MgvCX6RO2J8FhqLjSFo7b3Kl hiWZ30lIgI9ebfIXQ2mP3De+I1cwl1oJRX8YAvyylQvH8ZR95Z9j5MPwGc7Cw/pi+pF1 TBVYLgAc33LHPW5XfLJMV95apoIL4AT3SSnK9QwlGbp6+i8BMwO5sNn8S1CgfJIs65/V sPyTJTLNy/LiCIjO8j2+exrTDz0dhotw7LQEsQD4T/J3/vtnKyQX6rWGH3f7j6AmA3gZ MAFwEU17PyMM0Ov4mTQOpPxFrTs7ethAS5/G885YHyjxYI6s07rJBnHYlolYK9DECjb+ zz4g== X-Received: by 10.68.212.229 with SMTP id nn5mr47527585pbc.52.1421114306736; Mon, 12 Jan 2015 17:58:26 -0800 (PST) Received: from neo.roving-it.com.com (58-7-151-225.dyn.iinet.net.au. [58.7.151.225]) by mx.google.com with ESMTPSA id nv7sm15385357pbc.29.2015.01.12.17.58.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jan 2015 17:58:26 -0800 (PST) From: Peter Robinson To: Mike Rapoport , Alessandro Zummo , Grant Likely , linux-arm-kernel@lists.infradead.org, arm@kernel.org, linux-tegra@kernel.org, rtc-linux@googlegroups.com Subject: [PATCH] drivers/rtc/rtc-em3027.c: add device tree support Date: Tue, 13 Jan 2015 01:57:53 +0000 Message-Id: <1421114273-16368-1-git-send-email-pbrobinson@gmail.com> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150112_175848_403305_0571CAAC X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -0.8 (/) Cc: Peter Robinson X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Set the of_match_table for this driver so that devices can be described in the device tree. This device is used in the Trimslice and is already defined in the Trimslice device tree. Signed-off-by: Peter Robinson --- drivers/rtc/rtc-em3027.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/rtc/rtc-em3027.c b/drivers/rtc/rtc-em3027.c index fccf366..4f4930a 100644 --- a/drivers/rtc/rtc-em3027.c +++ b/drivers/rtc/rtc-em3027.c @@ -15,6 +15,7 @@ #include #include #include +#include /* Registers */ #define EM3027_REG_ON_OFF_CTRL 0x00 @@ -135,10 +136,20 @@ static struct i2c_device_id em3027_id[] = { { "em3027", 0 }, { } }; +MODULE_DEVICE_TABLE(i2c, em3027_id); + +#ifdef CONFIG_OF +static const struct of_device_id em3027_of_match[] = { + { .compatible = "emmicro,em3027", }, + {} +}; +MODULE_DEVICE_TABLE(of, em3027_of_match); +#endif static struct i2c_driver em3027_driver = { .driver = { .name = "rtc-em3027", + .of_match_table = of_match_ptr(em3027_of_match), }, .probe = &em3027_probe, .id_table = em3027_id,