diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> | 2012-07-09 21:39:12 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-10 19:23:03 +0200 |
commit | d2a37b3d91f46da25e7ff34f582e914a4cc0bfee (patch) | |
tree | b26ef7571c8c56df62f3cf25931063d7e8af6b8c /arch/arm/mach-imx/clk-imx31.c | |
parent | 5349f2a89e6a31c8d39c4ec2618b9dd6e421c415 (diff) |
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.c | 19 |
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 |