aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-em3027.c
diff options
context:
space:
mode:
authorPeter Robinson <pbrobinson@gmail.com>2015-04-16 15:45:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:03:59 -0400
commite706974dc3e2f44891e736f4a96eb88b60356178 (patch)
treed5978c1161907a4d5d7ac7523d0d3deaacd3845c /drivers/rtc/rtc-em3027.c
parent7f48b21bdfede2c06e966258317a3bb4be3e4f25 (diff)
drivers/rtc/rtc-em3027.c: add device tree support
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 <pbrobinson@gmail.com> Cc: Mike Rapoport <mike@compulab.co.il> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Grant Likely <grant.likely@linaro.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-em3027.c')
-rw-r--r--drivers/rtc/rtc-em3027.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-em3027.c b/drivers/rtc/rtc-em3027.c
index fccf36699245..4f4930a2004c 100644
--- a/drivers/rtc/rtc-em3027.c
+++ b/drivers/rtc/rtc-em3027.c
@@ -15,6 +15,7 @@
15#include <linux/rtc.h> 15#include <linux/rtc.h>
16#include <linux/bcd.h> 16#include <linux/bcd.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/of.h>
18 19
19/* Registers */ 20/* Registers */
20#define EM3027_REG_ON_OFF_CTRL 0x00 21#define EM3027_REG_ON_OFF_CTRL 0x00
@@ -135,10 +136,20 @@ static struct i2c_device_id em3027_id[] = {
135 { "em3027", 0 }, 136 { "em3027", 0 },
136 { } 137 { }
137}; 138};
139MODULE_DEVICE_TABLE(i2c, em3027_id);
140
141#ifdef CONFIG_OF
142static const struct of_device_id em3027_of_match[] = {
143 { .compatible = "emmicro,em3027", },
144 {}
145};
146MODULE_DEVICE_TABLE(of, em3027_of_match);
147#endif
138 148
139static struct i2c_driver em3027_driver = { 149static struct i2c_driver em3027_driver = {
140 .driver = { 150 .driver = {
141 .name = "rtc-em3027", 151 .name = "rtc-em3027",
152 .of_match_table = of_match_ptr(em3027_of_match),
142 }, 153 },
143 .probe = &em3027_probe, 154 .probe = &em3027_probe,
144 .id_table = em3027_id, 155 .id_table = em3027_id,