diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2009-09-18 11:14:22 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-21 11:02:59 -0400 |
commit | 378ac65e6c6779c526c9016cafb61d84ff9cbecd (patch) | |
tree | 5416b93d6320fcca8a2c1625616b897a4bb7bb84 /arch/arm/mach-at91 | |
parent | 28f9f19db9dda54c851d5689539d86f6fc008773 (diff) |
ARM: 5709/1: at91: add AC97 support to at91sam9g45 series and at91sam9m10g45ek board
Add the support of AC97 on the at91sam9g45 chip series 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/mach-at91')
-rw-r--r-- | arch/arm/mach-at91/at91sam9g45_devices.c | 55 | ||||
-rw-r--r-- | arch/arm/mach-at91/board-sam9m10g45ek.c | 10 |
2 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 45720c84f0bf..d581cff80c4c 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -598,6 +598,61 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
598 | 598 | ||
599 | 599 | ||
600 | /* -------------------------------------------------------------------- | 600 | /* -------------------------------------------------------------------- |
601 | * AC97 | ||
602 | * -------------------------------------------------------------------- */ | ||
603 | |||
604 | #if defined(CONFIG_SND_ATMEL_AC97C) || defined(CONFIG_SND_ATMEL_AC97C_MODULE) | ||
605 | static u64 ac97_dmamask = DMA_BIT_MASK(32); | ||
606 | static struct ac97c_platform_data ac97_data; | ||
607 | |||
608 | static struct resource ac97_resources[] = { | ||
609 | [0] = { | ||
610 | .start = AT91SAM9G45_BASE_AC97C, | ||
611 | .end = AT91SAM9G45_BASE_AC97C + SZ_16K - 1, | ||
612 | .flags = IORESOURCE_MEM, | ||
613 | }, | ||
614 | [1] = { | ||
615 | .start = AT91SAM9G45_ID_AC97C, | ||
616 | .end = AT91SAM9G45_ID_AC97C, | ||
617 | .flags = IORESOURCE_IRQ, | ||
618 | }, | ||
619 | }; | ||
620 | |||
621 | static struct platform_device at91sam9g45_ac97_device = { | ||
622 | .name = "atmel_ac97c", | ||
623 | .id = 0, | ||
624 | .dev = { | ||
625 | .dma_mask = &ac97_dmamask, | ||
626 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
627 | .platform_data = &ac97_data, | ||
628 | }, | ||
629 | .resource = ac97_resources, | ||
630 | .num_resources = ARRAY_SIZE(ac97_resources), | ||
631 | }; | ||
632 | |||
633 | void __init at91_add_device_ac97(struct ac97c_platform_data *data) | ||
634 | { | ||
635 | if (!data) | ||
636 | return; | ||
637 | |||
638 | at91_set_A_periph(AT91_PIN_PD8, 0); /* AC97FS */ | ||
639 | at91_set_A_periph(AT91_PIN_PD9, 0); /* AC97CK */ | ||
640 | at91_set_A_periph(AT91_PIN_PD7, 0); /* AC97TX */ | ||
641 | at91_set_A_periph(AT91_PIN_PD6, 0); /* AC97RX */ | ||
642 | |||
643 | /* reset */ | ||
644 | if (data->reset_pin) | ||
645 | at91_set_gpio_output(data->reset_pin, 0); | ||
646 | |||
647 | ac97_data = *data; | ||
648 | platform_device_register(&at91sam9g45_ac97_device); | ||
649 | } | ||
650 | #else | ||
651 | void __init at91_add_device_ac97(struct ac97c_platform_data *data) {} | ||
652 | #endif | ||
653 | |||
654 | |||
655 | /* -------------------------------------------------------------------- | ||
601 | * LCD Controller | 656 | * LCD Controller |
602 | * -------------------------------------------------------------------- */ | 657 | * -------------------------------------------------------------------- */ |
603 | 658 | ||
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index b8558eae5229..64c3843f323d 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c | |||
@@ -311,6 +311,14 @@ static void __init ek_add_device_buttons(void) {} | |||
311 | 311 | ||
312 | 312 | ||
313 | /* | 313 | /* |
314 | * AC97 | ||
315 | * reset_pin is not connected: NRST | ||
316 | */ | ||
317 | static struct ac97c_platform_data ek_ac97_data = { | ||
318 | }; | ||
319 | |||
320 | |||
321 | /* | ||
314 | * LEDs ... these could all be PWM-driven, for variable brightness | 322 | * LEDs ... these could all be PWM-driven, for variable brightness |
315 | */ | 323 | */ |
316 | static struct gpio_led ek_leds[] = { | 324 | static struct gpio_led ek_leds[] = { |
@@ -372,6 +380,8 @@ static void __init ek_board_init(void) | |||
372 | at91_add_device_lcdc(&ek_lcdc_data); | 380 | at91_add_device_lcdc(&ek_lcdc_data); |
373 | /* Push Buttons */ | 381 | /* Push Buttons */ |
374 | ek_add_device_buttons(); | 382 | ek_add_device_buttons(); |
383 | /* AC97 */ | ||
384 | at91_add_device_ac97(&ek_ac97_data); | ||
375 | /* LEDs */ | 385 | /* LEDs */ |
376 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); | 386 | at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); |
377 | at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led)); | 387 | at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led)); |