aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91cap9.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-02-02 01:27:07 -0500
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2011-05-25 11:04:34 -0400
commitbd60299594fb1d28ae66563c9e76a0b89b0412cf (patch)
treebe57b42058328220a29a03ab68970a3b2a12949d /arch/arm/mach-at91/at91cap9.c
parent1b021a3b23a40be89c4f3fbe6f4696aa15141f26 (diff)
at91: switch to CLKDEV_LOOKUP
we do not change the clock naming convention so does not need to switch the AVR32 yet Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Patrice Vilchez <patrice.vilchez@atmel.com>
Diffstat (limited to 'arch/arm/mach-at91/at91cap9.c')
-rw-r--r--arch/arm/mach-at91/at91cap9.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index 69df2bb4a70..17fae4a42ab 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -222,6 +222,25 @@ static struct clk *periph_clocks[] __initdata = {
222 // irq0 .. irq1 222 // irq0 .. irq1
223}; 223};
224 224
225static struct clk_lookup periph_clocks_lookups[] = {
226 CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc.0", &utmi_clk),
227 CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc.0", &udphs_clk),
228 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
229 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk),
230 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
231 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
232 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
233 CLKDEV_CON_DEV_ID("ssc", "ssc.0", &ssc0_clk),
234 CLKDEV_CON_DEV_ID("ssc", "ssc.1", &ssc1_clk),
235};
236
237static struct clk_lookup usart_clocks_lookups[] = {
238 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
239 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
240 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
241 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
242};
243
225/* 244/*
226 * The four programmable clocks. 245 * The four programmable clocks.
227 * You must configure pin multiplexing to bring these signals out. 246 * You must configure pin multiplexing to bring these signals out.
@@ -258,12 +277,29 @@ static void __init at91cap9_register_clocks(void)
258 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 277 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
259 clk_register(periph_clocks[i]); 278 clk_register(periph_clocks[i]);
260 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
261 clk_register(&pck0); 285 clk_register(&pck0);
262 clk_register(&pck1); 286 clk_register(&pck1);
263 clk_register(&pck2); 287 clk_register(&pck2);
264 clk_register(&pck3); 288 clk_register(&pck3);
265} 289}
266 290
291static struct clk_lookup console_clock_lookup;
292
293void __init at91cap9_set_console_clock(int id)
294{
295 if (id >= ARRAY_SIZE(usart_clocks_lookups))
296 return;
297
298 console_clock_lookup.con_id = "usart";
299 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
300 clkdev_add(&console_clock_lookup);
301}
302
267/* -------------------------------------------------------------------- 303/* --------------------------------------------------------------------
268 * GPIO 304 * GPIO
269 * -------------------------------------------------------------------- */ 305 * -------------------------------------------------------------------- */