diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-08-08 23:17:16 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-08-10 14:53:07 +0200 |
commit | 0697c6fcc7462da60ba4977c257b022ea6e313fb (patch) | |
tree | a1092ab9604aa4d9ce39261f3e5a1ccbaeb265f9 /arch/arm/mach-versatile | |
parent | e18df20c902b83f7526fd62a27c0f6a2d67df3cb (diff) | |
download | barebox-0697c6fcc7462da60ba4977c257b022ea6e313fb.tar.gz barebox-0697c6fcc7462da60ba4977c257b022ea6e313fb.tar.xz |
versatilek: switch to static allocation clkdev
as we need to register it before the device
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-versatile')
-rw-r--r-- | arch/arm/mach-versatile/core.c | 19 | ||||
-rw-r--r-- | arch/arm/mach-versatile/include/mach/clkdev.h | 6 |
2 files changed, 22 insertions, 3 deletions
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 28582f7f26..f58e3bddcc 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c @@ -144,10 +144,24 @@ static int vpb_clocksource_init(void) core_initcall(vpb_clocksource_init); +static struct clk_lookup clocks_lookups[] = { + CLKDEV_CON_ID("uart-pl0110", &ref_clk_24), + CLKDEV_CON_ID("uart-pl0111", &ref_clk_24), + CLKDEV_CON_ID("uart-pl0112", &ref_clk_24), + CLKDEV_CON_ID("uart-pl0113", &ref_clk_24), +}; + +static int versatile_clkdev_init(void) +{ + clkdev_add_table(clocks_lookups, ARRAY_SIZE(clocks_lookups)); + + return 0; +} +postcore_initcall(versatile_clkdev_init); + void versatile_register_uart(unsigned id) { resource_size_t start; - struct device_d *dev; switch (id) { case 0: @@ -165,9 +179,8 @@ void versatile_register_uart(unsigned id) default: return; } - dev = add_generic_device("uart-pl011", id, NULL, start, 4096, + add_generic_device("uart-pl011", id, NULL, start, 4096, IORESOURCE_MEM, NULL); - vpb_clk_create(&ref_clk_24, dev_name(dev)); } void __noreturn reset_cpu (unsigned long ignored) diff --git a/arch/arm/mach-versatile/include/mach/clkdev.h b/arch/arm/mach-versatile/include/mach/clkdev.h index 04b37a8980..a9092a213d 100644 --- a/arch/arm/mach-versatile/include/mach/clkdev.h +++ b/arch/arm/mach-versatile/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 |