diff options
author | Joshua Clayton <stillcompiling@gmail.com> | 2015-02-13 17:40:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-14 00:21:42 -0500 |
commit | 3fc70077e6a9feec7ec080710677a507bd41322c (patch) | |
tree | ec7f8ab4ac01ecc75f8ad411cfaae37ec54087b6 /drivers/rtc | |
parent | 69d54b916d83872a0a327778a01af2a096923f59 (diff) |
drivers/rtc/rtc-pcf2123.c: add support for devicetree
Add compatible string "nxp,rtc-pcf2123"
Document the binding
Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>
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')
-rw-r--r-- | drivers/rtc/rtc-pcf2123.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-pcf2123.c b/drivers/rtc/rtc-pcf2123.c index d1953bb244c5..8a7556cbcb7f 100644 --- a/drivers/rtc/rtc-pcf2123.c +++ b/drivers/rtc/rtc-pcf2123.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/kernel.h> | 40 | #include <linux/kernel.h> |
41 | #include <linux/of.h> | ||
41 | #include <linux/string.h> | 42 | #include <linux/string.h> |
42 | #include <linux/slab.h> | 43 | #include <linux/slab.h> |
43 | #include <linux/rtc.h> | 44 | #include <linux/rtc.h> |
@@ -340,10 +341,19 @@ static int pcf2123_remove(struct spi_device *spi) | |||
340 | return 0; | 341 | return 0; |
341 | } | 342 | } |
342 | 343 | ||
344 | #ifdef CONFIG_OF | ||
345 | static const struct of_device_id pcf2123_dt_ids[] = { | ||
346 | { .compatible = "nxp,rtc-pcf2123", }, | ||
347 | { /* sentinel */ } | ||
348 | }; | ||
349 | MODULE_DEVICE_TABLE(of, pcf2123_dt_ids); | ||
350 | #endif | ||
351 | |||
343 | static struct spi_driver pcf2123_driver = { | 352 | static struct spi_driver pcf2123_driver = { |
344 | .driver = { | 353 | .driver = { |
345 | .name = "rtc-pcf2123", | 354 | .name = "rtc-pcf2123", |
346 | .owner = THIS_MODULE, | 355 | .owner = THIS_MODULE, |
356 | .of_match_table = of_match_ptr(pcf2123_dt_ids), | ||
347 | }, | 357 | }, |
348 | .probe = pcf2123_probe, | 358 | .probe = pcf2123_probe, |
349 | .remove = pcf2123_remove, | 359 | .remove = pcf2123_remove, |