Skip to contentSkip to conversation

ASoC:core:add flag ignore_pmdown_time in snd_soc_dai_link

PATCH In review [email protected] 3 participants 3 messages Oct 27, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC:core:add flag ignore_pmdown_time in snd_soc_dai_link

With this flag, each dai_link in machine driver can choose to ignore pmdown_time during DAPM shut down sequence.

If the ignore_pmdown_time is set, the DAPM for corresponding DAI will be executed immediately.

---
 include/sound/soc.h |    3 +++
 sound/soc/soc-pcm.c |    3 ++-
 2 files changed, 5 insertions(+), 1 deletions(-)
include/sound/soc.h +3 -0
index 11cfb59..877fcc1 100644
@@ -718,6 +718,9 @@ struct snd_soc_dai_link {
 	/* Symmetry requirements */
 	unsigned int symmetric_rates:1;
 
+	/* pmdown_time is ignored at stop */
+	unsigned int ignore_pmdown_time:1;
+
 	/* codec/machine specific init - e.g. add machine controls */
 	int (*init)(struct snd_soc_pcm_runtime *rtd);
 
sound/soc/soc-pcm.c +2 -1
index ee15337..52a7259 100644
@@ -319,7 +319,8 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
 	cpu_dai->runtime = NULL;
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-		if (unlikely(codec->ignore_pmdown_time)) {
+		if (unlikely(codec->ignore_pmdown_time ||
+			rtd->dai_link->ignore_pmdown_time)) {
 			/* powered down playback stream now */
 			snd_soc_dapm_stream_event(rtd,
 				codec_dai->driver->playback.stream_name,
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 42 lines · On 27 October 2011 07:28, <[email protected]> wrote:

With this flag, each dai_link in machine driver can choose to ignore pmdown_time during DAPM shut down sequence.

If the ignore_pmdown_time is set, the DAPM for corresponding DAI will be executed immediately.

---
 include/sound/soc.h |    3 +++
 sound/soc/soc-pcm.c |    3 ++-

 2 files changed, 5 insertions(+), 1 deletions(-)
include/sound/soc.h +3 -0
index 11cfb59..877fcc1 100644
@@ -718,6 +718,9 @@ struct snd_soc_dai_link {
        /* Symmetry requirements */
        unsigned int symmetric_rates:1;
 
+       /* pmdown_time is ignored at stop */
+       unsigned int ignore_pmdown_time:1;
+
        /* codec/machine specific init - e.g. add machine controls */
        int (*init)(struct snd_soc_pcm_runtime *rtd);
 
sound/soc/soc-pcm.c +2 -2
index ee15337..52a7259 100644
@@ -319,7 +319,8 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
        cpu_dai->runtime = NULL;
 
        if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
-               if (unlikely(codec->ignore_pmdown_time)) {
+               if (unlikely(codec->ignore_pmdown_time ||
+                       rtd->dai_link->ignore_pmdown_time)) {
                        /* powered down playback stream now */
                        snd_soc_dapm_stream_event(rtd,
                                codec_dai->driver->playback.stream_name,
--
Quoted 3 lines

1.7.4.1

This looks fine by me. Peter, does this work for you ?

if so,

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw
Quoted 1 line · Liam

This looks fine by me. Peter, does this work for you ?

Peter already has a per-CODEC property he's using since the CODEC needs this for pop/click issues. This is for a system integration problem the Intel guys have.