diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-02-02 01:27:07 -0500 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-05-25 11:04:34 -0400 |
commit | bd60299594fb1d28ae66563c9e76a0b89b0412cf (patch) | |
tree | be57b42058328220a29a03ab68970a3b2a12949d /arch/arm/mach-at91/at91sam9263.c | |
parent | 1b021a3b23a40be89c4f3fbe6f4696aa15141f26 (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/at91sam9263.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9263.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 6a085fedf6a3..dc28477d14ff 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -199,6 +199,23 @@ static struct clk *periph_clocks[] __initdata = { | |||
199 | // irq0 .. irq1 | 199 | // irq0 .. irq1 |
200 | }; | 200 | }; |
201 | 201 | ||
202 | static struct clk_lookup periph_clocks_lookups[] = { | ||
203 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | ||
204 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | ||
205 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk), | ||
206 | CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk), | ||
207 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), | ||
208 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | ||
209 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), | ||
210 | }; | ||
211 | |||
212 | static struct clk_lookup usart_clocks_lookups[] = { | ||
213 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck), | ||
214 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk), | ||
215 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk), | ||
216 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk), | ||
217 | }; | ||
218 | |||
202 | /* | 219 | /* |
203 | * The four programmable clocks. | 220 | * The four programmable clocks. |
204 | * You must configure pin multiplexing to bring these signals out. | 221 | * You must configure pin multiplexing to bring these signals out. |
@@ -235,12 +252,29 @@ static void __init at91sam9263_register_clocks(void) | |||
235 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) | 252 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) |
236 | clk_register(periph_clocks[i]); | 253 | clk_register(periph_clocks[i]); |
237 | 254 | ||
255 | clkdev_add_table(periph_clocks_lookups, | ||
256 | ARRAY_SIZE(periph_clocks_lookups)); | ||
257 | clkdev_add_table(usart_clocks_lookups, | ||
258 | ARRAY_SIZE(usart_clocks_lookups)); | ||
259 | |||
238 | clk_register(&pck0); | 260 | clk_register(&pck0); |
239 | clk_register(&pck1); | 261 | clk_register(&pck1); |
240 | clk_register(&pck2); | 262 | clk_register(&pck2); |
241 | clk_register(&pck3); | 263 | clk_register(&pck3); |
242 | } | 264 | } |
243 | 265 | ||
266 | static struct clk_lookup console_clock_lookup; | ||
267 | |||
268 | void __init at91sam9263_set_console_clock(int id) | ||
269 | { | ||
270 | if (id >= ARRAY_SIZE(usart_clocks_lookups)) | ||
271 | return; | ||
272 | |||
273 | console_clock_lookup.con_id = "usart"; | ||
274 | console_clock_lookup.clk = usart_clocks_lookups[id].clk; | ||
275 | clkdev_add(&console_clock_lookup); | ||
276 | } | ||
277 | |||
244 | /* -------------------------------------------------------------------- | 278 | /* -------------------------------------------------------------------- |
245 | * GPIO | 279 | * GPIO |
246 | * -------------------------------------------------------------------- */ | 280 | * -------------------------------------------------------------------- */ |