Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91138
b: refs/heads/master
c: 5e9df92
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Victor authored and Russell King committed Apr 4, 2008
1 parent d42668d commit b9e7a4b
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e5f40bfaf309ec4cc27b717d48fb0824313e5ef8
refs/heads/master: 5e9df924dd51beaf007ffba42b5deb47e1c6249b
37 changes: 36 additions & 1 deletion trunk/arch/arm/mach-at91/board-sam9260ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/at73c213.h>
#include <linux/clk.h>

#include <asm/hardware.h>
#include <asm/setup.h>
Expand All @@ -37,7 +39,6 @@

#include <asm/arch/board.h>
#include <asm/arch/gpio.h>
#include <asm/arch/at91sam9_smc.h>

#include "generic.h"

Expand Down Expand Up @@ -84,6 +85,35 @@ static struct at91_udc_data __initdata ek_udc_data = {
};


/*
* Audio
*/
static struct at73c213_board_info at73c213_data = {
.ssc_id = 0,
.shortname = "AT91SAM9260-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 *pck0;
struct clk *plla;

pck0 = clk_get(NULL, "pck0");
plla = clk_get(NULL, "plla");

/* AT73C213 MCK Clock */
at91_set_B_periph(AT91_PIN_PC1, 0); /* PCK0 */

clk_set_parent(pck0, plla);
clk_put(plla);

info->dac_clk = pck0;
}
#else
static void __init at73c213_set_clk(struct at73c213_board_info *info) {}
#endif

/*
* SPI devices.
*/
Expand All @@ -110,6 +140,8 @@ static struct spi_board_info ek_spi_devices[] = {
.chip_select = 0,
.max_speed_hz = 10 * 1000 * 1000,
.bus_num = 1,
.mode = SPI_MODE_1,
.platform_data = &at73c213_data,
},
#endif
};
Expand Down Expand Up @@ -190,6 +222,9 @@ static void __init ek_board_init(void)
at91_add_device_mmc(0, &ek_mmc_data);
/* I2C */
at91_add_device_i2c(NULL, 0);
/* SSC (to AT73C213) */
at73c213_set_clk(&at73c213_data);
at91_add_device_ssc(AT91SAM9260_ID_SSC, ATMEL_SSC_TX);
}

MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
Expand Down
38 changes: 38 additions & 0 deletions trunk/arch/arm/mach-at91/board-sam9261ek.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/spi/ads7846.h>
#include <linux/spi/at73c213.h>
#include <linux/clk.h>
#include <linux/dm9000.h>
#include <linux/fb.h>
#include <linux/gpio_keys.h>
Expand Down Expand Up @@ -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
*/
Expand All @@ -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)
Expand All @@ -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
};
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b9e7a4b

Please sign in to comment.