参照元†
- struct snd_soc_pcm_runtime *fe
- struct snd_soc_pcm_runtime *be
- int stream
返り値†
/* connect a FE and BE */
static int dpcm_be_connect(struct snd_soc_pcm_runtime *fe,
struct snd_soc_pcm_runtime *be, int stream)
{
struct snd_soc_dpcm *dpcm;
/* only add new dpcms */
list_for_each_entry(dpcm, &fe->dpcm[stream].be_clients, list_be) {
if (dpcm->be == be && dpcm->fe == fe)
return 0;
}
dpcm = kzalloc(sizeof(struct snd_soc_dpcm), GFP_KERNEL);
if (!dpcm)
return -ENOMEM;
dpcm->be = be;
dpcm->fe = fe;
be->dpcm[stream].runtime = fe->dpcm[stream].runtime;
dpcm->state = SND_SOC_DPCM_LINK_STATE_NEW;
list_add(&dpcm->list_be, &fe->dpcm[stream].be_clients);
list_add(&dpcm->list_fe, &be->dpcm[stream].fe_clients);
dev_dbg(fe->dev, "connected new DPCM %s path %s %s %s\n",
stream ? "capture" : "playback", fe->dai_link->name,
stream ? "<-" : "->", be->dai_link->name);
#ifdef CONFIG_DEBUG_FS
if (fe->debugfs_dpcm_root)
dpcm->debugfs_state = debugfs_create_u32(be->dai_link->name, 0644,
fe->debugfs_dpcm_root, &dpcm->state);
#endif
return 1;
}
コメント†