struct snd_soc_pcm_runtime *rtd);
void (*pcm_destruct)(struct snd_soc_component *component,
struct snd_pcm *pcm);
+ int (*pcm_new)(struct snd_soc_component *component,
+ struct snd_soc_pcm_runtime *rtd);
+ void (*pcm_free)(struct snd_soc_component *component,
+ struct snd_pcm *pcm);
/* component wide operations */
int (*set_sysclk)(struct snd_soc_component *component,
struct snd_soc_dai *dai = snd_soc_find_dai_with_mutex(dlc);
if (dai && (dai->component->driver->pcm_construct ||
+ dai->component->driver->pcm_new ||
(dai->driver->ops && dai->driver->ops->pcm_new)))
return true;
if (ret < 0)
return soc_component_ret(component, ret);
}
+ if (component->driver->pcm_new) {
+ ret = component->driver->pcm_new(component, rtd);
+ if (ret < 0)
+ return soc_component_ret(component, ret);
+ }
}
return 0;
if (!rtd->pcm)
return;
- for_each_rtd_components(rtd, i, component)
+ for_each_rtd_components(rtd, i, component) {
if (component->driver->pcm_destruct)
component->driver->pcm_destruct(component, rtd->pcm);
+ if (component->driver->pcm_free)
+ component->driver->pcm_free(component, rtd->pcm);
+ }
}
int snd_soc_pcm_component_prepare(struct snd_pcm_substream *substream)