summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/clk-imx31.c
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>2012-07-09 21:39:12 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-07-10 19:23:03 +0200
commitd2a37b3d91f46da25e7ff34f582e914a4cc0bfee (patch)
treeb26ef7571c8c56df62f3cf25931063d7e8af6b8c /arch/arm/mach-imx/clk-imx31.c
parent5349f2a89e6a31c8d39c4ec2618b9dd6e421c415 (diff)
downloadblackbird-op-linux-d2a37b3d91f46da25e7ff34f582e914a4cc0bfee.tar.gz
blackbird-op-linux-d2a37b3d91f46da25e7ff34f582e914a4cc0bfee.zip
ARM i.MX31: Add devicetree support
This patch adds basic devicetree support for i.MX31 based SoCs. Only the UART and interrupts bindings are added. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/clk-imx31.c')
-rw-r--r--arch/arm/mach-imx/clk-imx31.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index c9a06d800f8e..f87a48fc74e1 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -20,6 +20,7 @@
#include <linux/clkdev.h>
#include <linux/io.h>
#include <linux/err.h>
+#include <linux/of.h>
#include <mach/hardware.h>
#include <mach/mx31.h>
@@ -179,3 +180,21 @@ int __init mx31_clocks_init(unsigned long fref)
return 0;
}
+
+#ifdef CONFIG_OF
+int __init mx31_clocks_init_dt(void)
+{
+ struct device_node *np;
+ u32 fref = 26000000; /* default */
+
+ for_each_compatible_node(np, NULL, "fixed-clock") {
+ if (!of_device_is_compatible(np, "fsl,imx-osc26m"))
+ continue;
+
+ if (!of_property_read_u32(np, "clock-frequency", &fref))
+ break;
+ }
+
+ return mx31_clocks_init(fref);
+}
+#endif
OpenPOWER on IntegriCloud