提交 3fc70077 编写于 作者: J Joshua Clayton 提交者: Linus Torvalds

drivers/rtc/rtc-pcf2123.c: add support for devicetree

Add compatible string "nxp,rtc-pcf2123"
Document the binding
Signed-off-by: NJoshua 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: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 69d54b91
NXP PCF2123 SPI Real Time Clock
Required properties:
- compatible: should be: "nxp,rtc-pcf2123"
- reg: should be the SPI slave chipselect address
Optional properties:
- spi-cs-high: PCF2123 needs chipselect high
Example:
rtc: nxp,rtc-pcf2123@3 {
compatible = "nxp,rtc-pcf2123"
reg = <3>
spi-cs-high;
};
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/of.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/rtc.h> #include <linux/rtc.h>
...@@ -340,10 +341,19 @@ static int pcf2123_remove(struct spi_device *spi) ...@@ -340,10 +341,19 @@ static int pcf2123_remove(struct spi_device *spi)
return 0; return 0;
} }
#ifdef CONFIG_OF
static const struct of_device_id pcf2123_dt_ids[] = {
{ .compatible = "nxp,rtc-pcf2123", },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, pcf2123_dt_ids);
#endif
static struct spi_driver pcf2123_driver = { static struct spi_driver pcf2123_driver = {
.driver = { .driver = {
.name = "rtc-pcf2123", .name = "rtc-pcf2123",
.owner = THIS_MODULE, .owner = THIS_MODULE,
.of_match_table = of_match_ptr(pcf2123_dt_ids),
}, },
.probe = pcf2123_probe, .probe = pcf2123_probe,
.remove = pcf2123_remove, .remove = pcf2123_remove,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册