aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9261.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/at91sam9261.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/at91sam9261.c')
-rw-r--r--arch/arm/mach-at91/at91sam9261.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index e3bafaebe010..c1483168c97a 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -178,6 +178,24 @@ static struct clk *periph_clocks[] __initdata = {
178 // irq0 .. irq2 178 // irq0 .. irq2
179}; 179};
180 180
181static struct clk_lookup periph_clocks_lookups[] = {
182 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
183 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
184 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk),
185 CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk),
186 CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc1_clk),
187 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
188 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
189 CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk),
190};
191
192static struct clk_lookup usart_clocks_lookups[] = {
193 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
194 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
195 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
196 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
197};
198
181/* 199/*
182 * The four programmable clocks. 200 * The four programmable clocks.
183 * You must configure pin multiplexing to bring these signals out. 201 * You must configure pin multiplexing to bring these signals out.
@@ -228,6 +246,11 @@ static void __init at91sam9261_register_clocks(void)
228 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) 246 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
229 clk_register(periph_clocks[i]); 247 clk_register(periph_clocks[i]);
230 248
249 clkdev_add_table(periph_clocks_lookups,
250 ARRAY_SIZE(periph_clocks_lookups));
251 clkdev_add_table(usart_clocks_lookups,
252 ARRAY_SIZE(usart_clocks_lookups));
253
231 clk_register(&pck0); 254 clk_register(&pck0);
232 clk_register(&pck1); 255 clk_register(&pck1);
233 clk_register(&pck2); 256 clk_register(&pck2);
@@ -237,6 +260,18 @@ static void __init at91sam9261_register_clocks(void)
237 clk_register(&hck1); 260 clk_register(&hck1);
238} 261}
239 262
263static struct clk_lookup console_clock_lookup;
264
265void __init at91sam9261_set_console_clock(int id)
266{
267 if (id >= ARRAY_SIZE(usart_clocks_lookups))
268 return;
269
270 console_clock_lookup.con_id = "usart";
271 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
272 clkdev_add(&console_clock_lookup);
273}
274
240/* -------------------------------------------------------------------- 275/* --------------------------------------------------------------------
241 * GPIO 276 * GPIO
242 * -------------------------------------------------------------------- */ 277 * -------------------------------------------------------------------- */