aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc-component.h6
-rw-r--r--sound/soc/soc-component.c11
2 files changed, 17 insertions, 0 deletions
diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index a6a3b696d5b0..aa2e2cbc1ee5 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -46,10 +46,16 @@ struct snd_soc_component_driver {
int (*write)(struct snd_soc_component *component,
unsigned int reg, unsigned int val);
+ /* remove me */
/* pcm creation and destruction */
int (*pcm_new)(struct snd_soc_pcm_runtime *rtd);
void (*pcm_free)(struct snd_pcm *pcm);
+ int (*pcm_construct)(struct snd_soc_component *component,
+ struct snd_soc_pcm_runtime *rtd);
+ void (*pcm_destruct)(struct snd_soc_component *component,
+ struct snd_pcm *pcm);
+
/* component wide operations */
int (*set_sysclk)(struct snd_soc_component *component,
int clk_id, int source, unsigned int freq, int dir);
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index 2d9cb763e63a..d2b052ac88cd 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -588,6 +588,13 @@ int snd_soc_pcm_component_new(struct snd_pcm *pcm)
for_each_rtdcom(rtd, rtdcom) {
component = rtdcom->component;
+ if (component->driver->pcm_construct) {
+ ret = component->driver->pcm_construct(component, rtd);
+ if (ret < 0)
+ return ret;
+ }
+
+ /* remove me */
if (component->driver->pcm_new) {
ret = component->driver->pcm_new(rtd);
if (ret < 0)
@@ -607,6 +614,10 @@ void snd_soc_pcm_component_free(struct snd_pcm *pcm)
for_each_rtdcom(rtd, rtdcom) {
component = rtdcom->component;
+ if (component->driver->pcm_destruct)
+ component->driver->pcm_destruct(component, pcm);
+
+ /* remove me */
if (component->driver->pcm_free)
component->driver->pcm_free(pcm);
}