diff options
Diffstat (limited to 'arch/arm/mach-at91/at572d940hf.c')
-rw-r--r-- | arch/arm/mach-at91/at572d940hf.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at572d940hf.c b/arch/arm/mach-at91/at572d940hf.c index bacd3764b6c5..d06990777ffe 100644 --- a/arch/arm/mach-at91/at572d940hf.c +++ b/arch/arm/mach-at91/at572d940hf.c | |||
@@ -205,6 +205,21 @@ static struct clk *periph_clocks[] __initdata = { | |||
205 | /* irq0 .. irq2 */ | 205 | /* irq0 .. irq2 */ |
206 | }; | 206 | }; |
207 | 207 | ||
208 | static struct clk_lookup periph_clocks_lookups[] = { | ||
209 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), | ||
210 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | ||
211 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), | ||
212 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), | ||
213 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), | ||
214 | }; | ||
215 | |||
216 | static struct clk_lookup usart_clocks_lookups[] = { | ||
217 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck), | ||
218 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk), | ||
219 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk), | ||
220 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk), | ||
221 | }; | ||
222 | |||
208 | /* | 223 | /* |
209 | * The five programmable clocks. | 224 | * The five programmable clocks. |
210 | * You must configure pin multiplexing to bring these signals out. | 225 | * You must configure pin multiplexing to bring these signals out. |
@@ -262,6 +277,11 @@ static void __init at572d940hf_register_clocks(void) | |||
262 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) | 277 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) |
263 | clk_register(periph_clocks[i]); | 278 | clk_register(periph_clocks[i]); |
264 | 279 | ||
280 | clkdev_add_table(periph_clocks_lookups, | ||
281 | ARRAY_SIZE(periph_clocks_lookups)); | ||
282 | clkdev_add_table(usart_clocks_lookups, | ||
283 | ARRAY_SIZE(usart_clocks_lookups)); | ||
284 | |||
265 | clk_register(&pck0); | 285 | clk_register(&pck0); |
266 | clk_register(&pck1); | 286 | clk_register(&pck1); |
267 | clk_register(&pck2); | 287 | clk_register(&pck2); |
@@ -272,6 +292,18 @@ static void __init at572d940hf_register_clocks(void) | |||
272 | clk_register(&hck1); | 292 | clk_register(&hck1); |
273 | } | 293 | } |
274 | 294 | ||
295 | static struct clk_lookup console_clock_lookup; | ||
296 | |||
297 | void __init at572d940hf_set_console_clock(int id) | ||
298 | { | ||
299 | if (id >= ARRAY_SIZE(usart_clocks_lookups)) | ||
300 | return; | ||
301 | |||
302 | console_clock_lookup.con_id = "usart"; | ||
303 | console_clock_lookup.clk = usart_clocks_lookups[id].clk; | ||
304 | clkdev_add(&console_clock_lookup); | ||
305 | } | ||
306 | |||
275 | /* -------------------------------------------------------------------- | 307 | /* -------------------------------------------------------------------- |
276 | * GPIO | 308 | * GPIO |
277 | * -------------------------------------------------------------------- */ | 309 | * -------------------------------------------------------------------- */ |