drivers/rtc/rtc-mcp795.c: add devicetree support
Subsystems (2)
PATCH 1/1 drivers/rtc/rtc-mcp795.c: add devicetree support
Add device tree support to the rtc-mcp795 driver.
Signed-off-by Emil Bartczak <[email protected]>
--- Documentation/devicetree/bindings/rtc/maxim,mcp795.txt | 11 +++++++++++ drivers/rtc/rtc-mcp795.c | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/maxim,mcp795.txt
Documentation/devicetree/bindings/rtc/maxim,mcp795.txt new file +11 -0
@@ -0,0 +1,11 @@ +* Maxim MCP795 SPI Serial Real-Time Clock + +Required properties: +- compatible: Should contain "maxim,mcp795". +- reg: SPI address for chip + +Example: + mcp795: rtc@0 { + compatible = "maxim,mcp795"; + reg = <0>; + };
drivers/rtc/rtc-mcp795.c +10 -0
@@ -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, };
Signature · 6 lines
1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Emil Bartczak
Add device tree support to the rtc-mcp795 driver.
Signed-off-by Emil Bartczak <[email protected]>--- Documentation/devicetree/bindings/rtc/maxim,mcp795.txt | 11 +++++++++++ drivers/rtc/rtc-mcp795.c | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/maxim,mcp795.txt
Acked-by Rob Herring <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Alexandre Belloni
AppliedQuoted 8 lines · Emil Bartczak
Add device tree support to the rtc-mcp795 driver.
Signed-off-by Emil Bartczak <[email protected]>--- Documentation/devicetree/bindings/rtc/maxim,mcp795.txt | 11 +++++++++++ drivers/rtc/rtc-mcp795.c | 10 ++++++++++ 2 files changed, 21 insertions(+) create mode 100644 Documentation/devicetree/bindings/rtc/maxim,mcp795.txt
Applied, thanks.
Signature · 3 lines
Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com