diff options
-rw-r--r-- | include/sound/soc-dapm.h | 2 | ||||
-rw-r--r-- | include/sound/soc.h | 5 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 2 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 12 |
4 files changed, 18 insertions, 3 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index f37c293..788136c 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h @@ -515,6 +515,8 @@ struct snd_soc_dapm_context { int dev_power; struct list_head list; + int (*stream_event)(struct snd_soc_dapm_context *dapm); + #ifdef CONFIG_DEBUG_FS struct dentry *debugfs_dapm; #endif diff --git a/include/sound/soc.h b/include/sound/soc.h index 66189b0..7579324 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -617,6 +617,9 @@ struct snd_soc_codec_driver { /* probe ordering - for components with runtime dependencies */ bool late_probe; bool early_remove; + + /* codec stream completion event */ + int (*stream_event)(struct snd_soc_dapm_context *dapm); }; /* SoC platform interface */ @@ -644,6 +647,8 @@ struct snd_soc_platform_driver { /* probe ordering - for components with runtime dependencies */ bool late_probe; bool early_remove; + + int (*stream_event)(struct snd_soc_dapm_context *dapm); }; struct snd_soc_platform { diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e8585e9..932711a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3659,6 +3659,7 @@ int snd_soc_register_platform(struct device *dev, platform->dev = dev; platform->driver = platform_drv; platform->dapm.dev = dev; + platform->dapm.stream_event = platform_drv->stream_event; mutex_lock(&client_mutex); list_add(&platform->list, &platform_list); @@ -3771,6 +3772,7 @@ int snd_soc_register_codec(struct device *dev, codec->dapm.dev = dev; codec->dapm.codec = codec; codec->dapm.seq_notifier = codec_drv->seq_notifier; + codec->dapm.stream_event = codec_drv->stream_event; codec->dev = dev; codec->driver = codec_drv; codec->num_dai = num_dai; diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 7e05c6b..f369656 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2440,6 +2440,9 @@ static void soc_dapm_stream_event(struct snd_soc_dapm_context *dapm, } dapm_power_widgets(dapm, event); + /* do we need to notify any clients that DAPM stream is complete */ + if (dapm->stream_event) + dapm->stream_event(dapm); } /** @@ -2461,9 +2464,12 @@ int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, if (stream == NULL) return 0; - mutex_lock(&codec->mutex); - soc_dapm_stream_event(&codec->dapm, stream, event); - mutex_unlock(&codec->mutex); + mutex_lock(&rtd->card->dapm_mutex); + + soc_dapm_stream_event(&rtd->platform->dapm, stream, event); + soc_dapm_stream_event(&rtd->codec->dapm, stream, event); + + mutex_unlock(&rtd->card->dapm_mutex); return 0; } |