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/at91rm9200.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/at91rm9200.c')
-rw-r--r-- | arch/arm/mach-at91/at91rm9200.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c index 164a98ed8888..d3638bd994da 100644 --- a/arch/arm/mach-at91/at91rm9200.c +++ b/arch/arm/mach-at91/at91rm9200.c | |||
@@ -191,6 +191,26 @@ static struct clk *periph_clocks[] __initdata = { | |||
191 | // irq0 .. irq6 | 191 | // irq0 .. irq6 |
192 | }; | 192 | }; |
193 | 193 | ||
194 | static struct clk_lookup periph_clocks_lookups[] = { | ||
195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tc0_clk), | ||
196 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.0", &tc1_clk), | ||
197 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.0", &tc2_clk), | ||
198 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tc3_clk), | ||
199 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), | ||
200 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), | ||
201 | CLKDEV_CON_DEV_ID("ssc", "ssc.0", &ssc0_clk), | ||
202 | CLKDEV_CON_DEV_ID("ssc", "ssc.1", &ssc1_clk), | ||
203 | CLKDEV_CON_DEV_ID("ssc", "ssc.2", &ssc2_clk), | ||
204 | }; | ||
205 | |||
206 | static struct clk_lookup usart_clocks_lookups[] = { | ||
207 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck), | ||
208 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk), | ||
209 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk), | ||
210 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk), | ||
211 | CLKDEV_CON_DEV_ID("usart", "atmel_usart.4", &usart3_clk), | ||
212 | }; | ||
213 | |||
194 | /* | 214 | /* |
195 | * The four programmable clocks. | 215 | * The four programmable clocks. |
196 | * You must configure pin multiplexing to bring these signals out. | 216 | * You must configure pin multiplexing to bring these signals out. |
@@ -227,12 +247,29 @@ static void __init at91rm9200_register_clocks(void) | |||
227 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) | 247 | for (i = 0; i < ARRAY_SIZE(periph_clocks); i++) |
228 | clk_register(periph_clocks[i]); | 248 | clk_register(periph_clocks[i]); |
229 | 249 | ||
250 | clkdev_add_table(periph_clocks_lookups, | ||
251 | ARRAY_SIZE(periph_clocks_lookups)); | ||
252 | clkdev_add_table(usart_clocks_lookups, | ||
253 | ARRAY_SIZE(usart_clocks_lookups)); | ||
254 | |||
230 | clk_register(&pck0); | 255 | clk_register(&pck0); |
231 | clk_register(&pck1); | 256 | clk_register(&pck1); |
232 | clk_register(&pck2); | 257 | clk_register(&pck2); |
233 | clk_register(&pck3); | 258 | clk_register(&pck3); |
234 | } | 259 | } |
235 | 260 | ||
261 | static struct clk_lookup console_clock_lookup; | ||
262 | |||
263 | void __init at91rm9200_set_console_clock(int id) | ||
264 | { | ||
265 | if (id >= ARRAY_SIZE(usart_clocks_lookups)) | ||
266 | return; | ||
267 | |||
268 | console_clock_lookup.con_id = "usart"; | ||
269 | console_clock_lookup.clk = usart_clocks_lookups[id].clk; | ||
270 | clkdev_add(&console_clock_lookup); | ||
271 | } | ||
272 | |||
236 | /* -------------------------------------------------------------------- | 273 | /* -------------------------------------------------------------------- |
237 | * GPIO | 274 | * GPIO |
238 | * -------------------------------------------------------------------- */ | 275 | * -------------------------------------------------------------------- */ |