Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: broonie@kernel.org
Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org,
	lgirdwood@gmail.com
Subject: [RFC PATCH 1/4] ASoC: dapm: Add support for hw_free on CODEC to CODEC links
Date: Thu, 11 Oct 2018 17:28:28 +0100	[thread overview]
Message-ID: <20181011162831.26351-2-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20181011162831.26351-1-ckeepax@opensource.cirrus.com>

Currently, on power down for a CODEC to CODEC DAI link we only call
digital_mute and shutdown. Provide a little more flexibility for drivers
by adding a call to hw_free as well.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 sound/soc/soc-dapm.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 8c5b065c88806..a5178845065b3 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3737,25 +3737,30 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
 			ret = 0;
 		}
 
+		substream.stream = SNDRV_PCM_STREAM_CAPTURE;
 		snd_soc_dapm_widget_for_each_source_path(w, path) {
 			source = path->source->priv;
 
+			if (source->driver->ops->hw_free)
+				source->driver->ops->hw_free(&substream,
+							     source);
+
 			source->active--;
-			if (source->driver->ops->shutdown) {
-				substream.stream = SNDRV_PCM_STREAM_CAPTURE;
+			if (source->driver->ops->shutdown)
 				source->driver->ops->shutdown(&substream,
 							      source);
-			}
 		}
 
+		substream.stream = SNDRV_PCM_STREAM_PLAYBACK;
 		snd_soc_dapm_widget_for_each_sink_path(w, path) {
 			sink = path->sink->priv;
 
+			if (sink->driver->ops->hw_free)
+				sink->driver->ops->hw_free(&substream, sink);
+
 			sink->active--;
-			if (sink->driver->ops->shutdown) {
-				substream.stream = SNDRV_PCM_STREAM_PLAYBACK;
+			if (sink->driver->ops->shutdown)
 				sink->driver->ops->shutdown(&substream, sink);
-			}
 		}
 		break;
 
-- 
2.11.0

  reply	other threads:[~2018-10-11 16:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11 16:28 [RFC PATCH 0/4] Initial prototype of DAPM sample rate domains Charles Keepax
2018-10-11 16:28 ` Charles Keepax [this message]
2018-10-19 12:26   ` Applied "ASoC: dapm: Add support for hw_free on CODEC to CODEC links" to the asoc tree Mark Brown
2018-10-19 12:34   ` Mark Brown
2018-10-11 16:28 ` [RFC PATCH 2/4] ASoC: dapm: Add support for a rate domain widget Charles Keepax
2018-10-11 16:28 ` [RFC PATCH 3/4] ASoC: domain: Add sample rate domain support Charles Keepax
2018-10-11 16:28 ` [RFC PATCH 4/4] ASoC: arizona: Add " Charles Keepax
2018-10-22 14:27 ` [RFC PATCH 0/4] Initial prototype of DAPM sample rate domains Pierre-Louis Bossart
2018-10-23 14:36   ` Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181011162831.26351-2-ckeepax@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=patches@opensource.cirrus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox