@@ -23,6 +23,6 @@ int __init vt8500_irq_init(struct device_node *node,
struct device_node *parent);
/* defined in drivers/clk/clk-vt8500.c */
-void __init vtwm_clk_init(void __iomem *pmc_base);
+void __init vtwm_clk_init(void);
#endif
@@ -162,7 +162,7 @@ void __init vt8500_init(void)
else
pr_err("%s: PMC Hibernation register could not be remapped, not enabling power off!\n", __func__);
- vtwm_clk_init(pmc_base);
+ vtwm_clk_init();
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
}
@@ -15,6 +15,7 @@
#include <linux/io.h>
#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/clkdev.h>
@@ -517,12 +518,23 @@ static const __initconst struct of_device_id clk_match[] = {
{ /* sentinel */ }
};
-void __init vtwm_clk_init(void __iomem *base)
+void __init vtwm_clk_init(void)
{
- if (!base)
- return;
+ struct device_node *np =
+ of_find_compatible_node(NULL, NULL, "via,vt8500-pmc");
+
+ if (!np) {
+ pr_err("%s: power management device node missing\n", __func__);
+ return -ENODEV;
+ }
- pmc_base = base;
+ pmc_base = of_iomap(np, 0);
+ of_node_put(np);
+
+ if (!pmc_base) {
+ pr_err("%s: of_iomap(pmc) failed\n", __func__);
+ return -ENOMEM;
+ }
of_clk_init(clk_match);
}
This patch removes the requirement to pass a Power Management Controller base address to vtwm_clk_init(), in preparation of separating the power management code from arch-vt8500/vt8500.c. Signed-off-by: Tony Prisk <linux@prisktech.co.nz> --- Mike, Do you mind if this patch goes through arm-soc, given it is self-contained, so I can base the other PM changes off it? Regards Tony P arch/arm/mach-vt8500/common.h | 2 +- arch/arm/mach-vt8500/vt8500.c | 2 +- drivers/clk/clk-vt8500.c | 20 ++++++++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-)