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.

tvp5158 音频驱动,在内核2.6.32-rt版本上移值后,启动找不到ALSA device list: No soundcards found.第一次做音频部分,请大家不吝指教啊!谢谢

Other Parts Discussed in Thread: TVP5158

tvp5158 音频驱动,在内核2.6.32-rt版本上移值后,启动找不到

ALSA device list:

No soundcards found.

我移植的是DM365_DVR_DVSDK3_00.02.00.00下的tvp5158_audio.c

然后修改个人内核代码如下

davinci-evm.c文件中

#ifdef CONFIG_SND_SOC_TVP5158AUDIO
static struct snd_soc_dai_link dm6467_evm_dai_tvp5158[] = {
 {
                .name = "tvp5158_audio",
                .stream_name = "tvp5158",
                .cpu_dai = &davinci_mcasp_dai[DAVINCI_MCASP_TVP5158_DAI],
                .codec_dai = &tvp5158_audio_dai,
                .init = evm_tvp5158_init,
                .ops = &evm_ops,
        },
};
#endif

/* davinci dm6467 evm audio machine driver TVP */
#ifdef CONFIG_SND_SOC_TVP5158AUDIO
static struct snd_soc_card dm6467_snd_soc_card_evm_tvp5158 = {
        .name = "DaVinci DM6467 EVM",
        .platform = &davinci_soc_platform,
        .dai_link = dm6467_evm_dai_tvp5158,
        .num_links = ARRAY_SIZE(dm6467_evm_dai_tvp5158),
};
#endif

/* evm audio subsystem with tvp5158 */
#ifdef CONFIG_SND_SOC_TVP5158AUDIO
static struct snd_soc_device dm6467_evm_tvp5158_snd_devdata = {
        .card = &dm6467_snd_soc_card_evm_tvp5158,
        .codec_dev  = &soc_codec_dev_tvp5158_audio,  
};
#endif

static struct platform_device *evm_snd_device, *evm_snd_device_tvp5158;

static int __init evm_init(void)
{
 struct snd_soc_device *evm_snd_dev_data, *evm_snd_dev_data_tvp5158;
 int index;
 int ret;

..

..

/*  platform data for tvp5158-audio-codec driver */
 
  #ifdef CONFIG_SND_SOC_TVP5158AUDIO
    evm_snd_device_tvp5158 = platform_device_alloc("soc-audio-tvp5158", index);
         if (!evm_snd_device_tvp5158)
                 return -ENOMEM;
  
  platform_set_drvdata(evm_snd_device_tvp5158, evm_snd_dev_data_tvp5158);
        evm_snd_dev_data_tvp5158->dev = &evm_snd_device_tvp5158->dev;
     ret = platform_device_add(evm_snd_device_tvp5158);
        if (ret)
        {
            platform_device_put(evm_snd_device_tvp5158);
           }
     #endif 

.....

}

 

在davinci_mcasp.c中增加

struct snd_soc_dai davinci_mcasp_dai[] = {
 {
  .name   = "davinci-i2s",
  .id   = 0,
  .playback = {
   .channels_min = 2,
   .channels_max  = 2,
   .rates   = DAVINCI_MCASP_RATES,
   .formats  = SNDRV_PCM_FMTBIT_S8 |
      SNDRV_PCM_FMTBIT_S16_LE |
      SNDRV_PCM_FMTBIT_S32_LE,
  },
  .capture  = {
   .channels_min  = 2,
   .channels_max  = 8,
   .rates   = DAVINCI_MCASP_RATES,
   .formats = SNDRV_PCM_FMTBIT_S8 |
      SNDRV_PCM_FMTBIT_S16_LE |
      SNDRV_PCM_FMTBIT_S32_LE,
  },
  .ops   = &davinci_mcasp_dai_ops,

 },
 {
  .name   = "davinci-dit",
  .id   = 1,
  .playback  = {
   .channels_min = 2,
   .channels_max = 384,
   .rates  = DAVINCI_MCASP_RATES,
   .formats = SNDRV_PCM_FMTBIT_S16_LE,
  },
  .ops   = &davinci_mcasp_dai_ops,
 },
 {
                .name           = "davinci-tvp5158",
                .id             = 2,
                .capture        = {
                        .channels_min   = 2,
                        .channels_max   = 8,
                        .rates          = DAVINCI_MCASP_RATES,
                        .formats        = SNDRV_PCM_FMTBIT_S16_LE,
                },
                .ops            = &davinci_mcasp_dai_ops,
        },

};
EXPORT_SYMBOL_GPL(davinci_mcasp_dai);

其中tvp5158_audio.c是5158的alsa驱动。

目前存在问题如下:

sound/soc/davinci/davinci-mcasp.c:967:davinci_mcasp_probe,pdev-name:davinci-mcasp ,zhanglf !!!
Davinci Soc Sound init()
sound/soc/davinci/davinci-evm.c:299:evm_init,zhanglf !!!
sound/soc/davinci/davinci-evm.c:303:evm_init,zhanglf !!!
sound/soc/davinci/davinci-evm.c:334:evm_init,zhanglf !!!
sound/soc/davinci/davinci-evm.c:349:evm_init,dev-name:soc-audio-tvp5158 ,zhanglf !!!
ALSA device list:
  No soundcards found.
TCP cubic registered
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Clocks: disable unused uart1
Clocks: disable unused emac
Clocks: disable unused timer1
Clocks: disable unused pci
davinci_emac_probe: using random MAC addr: 0a:8a:1a:05:45:43
emac-mii: probed
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=1:1f, id=8201)
ADDRCONF(NETDEV_UP): eth0: link is not ready
IP-Config: Complete:
     device=eth0, addr=192.168.1.100, mask=255.255.255.0, gw=192.168.1.1,
     host=192.168.1.100, domain=, nis-domain=(none),
     bootserver=192.168.1.103, rootserver=192.168.1.103, rootpath=
Looking up port of RPC 100003/2 on 192.168.1.103
PHY: 1:1f - Link is Up - 100/Full
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Looking up port of RPC 100005/1 on 192.168.1.103
VFS: Mounted root (nfs filesystem) on device 0:13.
Freeing init memory: 144K
INIT: version 2.86 booting
Please wait: booting...
Starting udev
snd_page_alloc: exports duplicate symbol snd_free_pages (owned by kernel)
ide_core: exports duplicate symbol generic_ide_ioctl (owned by kernel)
Error: Driver 'watchdog' is already registered, aborting...
soundcore: module is already loaded
Error: Driver 'palm_bk3710' is already registered, aborting...
snd: module is already loaded
snd_timer: module is already loaded
snd_pcm: module is already loaded
snd_soc_core: exports duplicate symbol snd_soc_unregister_codec (owned by kernel)