machine driver的probe函数会调用此api向Alsa注册声卡 1intsnd_soc_register_card(structsnd_soc_card *card)2{3inti, ret;4structsnd_soc_pcm_runtime *rtd;56if(!card->name || !card->dev)7return-EINVAL;89for(i =0; i < card->num_links; i++) {10structsnd_soc_dai_link *link = &card-...
-->soc_post_component_init// 为pcm runtime实例创建device对象-->soc_new_pcm// 创建PCM 逻辑设备,分FE和BE-->snd_soc_dapm_link_dai_widgets// dai widget 和 stream widget 建立连接-->snd_soc_dapm_connect_dai_link_widgets// BE dai widget和 codec dai widget建立连接,codec dai widget和codec ...
8 changes: 7 additions & 1 deletion 8 sound/soc/soc-compress.c Original file line numberDiff line numberDiff line change @@ -689,7 +689,13 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)compr->ops->copy = soc_compr_copy;...
(struct snd_soc_pcm_runtime *rtd, int num) { if (platform-driver-ops) { soc_pcm_ops.mmap = platform-driver-ops-mmap; soc_pcm_ops.pointer = platform-driver-ops-pointer; soc_pcm_ops.ioctl = platform-driver-ops-ioctl; soc_pcm_ops.copy = platform-driver-ops-copy; soc_pcm_ops....
==> snd_pcm_playback_open或者snd_pcm_capture_open ==> snd_pcm_open或者oss的snd_pcm_oss_f_reg.snd_pcm_oss_open,这就对应/dev/dsp了 ==> snd_pcm_open_file或者oss的snd_pcm_oss_open_file ==> snd_pcm_open_substream ==> soc_pcm_open ...
.open =soc_pcm_open, .close =soc_codec_close, .hw_params =soc_pcm_hw_params, .hw_free =soc_pcm_hw_free, .prepare =soc_pcm_prepare, .trigger =soc_pcm_trigger, .pointer =soc_pcm_pointer, }; staticintsoc_new_pcm(structsnd_soc_pcm_runtime*rtd,intnum) ...
snd_soc_platform 之 ops:snd_pcm_ops 分析 snd_pcm_ops open 中会有 DMA 的相关设置 注意 其中的 音频数据流向图 就是 dpam 中 流向图 snd_pcm_ops的更多描述
示例1: omap_pcm_hw_free ▲点赞 7▼ staticintomap_pcm_hw_free(struct snd_pcm_substream *substream){structsnd_pcm_runtime*runtime=substream->runtime;structomap_runtime_data*prtd=runtime->private_data;if(prtd->dma_data ==NULL)return0; ...
staticintmsm8960_audrx_init(struct snd_soc_pcm_runtime *rtd){interr;structsnd_soc_codec*codec=rtd->codec;structsnd_soc_dapm_context*dapm= &codec->dapm;structsnd_soc_dai*cpu_dai=rtd->cpu_dai;structpm_gpiojack_gpio_cfg= {.direction = PM_GPIO_DIR_IN, ...
*/staticintsunxi_daudio_init(struct snd_soc_pcm_runtime *rtd){intret;structsnd_soc_codec*codec=rtd->codec;structsnd_soc_dapm_context*dapm= &codec->dapm;structsnd_soc_card*card=rtd->card;runtime = rtd;/* Add imapx specific widgets */snd_soc_dapm_new_controls(dapm, rt3261_dapm_widge...