mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
drivers/rtc/rtc-ds1742.c: add devicetree support
This patch allows the driver to be enabled with devicetree. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
1b3d2243d0
commit
663b35241d
2 changed files with 21 additions and 1 deletions
12
Documentation/devicetree/bindings/rtc/maxim,ds1742.txt
Normal file
12
Documentation/devicetree/bindings/rtc/maxim,ds1742.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
* Maxim (Dallas) DS1742/DS1743 Real Time Clock
|
||||||
|
|
||||||
|
Required properties:
|
||||||
|
- compatible: Should contain "maxim,ds1742".
|
||||||
|
- reg: Physical base address of the RTC and length of memory
|
||||||
|
mapped region.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
rtc: rtc@10000000 {
|
||||||
|
compatible = "maxim,ds1742";
|
||||||
|
reg = <0x10000000 0x800>;
|
||||||
|
};
|
|
@ -13,12 +13,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/bcd.h>
|
#include <linux/bcd.h>
|
||||||
#include <linux/init.h>
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/gfp.h>
|
#include <linux/gfp.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/jiffies.h>
|
#include <linux/jiffies.h>
|
||||||
#include <linux/rtc.h>
|
#include <linux/rtc.h>
|
||||||
|
#include <linux/of.h>
|
||||||
|
#include <linux/of_device.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
@ -215,12 +216,19 @@ static int ds1742_rtc_remove(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct of_device_id __maybe_unused ds1742_rtc_of_match[] = {
|
||||||
|
{ .compatible = "maxim,ds1742", },
|
||||||
|
{ }
|
||||||
|
};
|
||||||
|
MODULE_DEVICE_TABLE(of, ds1742_rtc_of_match);
|
||||||
|
|
||||||
static struct platform_driver ds1742_rtc_driver = {
|
static struct platform_driver ds1742_rtc_driver = {
|
||||||
.probe = ds1742_rtc_probe,
|
.probe = ds1742_rtc_probe,
|
||||||
.remove = ds1742_rtc_remove,
|
.remove = ds1742_rtc_remove,
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "rtc-ds1742",
|
.name = "rtc-ds1742",
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
|
.of_match_table = of_match_ptr(ds1742_rtc_of_match),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue