All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [alsa-devel] [PATCH v3 3/8] ASoC: soc-core: care .ignore_suspend for Component suspend
Date: 19 Dec 2019 16:46:29 +0900	[thread overview]
Message-ID: <87eex0zrje.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87immczrkk.wl-kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Card dai_link has .ignore_suspend, and ALSA SoC cares it when suspend.
For example, like this

	for_each_card_rtds(card, rtd) {
		if (rtd->dai_link->ignore_suspend)
			continue;
		...
	}

But in snd_soc_suspend(), it doesn't care about
it when suspending Component. This patch cares it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-core.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 2709c28..fc60022 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -562,15 +562,25 @@ int snd_soc_suspend(struct device *dev)
 	snd_soc_dapm_sync(&card->dapm);
 
 	/* suspend all COMPONENTs */
-	for_each_card_components(card, component) {
-		struct snd_soc_dapm_context *dapm =
+	for_each_card_rtds(card, rtd) {
+
+		if (rtd->dai_link->ignore_suspend)
+			continue;
+
+		for_each_rtd_components(rtd, i, component) {
+			struct snd_soc_dapm_context *dapm =
 				snd_soc_component_get_dapm(component);
 
-		/*
-		 * If there are paths active then the COMPONENT will be held
-		 * with bias _ON and should not be suspended.
-		 */
-		if (!snd_soc_component_is_suspended(component)) {
+			/*
+			 * ignore if component was already suspended
+			 */
+			if (snd_soc_component_is_suspended(component))
+				continue;
+
+			/*
+			 * If there are paths active then the COMPONENT will be
+			 * held with bias _ON and should not be suspended.
+			 */
 			switch (snd_soc_dapm_get_bias_level(dapm)) {
 			case SND_SOC_BIAS_STANDBY:
 				/*
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2019-12-19  7:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19  7:45 [alsa-devel] [PATCH v3 0/8] ASoC: soc-core cleanup step8 Kuninori Morimoto
2019-12-19  7:46 ` [alsa-devel] [PATCH v3 1/8] ASoC: soc-core: remove snd_soc_rtdcom_list Kuninori Morimoto
2019-12-19  7:46 ` [alsa-devel] [PATCH v3 2/8] ASoC: soc-core: rename snd_soc_rtdcom_add() to snd_soc_rtd_add_component() Kuninori Morimoto
2019-12-19  7:46 ` Kuninori Morimoto [this message]
2019-12-19  7:46 ` [alsa-devel] [PATCH v3 4/8] ASoC: soc-core: remove duplicate pinctrl operation when suspend Kuninori Morimoto
2019-12-19  7:46 ` [alsa-devel] [PATCH v3 5/8] ASoC: soc-core: do pinctrl_pm_select_xxx() as component Kuninori Morimoto
2019-12-19  7:46 ` [alsa-devel] [PATCH v3 6/8] ASoC: soc-core: add snd_soc_close_delayed_work() Kuninori Morimoto
2019-12-19  7:46 ` [alsa-devel] [PATCH v3 7/8] ASoC: soc-dapm: add snd_soc_dapm_stream_stop() Kuninori Morimoto
2019-12-19  7:47 ` [alsa-devel] [PATCH v3 8/8] ASoC: use snd_soc_dapm_stream_stop() for SND_SOC_DAPM_STREAM_STOP Kuninori Morimoto

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=87eex0zrje.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.