diff options
author | Liam Girdwood <lrg@ti.com> | 2011-07-24 15:59:41 -0400 |
---|---|---|
committer | Paolo Pisati <paolo.pisati@canonical.com> | 2012-08-17 04:18:24 -0400 |
commit | 5515bb26e57bc0c74c46389ec8a826e5cbb090fe (patch) | |
tree | 4be1b7adf8aaa8bad76f6c7ebeef6ffc7a22d9a2 | |
parent | eb0634231befb53906a53b94885c64baf45d0c43 (diff) |
Subject: [PATCH 067/104] ASoC: dapm - Add DAPM stream completion event.
In preparation for ASoC DSP support.
This adds a callback function to be called at the completion of a DAPM stream
event.
This can be used by DSP components to perform calculations based on DAPM graphs.
Signed-off-by: Liam Girdwood <lrg@ti.com>
-rw-r--r-- | include/sound/soc-dapm.h | 2 | ||||
-rw-r--r-- | include/sound/soc.h | 6 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 2 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 4 |
4 files changed, 14 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index e09505c5a49..122e7a24ab3 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -518,6 +518,8 @@ struct snd_soc_dapm_context { | |||
518 | enum snd_soc_bias_level target_bias_level; | 518 | enum snd_soc_bias_level target_bias_level; |
519 | struct list_head list; | 519 | struct list_head list; |
520 | 520 | ||
521 | int (*stream_event)(struct snd_soc_dapm_context *dapm); | ||
522 | |||
521 | #ifdef CONFIG_DEBUG_FS | 523 | #ifdef CONFIG_DEBUG_FS |
522 | struct dentry *debugfs_dapm; | 524 | struct dentry *debugfs_dapm; |
523 | #endif | 525 | #endif |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 6ce8dc32a3d..e52a2fae146 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -634,6 +634,9 @@ struct snd_soc_codec_driver { | |||
634 | void (*seq_notifier)(struct snd_soc_dapm_context *, | 634 | void (*seq_notifier)(struct snd_soc_dapm_context *, |
635 | enum snd_soc_dapm_type, int); | 635 | enum snd_soc_dapm_type, int); |
636 | 636 | ||
637 | /* codec stream completion event */ | ||
638 | int (*stream_event)(struct snd_soc_dapm_context *dapm); | ||
639 | |||
637 | /* probe ordering - for components with runtime dependencies */ | 640 | /* probe ordering - for components with runtime dependencies */ |
638 | int probe_order; | 641 | int probe_order; |
639 | int remove_order; | 642 | int remove_order; |
@@ -661,6 +664,9 @@ struct snd_soc_platform_driver { | |||
661 | /* platform stream ops */ | 664 | /* platform stream ops */ |
662 | struct snd_pcm_ops *ops; | 665 | struct snd_pcm_ops *ops; |
663 | 666 | ||
667 | /* platform stream completion event */ | ||
668 | int (*stream_event)(struct snd_soc_dapm_context *dapm); | ||
669 | |||
664 | /* probe ordering - for components with runtime dependencies */ | 670 | /* probe ordering - for components with runtime dependencies */ |
665 | int probe_order; | 671 | int probe_order; |
666 | int remove_order; | 672 | int remove_order; |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 52888b5e91d..726d24076e8 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -3141,6 +3141,7 @@ int snd_soc_register_platform(struct device *dev, | |||
3141 | platform->driver = platform_drv; | 3141 | platform->driver = platform_drv; |
3142 | platform->dapm.dev = dev; | 3142 | platform->dapm.dev = dev; |
3143 | platform->dapm.platform = platform; | 3143 | platform->dapm.platform = platform; |
3144 | platform->dapm.stream_event = platform_drv->stream_event; | ||
3144 | 3145 | ||
3145 | mutex_lock(&client_mutex); | 3146 | mutex_lock(&client_mutex); |
3146 | list_add(&platform->list, &platform_list); | 3147 | list_add(&platform->list, &platform_list); |
@@ -3253,6 +3254,7 @@ int snd_soc_register_codec(struct device *dev, | |||
3253 | codec->dapm.dev = dev; | 3254 | codec->dapm.dev = dev; |
3254 | codec->dapm.codec = codec; | 3255 | codec->dapm.codec = codec; |
3255 | codec->dapm.seq_notifier = codec_drv->seq_notifier; | 3256 | codec->dapm.seq_notifier = codec_drv->seq_notifier; |
3257 | codec->dapm.stream_event = codec_drv->stream_event; | ||
3256 | codec->dev = dev; | 3258 | codec->dev = dev; |
3257 | codec->driver = codec_drv; | 3259 | codec->driver = codec_drv; |
3258 | codec->num_dai = num_dai; | 3260 | codec->num_dai = num_dai; |
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 5d477dbd40c..5c103436a8d 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -2603,6 +2603,10 @@ static void soc_dapm_stream_event(struct snd_soc_dapm_context *dapm, | |||
2603 | } | 2603 | } |
2604 | 2604 | ||
2605 | dapm_power_widgets(dapm, event); | 2605 | dapm_power_widgets(dapm, event); |
2606 | |||
2607 | /* do we need to notify any clients that DAPM stream is complete */ | ||
2608 | if (dapm->stream_event) | ||
2609 | dapm->stream_event(dapm); | ||
2606 | } | 2610 | } |
2607 | 2611 | ||
2608 | /** | 2612 | /** |