|
@@ -25,6 +25,7 @@
|
|
#include <linux/clk.h>
|
|
#include <linux/clk.h>
|
|
#include <linux/log2.h>
|
|
#include <linux/log2.h>
|
|
#include <linux/slab.h>
|
|
#include <linux/slab.h>
|
|
|
|
+#include <linux/of.h>
|
|
|
|
|
|
#include <mach/hardware.h>
|
|
#include <mach/hardware.h>
|
|
#include <asm/uaccess.h>
|
|
#include <asm/uaccess.h>
|
|
@@ -507,7 +508,13 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev)
|
|
goto err_nortc;
|
|
goto err_nortc;
|
|
}
|
|
}
|
|
|
|
|
|
- s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
|
|
|
|
|
|
+#ifdef CONFIG_OF
|
|
|
|
+ if (pdev->dev.of_node)
|
|
|
|
+ s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node,
|
|
|
|
+ "samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410;
|
|
|
|
+ else
|
|
|
|
+#endif
|
|
|
|
+ s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data;
|
|
|
|
|
|
/* Check RTC Time */
|
|
/* Check RTC Time */
|
|
|
|
|
|
@@ -629,6 +636,17 @@ static int s3c_rtc_resume(struct platform_device *pdev)
|
|
#define s3c_rtc_resume NULL
|
|
#define s3c_rtc_resume NULL
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef CONFIG_OF
|
|
|
|
+static const struct of_device_id s3c_rtc_dt_match[] = {
|
|
|
|
+ { .compatible = "samsung,s3c2410-rtc" },
|
|
|
|
+ { .compatible = "samsung,s3c6410-rtc" },
|
|
|
|
+ {},
|
|
|
|
+};
|
|
|
|
+MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match);
|
|
|
|
+#else
|
|
|
|
+#define s3c_rtc_dt_match NULL
|
|
|
|
+#endif
|
|
|
|
+
|
|
static struct platform_device_id s3c_rtc_driver_ids[] = {
|
|
static struct platform_device_id s3c_rtc_driver_ids[] = {
|
|
{
|
|
{
|
|
.name = "s3c2410-rtc",
|
|
.name = "s3c2410-rtc",
|
|
@@ -651,6 +669,7 @@ static struct platform_driver s3c_rtc_driver = {
|
|
.driver = {
|
|
.driver = {
|
|
.name = "s3c-rtc",
|
|
.name = "s3c-rtc",
|
|
.owner = THIS_MODULE,
|
|
.owner = THIS_MODULE,
|
|
|
|
+ .of_match_table = s3c_rtc_dt_match,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|