diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2009-09-18 11:14:21 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-21 11:03:01 -0400 |
commit | 439a33074c7d0895dd1e13ac354b8b4505d3ea43 (patch) | |
tree | e1c251dbdfd7c81abf03b8eb4ecca2ba369c4973 /arch/arm | |
parent | 378ac65e6c6779c526c9016cafb61d84ff9cbecd (diff) |
ARM: 5710/1: at91: add AC97 support to at91sam9rl and at91sam9rlek board
Add the support of AC97 on the at91sam9rl chip and -ek board.
It will share the code with AVR32 ac97c alsa driver "atmel_ac97c".
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 55 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9rlek.c | 10 |
2 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 1c2dced8748d..d345f5453dbe 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -444,6 +444,61 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
444 | 444 | ||
445 | 445 | ||
446 | /* -------------------------------------------------------------------- | 446 | /* -------------------------------------------------------------------- |
447 | * AC97 | ||
448 | * -------------------------------------------------------------------- */ | ||
449 | |||
450 | #if defined(CONFIG_SND_ATMEL_AC97C) || defined(CONFIG_SND_ATMEL_AC97C_MODULE) | ||
451 | static u64 ac97_dmamask = DMA_BIT_MASK(32); | ||
452 | static struct ac97c_platform_data ac97_data; | ||
453 | |||
454 | static struct resource ac97_resources[] = { | ||
455 | [0] = { | ||
456 | .start = AT91SAM9RL_BASE_AC97C, | ||
457 | .end = AT91SAM9RL_BASE_AC97C + SZ_16K - 1, | ||
458 | .flags = IORESOURCE_MEM, | ||
459 | }, | ||
460 | [1] = { | ||
461 | .start = AT91SAM9RL_ID_AC97C, | ||
462 | .end = AT91SAM9RL_ID_AC97C, | ||
463 | .flags = IORESOURCE_IRQ, | ||
464 | }, | ||
465 | }; | ||
466 | |||
467 | static struct platform_device at91sam9rl_ac97_device = { | ||
468 | .name = "atmel_ac97c", | ||
469 | .id = 0, | ||
470 | .dev = { | ||
471 | .dma_mask = &ac97_dmamask, | ||
472 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
473 | .platform_data = &ac97_data, | ||
474 | }, | ||
475 | .resource = ac97_resources, | ||
476 | .num_resources = ARRAY_SIZE(ac97_resources), | ||
477 | }; | ||
478 | |||
479 | void __init at91_add_device_ac97(struct ac97c_platform_data *data) | ||
480 | { | ||
481 | if (!data) | ||
482 | return; | ||
483 | |||
484 | at91_set_A_periph(AT91_PIN_PD1, 0); /* AC97FS */ | ||
485 | at91_set_A_periph(AT91_PIN_PD2, 0); /* AC97CK */ | ||
486 | at91_set_A_periph(AT91_PIN_PD3, 0); /* AC97TX */ | ||
487 | at91_set_A_periph(AT91_PIN_PD4, 0); /* AC97RX */ | ||
488 | |||
489 | /* reset */ | ||
490 | if (data->reset_pin) | ||
491 | at91_set_gpio_output(data->reset_pin, 0); | ||
492 | |||
493 | ac97_data = *data; | ||
494 | platform_device_register(&at91sam9rl_ac97_device); | ||
495 | } | ||
496 | #else | ||
497 | void __init at91_add_device_ac97(struct ac97c_platform_data *data) {} | ||
498 | #endif | ||
499 | |||
500 | |||
501 | /* -------------------------------------------------------------------- | ||
447 | * LCD Controller | 502 | * LCD Controller |
448 | * -------------------------------------------------------------------- */ | 503 | * -------------------------------------------------------------------- */ |
449 | 504 | ||
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c index 9d07679efce7..cde056570a44 100644 --- a/arch/arm/mach-at91/board-sam9rlek.c +++ b/arch/arm/mach-at91/board-sam9rlek.c | |||
@@ -211,6 +211,14 @@ static struct atmel_lcdfb_info __initdata ek_lcdc_data; | |||
211 | 211 | ||
212 | 212 | ||
213 | /* | 213 | /* |
214 | * AC97 | ||
215 | * reset_pin is not connected: NRST | ||
216 | */ | ||
217 | static struct ac97c_platform_data ek_ac97_data = { | ||
218 | }; | ||
219 | |||
220 | |||
221 | /* | ||
214 | * LEDs | 222 | * LEDs |
215 | */ | 223 | */ |
216 | static struct gpio_led ek_leds[] = { | 224 | static struct gpio_led ek_leds[] = { |
@@ -299,6 +307,8 @@ static void __init ek_board_init(void) | |||
299 | at91_add_device_mmc(0, &ek_mmc_data); | 307 | at91_add_device_mmc(0, &ek_mmc_data); |
300 | /* LCD Controller */ | 308 | /* LCD Controller */ |
301 | at91_add_device_lcdc(&ek_lcdc_data); | 309 | at91_add_device_lcdc(&ek_lcdc_data); |
310 | /* AC97 */ | ||
311 | at91_add_device_ac97(&ek_ac97_data); | ||
302 | /* Touch Screen Controller */ | 312 | /* Touch Screen Controller */ |
303 | at91_add_device_tsadcc(); | 313 | at91_add_device_tsadcc(); |
304 | /* LEDs */ | 314 | /* LEDs */ |