[PATCH 4/5] nomadik: switch to static allocation clkdev

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Aug 8 17:17:15 EDT 2011


as we need to register it before the device

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/mach-nomadik/8815.c                |   13 +++++++++++++
 arch/arm/mach-nomadik/include/mach/clkdev.h |    6 ++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-nomadik/8815.c b/arch/arm/mach-nomadik/8815.c
index bcc3406..3138045 100644
--- a/arch/arm/mach-nomadik/8815.c
+++ b/arch/arm/mach-nomadik/8815.c
@@ -36,6 +36,19 @@ void st8815_add_device_sdram(u32 size)
 	arm_add_mem_device("ram0", 0x00000000, size);
 }
 
+static struct clk_lookup clocks_lookups[] = {
+	CLKDEV_CON_ID("uart-pl0110", &st8815_clk_48),
+	CLKDEV_CON_ID("uart-pl0111", &st8815_clk_48),
+};
+
+static int st8815_clkdev_init(void)
+{
+	clkdev_add_table(clocks_lookups, ARRAY_SIZE(clocks_lookups));
+
+	return 0;
+}
+postcore_initcall(st8815_clkdev_init);
+
 void st8815_register_uart(unsigned id)
 {
 	resource_size_t start;
diff --git a/arch/arm/mach-nomadik/include/mach/clkdev.h b/arch/arm/mach-nomadik/include/mach/clkdev.h
index 04b37a8..a9092a2 100644
--- a/arch/arm/mach-nomadik/include/mach/clkdev.h
+++ b/arch/arm/mach-nomadik/include/mach/clkdev.h
@@ -4,4 +4,10 @@
 #define __clk_get(clk) ({ 1; })
 #define __clk_put(clk) do { } while (0)
 
+#define CLKDEV_CON_ID(_id, _clk)			\
+	{						\
+		.con_id = _id,				\
+		.clk = _clk,				\
+	}
+
 #endif
-- 
1.7.5.4




More information about the barebox mailing list