From 5e9df924dd51beaf007ffba42b5deb47e1c6249b Mon Sep 17 00:00:00 2001 From: Andrew Victor Date: Wed, 2 Apr 2008 22:18:35 +0100 Subject: [ARM] 4910/1: [AT91] AT73C213 audio on SAM9260-EK and SAM9261-EK boards Add support for AT73C213 audio DAC on the Atmel SAM9260-EK and SAM9261-EK boards. Signed-off-by: Sedji Gaouaou Signed-off-by: Andrew Victor Signed-off-by: Russell King --- arch/arm/mach-at91/board-sam9261ek.c | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'arch/arm/mach-at91/board-sam9261ek.c') diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 3c73825b58de..ce512d74e6e9 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -230,6 +232,35 @@ static void __init ek_add_device_ts(void) static void __init ek_add_device_ts(void) {} #endif +/* + * Audio + */ +static struct at73c213_board_info at73c213_data = { + .ssc_id = 1, + .shortname = "AT91SAM9261-EK external DAC", +}; + +#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE) +static void __init at73c213_set_clk(struct at73c213_board_info *info) +{ + struct clk *pck2; + struct clk *plla; + + pck2 = clk_get(NULL, "pck2"); + plla = clk_get(NULL, "plla"); + + /* AT73C213 MCK Clock */ + at91_set_B_periph(AT91_PIN_PB31, 0); /* PCK2 */ + + clk_set_parent(pck2, plla); + clk_put(plla); + + info->dac_clk = pck2; +} +#else +static void __init at73c213_set_clk(struct at73c213_board_info *info) {} +#endif + /* * SPI devices */ @@ -248,6 +279,7 @@ static struct spi_board_info ek_spi_devices[] = { .bus_num = 0, .platform_data = &ads_info, .irq = AT91SAM9261_ID_IRQ0, + .controller_data = (void *) AT91_PIN_PA28, /* CS pin */ }, #endif #if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) @@ -263,6 +295,9 @@ static struct spi_board_info ek_spi_devices[] = { .chip_select = 3, .max_speed_hz = 10 * 1000 * 1000, .bus_num = 0, + .mode = SPI_MODE_1, + .platform_data = &at73c213_data, + .controller_data = (void*) AT91_PIN_PA29, /* default for CS3 is PA6, but it must be PA29 */ }, #endif }; @@ -473,6 +508,9 @@ static void __init ek_board_init(void) at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); /* Touchscreen */ ek_add_device_ts(); + /* SSC (to AT73C213) */ + at73c213_set_clk(&at73c213_data); + at91_add_device_ssc(AT91SAM9261_ID_SSC1, ATMEL_SSC_TX); #else /* MMC */ at91_add_device_mmc(0, &ek_mmc_data); -- cgit v1.2.3