This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

mcbsp error with tlv320aic3101

Dear All,


I tried to use the tlv320aic3101 external audio codec on dm368.
But I couldn't do that.
Because there are some errors as below.

1'st
[ 0.189648] RPC: Registered tcp transport module.
[ 0.189675] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.195899] davinci-mcbsp davinci-mcbsp: Error getting resource
[ 0.262531] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

2'nd
[ 1.854838] watchdog watchdog: heartbeat 60 sec
[ 1.864082] Error: Driver 'davinci-mcbsp' is already registered, aborting...
[ 1.926598] ALSA device list:
[ 1.929575] No soundcards found.
[ 1.934427] TCP cubic registered


3'rd
[ 6.730766] I2C: I2C_devIoctl()
[ 6.808942] I2C: I2C_devIoctl()
[ 6.975726] davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
ALSA lib confmisc.c:768:(parse_card) cannot find[ 7.089664] mmc0: new high speed SD card at address b368
card '0'
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error [ 7.111122] mmcblk0: mmc0:b368 00000 1.83 GiB
evaluating strings
ALSA lib conf.c:4184:(_snd_c[ 7.118596] mmcblk0: p1
onfig_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:4184:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4663:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM default
ERROR (drv_audio.c|DRV_audioplayOpen|203): unable to open pcm device: No such file or directory
ERROR (audioThr.c|AUDIOPLAY_audioTskMain|772): AUDIOPLAY_audioTskCreate()
ERROR (avServerMainThr.c|AVSERVER_tskStart|189):
[ 7.187896] Loading iSCSI transport class v2.0-870.
GetSampleRate open file fail

I found below code.

### File : dm365.c ###
static struct resource dm365_asp_resources[] = {
{
.start = DAVINCI_DM365_ASP0_BASE,
.end = DAVINCI_DM365_ASP0_BASE + SZ_8K - 1,
.flags = IORESOURCE_MEM,
},
{
.start = DAVINCI_DMA_ASP0_TX,
.end = DAVINCI_DMA_ASP0_TX,
.flags = IORESOURCE_DMA,
},
{
.start = DAVINCI_DMA_ASP0_RX,
.end = DAVINCI_DMA_ASP0_RX,
.flags = IORESOURCE_DMA,
},
};

static struct platform_device dm365_asp_device = {
.name = "davinci-mcbsp",
.id = -1,
.num_resources = ARRAY_SIZE(dm365_asp_resources),
.resource = dm365_asp_resources,
};

### File : mcbsp.c / Function : davinci_mcbsp_probe ###
/* Resources */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(&pdev->dev, "Error getting resource\n");
goto res_fail_exit;
}

size = resource_size(res);
base_addr = res->start;
if (!request_mem_region(res->start, size, pdev->name)) {
dev_err(&pdev->dev, "Error requesting module memory region\n");
ret = -ENXIO;
goto res_fail_exit;
}

/* ioremap */
mcbsp[inst]->io_base = ioremap_nocache(res->start, size);
if (!mcbsp[inst]->io_base) {
ret = -ENOMEM;
goto ioremap_fail_exit;
}


/* FIFO data resource */
res = platform_get_resource(pdev, IORESOURCE_MEM, 1);

if (!res) {
dev_err(&pdev->dev, "Error getting resource\n");
goto ioremap_fail_exit;
}


asp resource has 0:MEM, 1:DMA, 2:DMA
but davinci_mcbsp_probe tried to get the two IORESOURCE_MEM, but there are just only one IORESOURCE_MEM.
And there are error as "davinci-mcbsp davinci-mcbsp: Error getting resource".

To use the tlv320aic3101, Do I need to change the code ?
If it right, then Which code will be changed ?

Thank you.
From Jun.