All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: Remove snd_soc_platform_driver suspend/resume callbacks
@ 2014-11-03  9:31 Lars-Peter Clausen
  2014-11-03  9:31 ` [PATCH 2/2] ASoC: Remove platform field from snd_soc_dai Lars-Peter Clausen
  2014-11-03 12:17 ` [PATCH 1/2] ASoC: Remove snd_soc_platform_driver suspend/resume callbacks Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2014-11-03  9:31 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Lars-Peter Clausen

Those are unused and new drivers should use device driver suspend/resume.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 include/sound/soc.h  |  4 ----
 sound/soc/soc-core.c | 10 ----------
 2 files changed, 14 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index ad47e96..edbb07b 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -857,8 +857,6 @@ struct snd_soc_platform_driver {
 
 	int (*probe)(struct snd_soc_platform *);
 	int (*remove)(struct snd_soc_platform *);
-	int (*suspend)(struct snd_soc_dai *dai);
-	int (*resume)(struct snd_soc_dai *dai);
 	struct snd_soc_component_driver component_driver;
 
 	/* pcm creation and destruction */
@@ -891,8 +889,6 @@ struct snd_soc_platform {
 	struct device *dev;
 	const struct snd_soc_platform_driver *driver;
 
-	unsigned int suspended:1; /* platform is suspended */
-
 	struct list_head list;
 
 	struct snd_soc_component component;
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index dd8234d..00e944e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -592,17 +592,12 @@ int snd_soc_suspend(struct device *dev)
 
 	for (i = 0; i < card->num_rtd; i++) {
 		struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai;
-		struct snd_soc_platform *platform = card->rtd[i].platform;
 
 		if (card->rtd[i].dai_link->ignore_suspend)
 			continue;
 
 		if (cpu_dai->driver->suspend && !cpu_dai->driver->ac97_control)
 			cpu_dai->driver->suspend(cpu_dai);
-		if (platform->driver->suspend && !platform->suspended) {
-			platform->driver->suspend(cpu_dai);
-			platform->suspended = 1;
-		}
 	}
 
 	/* close any waiting streams and save state */
@@ -775,17 +770,12 @@ static void soc_resume_deferred(struct work_struct *work)
 
 	for (i = 0; i < card->num_rtd; i++) {
 		struct snd_soc_dai *cpu_dai = card->rtd[i].cpu_dai;
-		struct snd_soc_platform *platform = card->rtd[i].platform;
 
 		if (card->rtd[i].dai_link->ignore_suspend)
 			continue;
 
 		if (cpu_dai->driver->resume && !cpu_dai->driver->ac97_control)
 			cpu_dai->driver->resume(cpu_dai);
-		if (platform->driver->resume && platform->suspended) {
-			platform->driver->resume(cpu_dai);
-			platform->suspended = 0;
-		}
 	}
 
 	if (card->resume_post)
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] ASoC: Remove platform field from snd_soc_dai
  2014-11-03  9:31 [PATCH 1/2] ASoC: Remove snd_soc_platform_driver suspend/resume callbacks Lars-Peter Clausen
@ 2014-11-03  9:31 ` Lars-Peter Clausen
  2014-11-03 12:17 ` [PATCH 1/2] ASoC: Remove snd_soc_platform_driver suspend/resume callbacks Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2014-11-03  9:31 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, Lars-Peter Clausen

Typically a DAI does not need direct access to the platform. Currently the
only user of this field is in a platform driver where we have a more direct
way of getting a pointer to the platform. This patch updates the driver to
use the more direct way and then removes the platform field from the
snd_soc_dai struct.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 include/sound/soc-dai.h   | 1 -
 sound/soc/soc-core.c      | 2 --
 sound/soc/txx9/txx9aclc.c | 2 +-
 3 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index e8b3080..45d0fa1 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -268,7 +268,6 @@ struct snd_soc_dai {
 	unsigned int sample_bits;
 
 	/* parent platform/codec */
-	struct snd_soc_platform *platform;
 	struct snd_soc_codec *codec;
 	struct snd_soc_component *component;
 
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 00e944e..3818cf3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1309,7 +1309,6 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
 {
 	struct snd_soc_dai_link *dai_link = &card->dai_link[num];
 	struct snd_soc_pcm_runtime *rtd = &card->rtd[num];
-	struct snd_soc_platform *platform = rtd->platform;
 	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	int i, ret;
 
@@ -1317,7 +1316,6 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
 			card->name, num, order);
 
 	/* config components */
-	cpu_dai->platform = platform;
 	cpu_dai->card = card;
 	for (i = 0; i < rtd->num_codecs; i++)
 		rtd->codec_dais[i]->card = card;
diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c
index cd71fd8..00b7e2d 100644
--- a/sound/soc/txx9/txx9aclc.c
+++ b/sound/soc/txx9/txx9aclc.c
@@ -292,7 +292,7 @@ static int txx9aclc_pcm_new(struct snd_soc_pcm_runtime *rtd)
 	struct snd_card *card = rtd->card->snd_card;
 	struct snd_soc_dai *dai = rtd->cpu_dai;
 	struct snd_pcm *pcm = rtd->pcm;
-	struct platform_device *pdev = to_platform_device(dai->platform->dev);
+	struct platform_device *pdev = to_platform_device(rtd->platform->dev);
 	struct txx9aclc_soc_device *dev;
 	struct resource *r;
 	int i;
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] ASoC: Remove snd_soc_platform_driver suspend/resume callbacks
  2014-11-03  9:31 [PATCH 1/2] ASoC: Remove snd_soc_platform_driver suspend/resume callbacks Lars-Peter Clausen
  2014-11-03  9:31 ` [PATCH 2/2] ASoC: Remove platform field from snd_soc_dai Lars-Peter Clausen
@ 2014-11-03 12:17 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-11-03 12:17 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 167 bytes --]

On Mon, Nov 03, 2014 at 10:31:47AM +0100, Lars-Peter Clausen wrote:
> Those are unused and new drivers should use device driver suspend/resume.

Applied both, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-03 12:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-03  9:31 [PATCH 1/2] ASoC: Remove snd_soc_platform_driver suspend/resume callbacks Lars-Peter Clausen
2014-11-03  9:31 ` [PATCH 2/2] ASoC: Remove platform field from snd_soc_dai Lars-Peter Clausen
2014-11-03 12:17 ` [PATCH 1/2] ASoC: Remove snd_soc_platform_driver suspend/resume callbacks Mark Brown

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.