mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
rtc: mcp795: add devicetree support
Add device tree support to the rtc-mcp795 driver. Signed-off-by: Emil Bartczak <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
This commit is contained in:
parent
15c6ea6f81
commit
7f8a58925b
2 changed files with 21 additions and 0 deletions
|
|
@ -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,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue