new file mode 100644
@@ -0,0 +1,19 @@
+Exynos4 busfreq bindings
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Require properties:
+- compatible : "samsung,exynos4210-busfreq";
+ "samsung,exynos4x12-busfreq";
+- reg : Memory range for PPMU IP block's SFR region.
+- clocks : Source clocks for PPMU blocks;
+ Currently, driver needs two ppmu clks for dmc0, dmc1.
+- clock-names : PPMU clock's lookup name;
+
+Examples:
+ busfreq@0 {
+ compatible = "samsung,exynos4x12-busfreq";
+ reg = <0x106A0000 0x2000>, <0x106B0000 0x2000>;
+ clocks = <&clock 412>, <&clock 413>;
+ clock-names = "ppmudmc0", "ppmudmc1";
+ };
+ };
@@ -16,16 +16,13 @@
*/
#include <linux/io.h>
-#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/suspend.h>
-#include <linux/pm_opp.h>
#include <linux/devfreq.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/module.h>
-#include <linux/clk.h>
-#include <linux/io.h>
+#include <linux/of.h>
#include "exynos_ppmu.h"
#include "exynos4_bus.h"
@@ -895,6 +892,22 @@ unlock:
return NOTIFY_DONE;
}
+#ifdef CONFIG_OF
+static const struct of_device_id exynos4_busfreq_match[] = {
+ {
+ .compatible = "samsung,exynos4210-busfreq",
+ .data = (void *)TYPE_BUSF_EXYNOS4210,
+ },
+ {
+ .compatible = "samsung,exynos4x12-busfreq",
+ .data = (void *)TYPE_BUSF_EXYNOS4x12,
+ },
+};
+MODULE_DEVICE_TABLE(of, exynos4_busfreq_match[]);
+#else
+#define exynos4_busfreq_match NULL
+#endif
+
static int exynos4_busfreq_probe(struct platform_device *pdev)
{
struct busfreq_data *data;
@@ -919,7 +932,13 @@ static int exynos4_busfreq_probe(struct platform_device *pdev)
return -ENOMEM;
}
- data->type = pdev->id_entry->driver_data;
+ if (dev->of_node) {
+ const struct of_device_id *match;
+ match = of_match_node(exynos4_busfreq_match, dev->of_node);
+ data->type = (int) match->data;
+ } else {
+ data->type = pdev->id_entry->driver_data;
+ }
/* Allocate MMIO region for PPMU SFRs */
for (i = 0; i < PPMU_END; i++) {
@@ -1075,6 +1094,7 @@ static struct platform_driver exynos4_busfreq_driver = {
.name = "exynos4-busfreq",
.owner = THIS_MODULE,
.pm = &exynos4_busfreq_pm_ops,
+ .of_match_table = of_match_ptr(exynos4_busfreq_match),
},
};