diff options
author | Nick Bowler <nbowler@elliptictech.com> | 2012-07-30 17:41:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 20:25:19 -0400 |
commit | 8dccaf0607b3e047680952d0baf4da0486fbbcc1 (patch) | |
tree | 54761d376b0f00d52dd0d078e7fef71ef2697741 /drivers/rtc | |
parent | 0a25bf40d8ea9aeb8412666a7bc8ab95b4cddcb1 (diff) |
drivers/rtc/rtc-pcf8563.c: add device tree support
Set the of_match_table for this driver so that devices can be described
in the device tree.
Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-pcf8563.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index 24a9d6a9c72d..c2fe426a6ef2 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/rtc.h> | 19 | #include <linux/rtc.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <linux/of.h> | ||
22 | 23 | ||
23 | #define DRV_VERSION "0.4.3" | 24 | #define DRV_VERSION "0.4.3" |
24 | 25 | ||
@@ -285,10 +286,19 @@ static const struct i2c_device_id pcf8563_id[] = { | |||
285 | }; | 286 | }; |
286 | MODULE_DEVICE_TABLE(i2c, pcf8563_id); | 287 | MODULE_DEVICE_TABLE(i2c, pcf8563_id); |
287 | 288 | ||
289 | #ifdef CONFIG_OF | ||
290 | static const struct of_device_id pcf8563_of_match[] __devinitconst = { | ||
291 | { .compatible = "nxp,pcf8563" }, | ||
292 | {} | ||
293 | }; | ||
294 | MODULE_DEVICE_TABLE(of, pcf8563_of_match); | ||
295 | #endif | ||
296 | |||
288 | static struct i2c_driver pcf8563_driver = { | 297 | static struct i2c_driver pcf8563_driver = { |
289 | .driver = { | 298 | .driver = { |
290 | .name = "rtc-pcf8563", | 299 | .name = "rtc-pcf8563", |
291 | .owner = THIS_MODULE, | 300 | .owner = THIS_MODULE, |
301 | .of_match_table = of_match_ptr(pcf8563_of_match), | ||
292 | }, | 302 | }, |
293 | .probe = pcf8563_probe, | 303 | .probe = pcf8563_probe, |
294 | .remove = pcf8563_remove, | 304 | .remove = pcf8563_remove, |