@@ -25,8 +25,7 @@
#include <linux/regulator/consumer.h>
#include <linux/module.h>
#include <linux/clk.h>
-
-#include <mach/map.h>
+#include <linux/io.h>
#include "exynos_ppmu.h"
#include "exynos4_bus.h"
@@ -902,9 +901,9 @@ static int exynos4_busfreq_probe(struct platform_device *pdev)
struct busfreq_ppmu_data *ppmu_data;
struct dev_pm_opp *opp;
struct device *dev = &pdev->dev;
- int err = 0;
+ int i, err = 0;
- data = devm_kzalloc(&pdev->dev, sizeof(struct busfreq_data), GFP_KERNEL);
+ data = devm_kzalloc(dev, sizeof(struct busfreq_data), GFP_KERNEL);
if (data == NULL) {
dev_err(dev, "Cannot allocate memory.\n");
return -ENOMEM;
@@ -921,8 +920,20 @@ static int exynos4_busfreq_probe(struct platform_device *pdev)
}
data->type = pdev->id_entry->driver_data;
- ppmu_data->ppmu[PPMU_DMC0].hw_base = S5P_VA_DMC0;
- ppmu_data->ppmu[PPMU_DMC1].hw_base = S5P_VA_DMC1;
+
+ /* Allocate MMIO region for PPMU SFRs */
+ for (i = 0; i < PPMU_END; i++) {
+ struct resource *res;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, i);
+ if (!res) {
+ dev_err(dev, "No mem resource for ppmu[%d]\n", i);
+ return -ENOENT;
+ }
+
+ ppmu_data->ppmu[i].hw_base = devm_ioremap_resource(dev, res);
+ }
+
data->pm_notifier.notifier_call = exynos4_busfreq_pm_notifier_event;
data->dev = dev;
mutex_init(&data->lock);