From patchwork Tue Dec 30 11:36:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Robinson X-Patchwork-Id: 5551971 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B3909BF6C3 for ; Tue, 30 Dec 2014 11:39:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C8C812010F for ; Tue, 30 Dec 2014 11:39:14 +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 170922010E for ; Tue, 30 Dec 2014 11:39:14 +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 1Y5v6q-0008Qt-NU; Tue, 30 Dec 2014 11:37:08 +0000 Received: from mail-pd0-x231.google.com ([2607:f8b0:400e:c02::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y5v6o-0008Or-1P for linux-arm-kernel@lists.infradead.org; Tue, 30 Dec 2014 11:37:06 +0000 Received: by mail-pd0-f177.google.com with SMTP id ft15so18786979pdb.8 for ; Tue, 30 Dec 2014 03:36:44 -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=K6sKV+e1vl90j7ik9Zz+3pkZVhjRDmz/BepXUt+prXM=; b=Ann9AdNXvUuJR8z9qYGW2e96VWkCDdt3kqzG9g/EOZB8y8nAVK5BB+6zYEszDVSYhn 2eTVeB2e3XoOv0jg6KCJiQJEUtikujRYYq+9RAsPA9jgKEiIgYnH1Z0qOdPnLsmdRtGq oIpPJoIUFkz9N+FF+8isLiDWaTr3AtTHYyFcBIj4HREFfz6/ve+HrK772uO5/gqj2jvr HyCQ6zjiRCoxOhkIIB/Hp+YIgS4xh0Q0JLJSMZbH4Rr9yOwiECCosyoDtHjgkilg1cyC ERmYnPd/HszfEwWjPs6vkIosUPWF5yJM0N1HakvU7iYTPXtCGVRYPaIuoEHzzBtcBc6x oq6w== X-Received: by 10.70.36.236 with SMTP id t12mr97930257pdj.143.1419939404635; Tue, 30 Dec 2014 03:36:44 -0800 (PST) Received: from neo.roving-it.com (CPE-121-215-29-71.lnse1.pie.bigpond.net.au. [121.215.29.71]) by mx.google.com with ESMTPSA id hn4sm38198822pdb.77.2014.12.30.03.36.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Dec 2014 03:36:43 -0800 (PST) From: Peter Robinson To: Mike Rapoport , Alessandro Zummo , Grant Likely , linux-arm-kernel@lists.infradead.org, arm@kernel.org Subject: [PATCH] drivers/rtc/rtc-em3027.c: add device tree support Date: Tue, 30 Dec 2014 11:36:20 +0000 Message-Id: <1419939380-4439-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-20141230_033706_147936_FB777CDE X-CRM114-Status: GOOD ( 11.81 ) 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/rtc/rtc-em3027.c b/drivers/rtc/rtc-em3027.c index fccf366..7fbb051 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,21 @@ 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", + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(em3027_of_match), }, .probe = &em3027_probe, .id_table = em3027_id,