McASP0 Interface to AIC34

Hi all,

We are interfacing the AIC34 to beaglebone AM335x McASP0(as we do not have McASP1 lines accessible in the beaglebone).

Following are the changes made in order to configure the McASP0 and to interface with AIC34.

arch/arm/mach-omap2/board-am335xevm.c

static struct pinmux_config mcasp0_pin_mux[] = {
{“lcd_data8.mcasp0_aclkx”, OMAP_MUX_MODE3 |AM33XX_PIN_INPUT_PULLDOWN},
{“lcd_data9.mcasp0_fsx”, OMAP_MUX_MODE3 |AM33XX_PIN_INPUT_PULLDOWN},
{“lcd_data12.mcasp0_axr2”, OMAP_MUX_MODE4 |AM33XX_PIN_INPUT_PULLDOWN},
{“lcd_data13.mcasp0_axr3”, OMAP_MUX_MODE4 |AM33XX_PIN_INPUT_PULLDOWN},
{NULL, 0},
};

static u8 am335x_iis_serializer_direction1[] = {
INACTIVE_MODE, INACTIVE_MODE, TX_MODE, RX_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE,
};

static struct snd_platform_data am335x_evm_snd_data0 = {
.tx_dma_offset = 0x46000000, /* McASP0 */
.rx_dma_offset = 0x46000000,
.op_mode = DAVINCI_MCASP_IIS_MODE,
.num_serializer = ARRAY_SIZE(am335x_iis_serializer_direction1),
.tdm_slots = 2,
.serial_dir = am335x_iis_serializer_direction1,
.asp_chan_q = EVENTQ_2,
.version = MCASP_VERSION_3,
.txnumevt = 1,
.rxnumevt = 1,
};

/* Setup McASP 0 /
static void mcasp0_init(int evm_id, int profile)
{
/
Configure McASP */
setup_pin_mux(mcasp0_pin_mux);
am335x_register_mcasp0(&am335x_evm_snd_data0);
return;
}

arch/arm/mach-omap2/devices.c

static struct resource am335x_mcasp0_resource[] = {
{
.name = “mcasp0”,
.start = AM33XX_ASP0_BASE,
.end = AM33XX_ASP0_BASE + (SZ_1K * 12) - 1,
.flags = IORESOURCE_MEM,
},
/* TX event /
{
.start = AM33XX_DMA_MCASP0_X,
.end = AM33XX_DMA_MCASP0_X,
.flags = IORESOURCE_DMA,
},
/
RX event */
{
.start = AM33XX_DMA_MCASP0_R,
.end = AM33XX_DMA_MCASP0_R,
.flags = IORESOURCE_DMA,
},
};

static struct platform_device am335x_mcasp0_device = {
.name = “davinci-mcasp”,
.id = 0,
.num_resources = ARRAY_SIZE(am335x_mcasp0_resource),
.resource = am335x_mcasp0_resource,
};

void __init am335x_register_mcasp0(struct snd_platform_data *pdata)
{
am335x_mcasp0_device.dev.platform_data = pdata;
platform_device_register(&am335x_mcasp0_device);
}

sound/soc/davinci/davinci-evm.c

static struct snd_soc_dai_link am335x_evm_dai = {
.name = “TLV320AIC3X”,
.stream_name = “AIC3X”,
.cpu_dai_name = “davinci-mcasp.0”,
.codec_dai_name = “tlv320aic3x-hifi”,
.codec_name = “tlv320aic3x-codec.2-001a”,
.platform_name = “davinci-pcm-audio”,
.init = evm_aic3x_init,
.ops = &evm_ops,
};

With the above mentioned changes I am able to register the McASP0

[ 1.276813] asoc: tlv320aic3x-hifi <-> davinci-mcasp.0 mapping ok

when I try to play song using aplay I am getting the following error.

aplay: pcm_write:1575: write error: Input/output error

Please suggest.

I've tried the modifications you mentioned above. Several more changes
were needed that you didn't note before the kernel compiled cleanly:

* arch/arm/mach-omap2/devices.h: needs prototype of the
am335x_register_mcasp0() function

* reconfigure kernel to enable CONFIG_SND_AM335X_SOC_EVM

however when I booted, although I could see the init functions
running, the ALSA subsystem didn't recognize McASP0 mapping as in your
case. Are there any other details missing that I need to include to
get the "asoc: tlv320aic3x-hifi <-> davinci-mcasp.0 mapping ok"
message?

Which kernel are you using? I'm using the Angstrom linux-ti33x-psp-3.1-
r2g+gitr1d84d8853fa30cf3db2571a5aec572accca4e29d built under OE.

Thanks,

Eric