跨平台移植TLV320AIC3X 的音频,求高手进来指点!
硬件平台: 高通芯片mdm96x5 自带音频是wcd9304 和wcd9310
软件平台: Linux内核3.4.91 yocoto-1.6 需要的是tlv320aic3104
需求: 现在我们需要把TLV320AIC3X 移植在高通上面(需要I2S 和I2C),因为高通的machine里面都是关于wcd9304 和wcd9310的内容。所以现在遇到了问题,以下是我的做法:
1. 找到snd_soc_dai_link 添加 tlv320aic3x的内容,这两行是高通原本的内容,我对应进行了修改(通过I2S控制的部分,但是它分读写的,而我们的snd_soc_dai_link都是一个)
{
.name = LPASS_BE_SEC_I2S_RX,
.stream_name = "Secondary I2S Playback",
.cpu_dai_name = "msm-dai-q6.4",
.platform_name = "msm-pcm-routing",
.codec_name = "tlv320aic3x-codec.0-0018",
.codec_dai_name = "tlv320aic3x-hifi",
.init = &mdm9615_ar7_sec_i2s_audrx_init,
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SEC_I2S_RX,
.be_hw_params_fixup = msm9615_i2s_rx_be_hw_params_fixup,
.ops = &msm9615_i2s_be_ops,
},
{
.name = LPASS_BE_SEC_I2S_TX,
.stream_name = "Secondary I2S Capture",
.cpu_dai_name = "msm-dai-q6.5",
.platform_name = "msm-pcm-routing",
.codec_name = "tlv320aic3x-codec.0-0018",
.codec_dai_name = "tlv320aic3x-hifi",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SEC_I2S_TX,
.be_hw_params_fixup = msm9615_i2s_tx_be_hw_params_fixup,
.ops = &msm9615_i2s_be_ops,
},
2. 除了machine 里的修改 还有就是在arch/arm/mach-msm里进行I2C 的硬件配置。
3.dmesg 打印信息:
[ 2.605371] sitar_probe
[ 2.608087] voice_allocate_shared_memory: ION memory allocation failed
[ 2.614222] msm_pcm_probe: dev name msm-voip-dsp
[ 2.619899] msm_pcm_probe: dev name msm-host-pcm-voice
[ 2.625087] mmc0: host doesn't support card's voltages
[ 2.629207] mmc0: error -22 whilst initialising MMC card
[ 2.635312] msm_pcm_probe: dev name msm-pcm-dsp
[ 2.639188] msm_pcm_probe: dev name msm-multi-ch-pcm-dsp
[ 2.648924] smsc95xx v1.0.4
[ 2.651609] mdm9615_audio_init: Interface Type = 0
[ 2.656004] mdm9615_audio_init(): Interface Type = 0
[ 2.660552] mdm9615_audio_init - AR7 configuration
[ 2.666137] soc-audio soc-audio.0: ASoC machine mdm9615-sitar-snd-card should use snd_soc_register_card()
[ 2.675232] msm_hsusb msm_hsusb: CI13XXX_CONTROLLER_RESET_EVENT received
[ 2.681550] msm_otg msm_otg: OTG state changed, charger_type changed
[ 2.688722] aic3x_modinit is into successful!
[ 2.692507] ~~~~~~aic3x_i2c_probe is into successful!~~~~~~~
[ 2.710209] msm_dai_q6_dai_sec_auxpcm_probe
[ 2.713383] msm_dai_q6_dai_sec_auxpcm_probe
[ 2.717991] ~~~~~~~aic3x_probe is into successful!~~~~~~~
[ 2.723241] tlv320aic3x-codec 0-0018: Failed to get supply 'IOVDD': -517
[ 2.729650] tlv320aic3x-codec 0-0018: Failed to request supplies: -517
[ 2.736242] tlv320aic3x-codec 0-0018: asoc: failed to probe CODEC tlv320aic3x-codec.0-0018: -517
[ 2.745093] asoc: failed to instantiate card mdm9615-sitar-snd-card: -517
[ 2.782847] smsc95xx 1-1:1.0: eth0: register 'smsc95xx' at usb-msm_hsic_host-1, smsc95xx USB 2.0 Ethernet, 56:0e:62:a2:de:79
红色两个successful是我自己加的,I2C 没问题,可以看到进去了 aic3x_probe里了 但是出错了,是就卡在这里了,板子就没有起来。
想问问高手们对于machine来说 我只需要改codec_name 和codec_dai_name 就可以了吗? 因为它这里面有别的音频的配置,那些我是不是就不需要管了呢?
板子会启用这个snd_soc_dai_link :
/* Digital audio interface glue - connects codec <---> CPU */
static struct snd_soc_dai_link mdm9615_dai_ar7[] = {
/* FrontEnd DAI Links */
{
.name = "MDM9615 Media1",
.stream_name = "MultiMedia1",
.cpu_dai_name = "MultiMedia1",
.platform_name = "msm-pcm-dsp",
.dynamic = 1,
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.be_id = MSM_FRONTEND_DAI_MULTIMEDIA1
},
{
.name = "MDM9615 Media2",
.stream_name = "MultiMedia2",
.cpu_dai_name = "MultiMedia2",
.platform_name = "msm-pcm-dsp",
.dynamic = 1,
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.be_id = MSM_FRONTEND_DAI_MULTIMEDIA2,
},
{
.name = "Circuit-Switch Voice",
.stream_name = "CS-Voice",
.cpu_dai_name = "CS-VOICE",
.platform_name = "msm-pcm-voice",
.dynamic = 1,
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.be_id = MSM_FRONTEND_DAI_CS_VOICE,
.no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
.ignore_suspend = 1,
},
{
.name = "MSM VoIP",
.stream_name = "VoIP",
.cpu_dai_name = "VoIP",
.platform_name = "msm-voip-dsp",
.dynamic = 1,
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.be_id = MSM_FRONTEND_DAI_VOIP,
},
{
.name = "MSM AFE-PCM RX",
.stream_name = "AFE-PROXY RX",
.cpu_dai_name = "msm-dai-q6.241",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-rx",
.platform_name = "msm-pcm-afe",
.ignore_suspend = 1,
},
{
.name = "MSM AFE-PCM TX",
.stream_name = "AFE-PROXY TX",
.cpu_dai_name = "msm-dai-q6.240",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.platform_name = "msm-pcm-afe",
.ignore_suspend = 1,
},
{
.name = "SLIMBUS_0 Hostless",
.stream_name = "SLIMBUS_0 Hostless",
.cpu_dai_name = "SLIMBUS0_HOSTLESS",
.platform_name = "msm-pcm-hostless",
.dynamic = 1,
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
.ignore_suspend = 1,
/* .be_id = do not care */
},
{
.name = "AUXPCM Hostless",
.stream_name = "AUXPCM Hostless",
.cpu_dai_name = "AUXPCM_HOSTLESS",
.platform_name = "msm-pcm-hostless",
.dynamic = 1,
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
.ignore_suspend = 1,
},
{
.name = "VoLTE",
.stream_name = "VoLTE",
.cpu_dai_name = "VoLTE",
.platform_name = "msm-pcm-voice",
.dynamic = 1,
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.trigger = {SND_SOC_DPCM_TRIGGER_POST, SND_SOC_DPCM_TRIGGER_POST},
.be_id = MSM_FRONTEND_DAI_VOLTE,
.no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
.ignore_suspend = 1,
},
{
.name = "DTMF RX Hostless",
.stream_name = "DTMF RX Hostless",
.cpu_dai_name = "DTMF_RX_HOSTLESS",
.platform_name = "msm-pcm-dtmf",
.dynamic = 1,
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
.ignore_suspend = 1,
.be_id = MSM_FRONTEND_DAI_DTMF_RX,
.no_host_mode = SND_SOC_DAI_LINK_NO_HOST,
.ignore_suspend = 1,
},
{
.name = "DTMF TX",
.stream_name = "DTMF TX",
.cpu_dai_name = "msm-dai-stub",
.platform_name = "msm-pcm-dtmf",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.ignore_suspend = 1,
},
{
.name = "CS-VOICE HOST RX CAPTURE",
.stream_name = "CS-VOICE HOST RX CAPTURE",
.cpu_dai_name = "msm-dai-stub",
.platform_name = "msm-host-pcm-voice",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.ignore_suspend = 1,
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
},
{
.name = "CS-VOICE HOST RX PLAYBACK",
.stream_name = "CS-VOICE HOST RX PLAYBACK",
.cpu_dai_name = "msm-dai-stub",
.platform_name = "msm-host-pcm-voice",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-rx",
.ignore_suspend = 1,
},
{
.name = "CS-VOICE HOST TX CAPTURE",
.stream_name = "CS-VOICE HOST TX CAPTURE",
.cpu_dai_name = "msm-dai-stub",
.platform_name = "msm-host-pcm-voice",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.ignore_suspend = 1,
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
SND_SOC_DPCM_TRIGGER_POST},
},
{
.name = "CS-VOICE HOST TX PLAYBACK",
.stream_name = "CS-VOICE HOST TX PLAYBACK",
.cpu_dai_name = "msm-dai-stub",
.platform_name = "msm-host-pcm-voice",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-rx",
.ignore_suspend = 1,
},
/* Backend AFE DAI Links */
{
.name = LPASS_BE_AFE_PCM_RX,
.stream_name = "AFE Playback",
.cpu_dai_name = "msm-dai-q6.224",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-rx",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_AFE_PCM_RX,
},
{
.name = LPASS_BE_AFE_PCM_TX,
.stream_name = "AFE Capture",
.cpu_dai_name = "msm-dai-q6.225",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_AFE_PCM_TX,
},
/* Incall Music BACK END DAI Link */
{
.name = LPASS_BE_VOICE_PLAYBACK_TX,
.stream_name = "Voice Farend Playback",
.cpu_dai_name = "msm-dai-q6.32773",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-rx",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
.be_hw_params_fixup = mdm9615_be_hw_params_fixup,
},
/* Incall Record Uplink BACK END DAI Link */
{
.name = LPASS_BE_INCALL_RECORD_TX,
.stream_name = "Voice Uplink Capture",
.cpu_dai_name = "msm-dai-q6.32772",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_VOICE_PLAYBACK_TX,
.be_id = MSM_BACKEND_DAI_INCALL_RECORD_TX,
.be_hw_params_fixup = mdm9615_be_hw_params_fixup,
},
/* Incall Record Downlink BACK END DAI Link */
{
.name = LPASS_BE_INCALL_RECORD_RX,
.stream_name = "Voice Downlink Capture",
.cpu_dai_name = "msm-dai-q6.32771",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_INCALL_RECORD_RX,
.be_hw_params_fixup = mdm9615_be_hw_params_fixup,
.ignore_pmdown_time = 1, /* this dailink has playback support */
},
/* SECONDARY AUX PCM Backend DAI Links */
{
.name = LPASS_BE_SEC_AUXPCM_RX,
.stream_name = "SEC AUX PCM Playback",
.cpu_dai_name = "msm-dai-q6.12",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-rx",
.init = &mdm9615_ar7_sec_auxpcm_init,
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SEC_AUXPCM_RX,
.be_hw_params_fixup = mdm9615_ar7_sec_auxpcm_be_params_fixup,
.ops = &mdm9615_ar7_sec_auxpcm_be_ops,
},
{
.name = LPASS_BE_SEC_AUXPCM_TX,
.stream_name = "SEC AUX PCM Capture",
.cpu_dai_name = "msm-dai-q6.13",
.platform_name = "msm-pcm-routing",
.codec_name = "msm-stub-codec.1",
.codec_dai_name = "msm-stub-tx",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SEC_AUXPCM_TX,
.be_hw_params_fixup = mdm9615_ar7_sec_auxpcm_be_params_fixup,
.ops = &mdm9615_ar7_sec_auxpcm_be_ops,
},
{
.name = LPASS_BE_SEC_I2S_RX,
.stream_name = "Secondary I2S Playback",
.cpu_dai_name = "msm-dai-q6.4",
.platform_name = "msm-pcm-routing",
.codec_name = "tlv320aic3x-codec.0-0018",
.codec_dai_name = "tlv320aic3x-hifi",
.init = &mdm9615_ar7_sec_i2s_audrx_init,
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SEC_I2S_RX,
.be_hw_params_fixup = msm9615_i2s_rx_be_hw_params_fixup,
.ops = &msm9615_i2s_be_ops,
},
{
.name = LPASS_BE_SEC_I2S_TX,
.stream_name = "Secondary I2S Capture",
.cpu_dai_name = "msm-dai-q6.5",
.platform_name = "msm-pcm-routing",
.codec_name = "tlv320aic3x-codec.0-0018",
.codec_dai_name = "tlv320aic3x-hifi",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SEC_I2S_TX,
.be_hw_params_fixup = msm9615_i2s_tx_be_hw_params_fixup,
.ops = &msm9615_i2s_be_ops,
},
/* Backend SlimBus DAI Links */
/* SWISTART */
#if !defined(CONFIG_SIERRA_INTERNAL_CODEC) && !defined(CONFIG_SIERRA_EXTERNAL_CODEC)
{
.name = LPASS_BE_SLIMBUS_0_RX,
.stream_name = "Slimbus Playback",
.cpu_dai_name = "msm-dai-q6.16384",
.platform_name = "msm-pcm-routing",
.codec_name = "tabla_codec",
.codec_dai_name = "tabla_rx1",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SLIMBUS_0_RX,
.init = &mdm9615_audrx_init,
.be_hw_params_fixup = mdm9615_slim_0_rx_be_hw_params_fixup,
.ops = &mdm9615_be_ops,
},
{
.name = LPASS_BE_SLIMBUS_0_TX,
.stream_name = "Slimbus Capture",
.cpu_dai_name = "msm-dai-q6.16385",
.platform_name = "msm-pcm-routing",
.codec_name = "tabla_codec",
.codec_dai_name = "tabla_tx1",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SLIMBUS_0_TX,
.be_hw_params_fixup = mdm9615_slim_0_tx_be_hw_params_fixup,
.ops = &mdm9615_be_ops,
},
#else
#ifdef CONFIG_WCD9310_CODEC
{
.name = LPASS_BE_SLIMBUS_0_RX,
.stream_name = "Slimbus Playback",
.cpu_dai_name = "msm-dai-q6.16384",
.platform_name = "msm-pcm-routing",
.codec_name = "tabla_codec",
.codec_dai_name = "tabla_rx1",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SLIMBUS_0_RX,
.init = &mdm9615_audrx_init,
.be_hw_params_fixup = mdm9615_slim_0_rx_be_hw_params_fixup,
.ops = &mdm9615_be_ops,
},
{
.name = LPASS_BE_SLIMBUS_0_TX,
.stream_name = "Slimbus Capture",
.cpu_dai_name = "msm-dai-q6.16385",
.platform_name = "msm-pcm-routing",
.codec_name = "tabla_codec",
.codec_dai_name = "tabla_tx1",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SLIMBUS_0_TX,
.be_hw_params_fixup = mdm9615_slim_0_tx_be_hw_params_fixup,
.ops = &mdm9615_be_ops,
},
#elif defined(CONFIG_WCD9304_CODEC)
{
.name = LPASS_BE_SLIMBUS_0_RX,
.stream_name = "Slimbus Playback",
.cpu_dai_name = "msm-dai-q6.16384",
.platform_name = "msm-pcm-routing",
.codec_name = "sitar_codec",
.codec_dai_name = "sitar_rx1",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SLIMBUS_0_RX,
.init = &mdm9615_audrx_init,
.be_hw_params_fixup = mdm9615_slim_0_rx_be_hw_params_fixup,
.ops = &mdm9615_be_ops,
},
{
.name = LPASS_BE_SLIMBUS_0_TX,
.stream_name = "Slimbus Capture",
.cpu_dai_name = "msm-dai-q6.16385",
.platform_name = "msm-pcm-routing",
.codec_name = "sitar_codec",
.codec_dai_name = "sitar_tx1",
.no_pcm = 1,
.be_id = MSM_BACKEND_DAI_SLIMBUS_0_TX,
.be_hw_params_fixup = mdm9615_slim_0_tx_be_hw_params_fixup,
.ops = &mdm9615_be_ops,
},
#endif
#endif
/* SWISTOP */
};
请求围观,跨平台移植tlv320aic3104...