summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorEmil Bartczak <emilbart@gmail.com>2016-03-21 01:06:10 +0100
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>2016-03-21 22:55:29 +0100
commit7f8a58925b4c0198c12344025b6ffd5dd7d9f1f5 (patch)
treeb399addb8b7ff7258ad9cae5b3de8b1eccb695ef /drivers/rtc
parent15c6ea6f81328b0071cf63fb00b324199a9b8647 (diff)
downloadlinux-stable-7f8a58925b4c0198c12344025b6ffd5dd7d9f1f5.tar.gz
linux-stable-7f8a58925b4c0198c12344025b6ffd5dd7d9f1f5.tar.bz2
linux-stable-7f8a58925b4c0198c12344025b6ffd5dd7d9f1f5.zip
rtc: mcp795: add devicetree support
Add device tree support to the rtc-mcp795 driver. Signed-off-by: Emil Bartczak <emilbart@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-mcp795.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-mcp795.c b/drivers/rtc/rtc-mcp795.c
index 1c91ce8a6d75..025bb33b9cd2 100644
--- a/drivers/rtc/rtc-mcp795.c
+++ b/drivers/rtc/rtc-mcp795.c
@@ -20,6 +20,7 @@
#include <linux/printk.h>
#include <linux/spi/spi.h>
#include <linux/rtc.h>
+#include <linux/of.h>
/* MCP795 Instructions, see datasheet table 3-1 */
#define MCP795_EEREAD 0x03
@@ -183,9 +184,18 @@ static int mcp795_probe(struct spi_device *spi)
return 0;
}
+#ifdef CONFIG_OF
+static const struct of_device_id mcp795_of_match[] = {
+ { .compatible = "maxim,mcp795" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, mcp795_of_match);
+#endif
+
static struct spi_driver mcp795_driver = {
.driver = {
.name = "rtc-mcp795",
+ .of_match_table = of_match_ptr(mcp795_of_match),
},
.probe = mcp795_probe,
};