All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
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 16/16] ASoC: soc-core: remove DAI suspend/resume
Date: 14 Jan 2020 10:33:14 +0900	[thread overview]
Message-ID: <87sgkig6ud.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87ftgihlic.wl-kuninori.morimoto.gx@renesas.com>


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

Historically, CPU and Codec were implemented different, but now it is
merged as Component.
ALSA SoC is supporting suspend/resume at DAI and Component level.
The method is like below.

	1) Suspend/Resume all CPU DAI if bus-control was 0
	2) Suspend/Resume all Component
	3) Suspend/Resume all CPU DAI if bus-control was 1

Historically 2) was Codec special operation.
Because CPU and Codec were merged into Component,
CPU   has 3 chance to suspend/resume(= 1/2/3), but
Codec has 1 chance to suspend/resume(= 2).

Here, 1) 2) are caring bus-control, but no driver
which is supporting suspend/resume has bus-control.
This means 3) is never used.

Here, used parameter for suspend/resume component->dev and dai->dev are
same pointer.
For these reason, we can merge DAI and Component suspend/resume.
One note is that we should use 2), because it is caring BIAS level.

This patch removes 1) and 3).

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc-dai.h |  2 --
 sound/soc/soc-core.c    | 41 -----------------------------------------
 sound/soc/soc-dai.c     | 12 ------------
 3 files changed, 55 deletions(-)

diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 939c73d..2ccecf3 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -286,8 +286,6 @@ struct snd_soc_dai_driver {
 	/* DAI driver callbacks */
 	int (*probe)(struct snd_soc_dai *dai);
 	int (*remove)(struct snd_soc_dai *dai);
-	int (*suspend)(struct snd_soc_dai *dai);
-	int (*resume)(struct snd_soc_dai *dai);
 	/* compress dai */
 	int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num);
 	/* Optional Callback used at pcm creation*/
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index acf6f14..b0ec323 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -558,16 +558,6 @@ int snd_soc_suspend(struct device *dev)
 	if (card->suspend_pre)
 		card->suspend_pre(card);
 
-	for_each_card_rtds(card, rtd) {
-		struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-
-		if (rtd->dai_link->ignore_suspend)
-			continue;
-
-		if (!cpu_dai->driver->bus_control)
-			snd_soc_dai_suspend(cpu_dai);
-	}
-
 	/* close any waiting streams */
 	snd_soc_flush_all_delayed_work(card);
 
@@ -639,16 +629,6 @@ int snd_soc_suspend(struct device *dev)
 		}
 	}
 
-	for_each_card_rtds(card, rtd) {
-		struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-
-		if (rtd->dai_link->ignore_suspend)
-			continue;
-
-		if (cpu_dai->driver->bus_control)
-			snd_soc_dai_suspend(cpu_dai);
-	}
-
 	if (card->suspend_post)
 		card->suspend_post(card);
 
@@ -682,17 +662,6 @@ static void soc_resume_deferred(struct work_struct *work)
 	if (card->resume_pre)
 		card->resume_pre(card);
 
-	/* resume control bus DAIs */
-	for_each_card_rtds(card, rtd) {
-		struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-
-		if (rtd->dai_link->ignore_suspend)
-			continue;
-
-		if (cpu_dai->driver->bus_control)
-			snd_soc_dai_resume(cpu_dai);
-	}
-
 	for_each_card_components(card, component) {
 		if (snd_soc_component_is_suspended(component))
 			snd_soc_component_resume(component);
@@ -726,16 +695,6 @@ static void soc_resume_deferred(struct work_struct *work)
 		}
 	}
 
-	for_each_card_rtds(card, rtd) {
-		struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
-
-		if (rtd->dai_link->ignore_suspend)
-			continue;
-
-		if (!cpu_dai->driver->bus_control)
-			snd_soc_dai_resume(cpu_dai);
-	}
-
 	if (card->resume_post)
 		card->resume_post(card);
 
diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c
index 1c7f638..51031e33 100644
--- a/sound/soc/soc-dai.c
+++ b/sound/soc/soc-dai.c
@@ -354,18 +354,6 @@ snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai,
 	return delay;
 }
 
-void snd_soc_dai_suspend(struct snd_soc_dai *dai)
-{
-	if (dai->driver->suspend)
-		dai->driver->suspend(dai);
-}
-
-void snd_soc_dai_resume(struct snd_soc_dai *dai)
-{
-	if (dai->driver->resume)
-		dai->driver->resume(dai);
-}
-
 int snd_soc_dai_probe(struct snd_soc_dai *dai)
 {
 	if (dai->driver->probe)
-- 
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:[~2020-01-14 13:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14  1:31 [alsa-devel] [PATCH 00/16] ASoC: remove DAI suspend/resume Kuninori Morimoto
2020-01-14  1:31 ` [alsa-devel] [PATCH 01/16] ASoC: atmel: atmel_ssc_dai: move .suspend/.resume to component Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:31 ` [alsa-devel] [PATCH 02/16] ASoC: bcm: cygnus-ssp: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:31 ` [alsa-devel] [PATCH 03/16] ASoC: cirrus: ep93xx-i2s: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:31 ` [alsa-devel] [PATCH 04/16] ASoC: jz4740: jz4740-i2s: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 05/16] ASoC: mediatek: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 06/16] ASoC: samsung: s3c24xx-i2s: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 07/16] ASoC: samsung: spdif: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 08/16] ASoC: sti: sti_uniperif: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 09/16] ASoC: ti: omap-mcpdm: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 10/16] ASoC: uniphier: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 11/16] ASoC: dwc: dwc-i2s: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 12/16] ASoC: samsung: i2s: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 13/16] ASoC: ux500: ux500_msp_dai: remove unused DAI .suspend/.resume Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 14/16] ASoC: pxa: pxa-ssp: move .suspend/.resume to component Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:32 ` [alsa-devel] [PATCH 15/16] ASoC: pxa: pxa2xx-i2s: " Kuninori Morimoto, Kuninori Morimoto
2020-01-14  1:33 ` Kuninori Morimoto, Kuninori Morimoto [this message]
2020-01-14  6:51 ` [alsa-devel] [PATCH 17/16] ASoC: soc-core: remove bus_control Kuninori Morimoto
2020-01-14  8:10   ` Kuninori Morimoto
2020-01-14 15:13     ` Mark Brown

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=87sgkig6ud.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.