alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx()
@ 2020-01-22  0:44 Kuninori Morimoto
  2020-01-22  0:44 ` [alsa-devel] [PATCH 1/7] ASoC: soc-pcm: add soc_rtd_startup() Kuninori Morimoto
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Kuninori Morimoto @ 2020-01-22  0:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


Hi Mark

My ALSA SoC cleanup series focus to soc-pcm as 2nd step :)
These create new soc_rtd_xxx() function, and cleanup soc-pcm.c
(It will be more cleanup later)

Kuninori Morimoto (7):
  ASoC: soc-pcm: add soc_rtd_startup()
  ASoC: soc-pcm: add soc_rtd_shutdown()
  ASoC: soc-pcm: add soc_rtd_prepare()
  ASoC: soc-pcm: add soc_rtd_hw_params()
  ASoC: soc-pcm: add soc_rtd_hw_free()
  ASoC: soc-pcm: add soc_rtd_trigger()
  ASoC: soc-core: remove null_snd_soc_ops

 sound/soc/soc-core.c |   4 --
 sound/soc/soc-pcm.c  | 118 ++++++++++++++++++++++++++++++++++-----------------
 2 files changed, 79 insertions(+), 43 deletions(-)

-- 
2.7.4

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

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

* [alsa-devel] [PATCH 1/7] ASoC: soc-pcm: add soc_rtd_startup()
  2020-01-22  0:44 [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Kuninori Morimoto
@ 2020-01-22  0:44 ` Kuninori Morimoto
  2020-01-23 12:36   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_startup()" to the asoc tree Mark Brown
  2020-01-22  0:44 ` [alsa-devel] [PATCH 2/7] ASoC: soc-pcm: add soc_rtd_shutdown() Kuninori Morimoto
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2020-01-22  0:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


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

Add soc_rtd_startup() to make the code easier to read

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

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 74d340d..c001829 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -28,6 +28,15 @@
 
 #define DPCM_MAX_BE_USERS	8
 
+static int soc_rtd_startup(struct snd_soc_pcm_runtime *rtd,
+			   struct snd_pcm_substream *substream)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->startup)
+		return rtd->dai_link->ops->startup(substream);
+	return 0;
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -522,13 +531,11 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
 			codec_dai->rx_mask = 0;
 	}
 
-	if (rtd->dai_link->ops->startup) {
-		ret = rtd->dai_link->ops->startup(substream);
-		if (ret < 0) {
-			pr_err("ASoC: %s startup failed: %d\n",
-			       rtd->dai_link->name, ret);
-			goto machine_err;
-		}
+	ret = soc_rtd_startup(rtd, substream);
+	if (ret < 0) {
+		pr_err("ASoC: %s startup failed: %d\n",
+		       rtd->dai_link->name, ret);
+		goto machine_err;
 	}
 
 	/* Dynamic PCM DAI links compat checks use dynamic capabilities */
-- 
2.7.4

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

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

* [alsa-devel] [PATCH 2/7] ASoC: soc-pcm: add soc_rtd_shutdown()
  2020-01-22  0:44 [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Kuninori Morimoto
  2020-01-22  0:44 ` [alsa-devel] [PATCH 1/7] ASoC: soc-pcm: add soc_rtd_startup() Kuninori Morimoto
@ 2020-01-22  0:44 ` Kuninori Morimoto
  2020-01-23 12:36   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_shutdown()" to the asoc tree Mark Brown
  2020-01-22  0:44 ` [alsa-devel] [PATCH 3/7] ASoC: soc-pcm: add soc_rtd_prepare() Kuninori Morimoto
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2020-01-22  0:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


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

Add soc_rtd_shutdown() to make the code easier to read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-pcm.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index c001829..8095c64 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -37,6 +37,14 @@ static int soc_rtd_startup(struct snd_soc_pcm_runtime *rtd,
 	return 0;
 }
 
+static void soc_rtd_shutdown(struct snd_soc_pcm_runtime *rtd,
+			     struct snd_pcm_substream *substream)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->shutdown)
+		rtd->dai_link->ops->shutdown(substream);
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -602,8 +610,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
 	return 0;
 
 config_err:
-	if (rtd->dai_link->ops->shutdown)
-		rtd->dai_link->ops->shutdown(substream);
+	soc_rtd_shutdown(rtd, substream);
 
 machine_err:
 	i = rtd->num_codecs;
@@ -674,8 +681,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
 	for_each_rtd_codec_dai(rtd, i, codec_dai)
 		snd_soc_dai_shutdown(codec_dai, substream);
 
-	if (rtd->dai_link->ops->shutdown)
-		rtd->dai_link->ops->shutdown(substream);
+	soc_rtd_shutdown(rtd, substream);
 
 	soc_pcm_components_close(substream, NULL);
 
-- 
2.7.4

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

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

* [alsa-devel] [PATCH 3/7] ASoC: soc-pcm: add soc_rtd_prepare()
  2020-01-22  0:44 [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Kuninori Morimoto
  2020-01-22  0:44 ` [alsa-devel] [PATCH 1/7] ASoC: soc-pcm: add soc_rtd_startup() Kuninori Morimoto
  2020-01-22  0:44 ` [alsa-devel] [PATCH 2/7] ASoC: soc-pcm: add soc_rtd_shutdown() Kuninori Morimoto
@ 2020-01-22  0:44 ` Kuninori Morimoto
  2020-01-23 12:36   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_prepare()" to the asoc tree Mark Brown
  2020-01-22  0:44 ` [alsa-devel] [PATCH 4/7] ASoC: soc-pcm: add soc_rtd_hw_params() Kuninori Morimoto
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2020-01-22  0:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


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

Add soc_rtd_prepare() to make the code easier to read

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

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8095c64..ccd6c9c 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -45,6 +45,15 @@ static void soc_rtd_shutdown(struct snd_soc_pcm_runtime *rtd,
 		rtd->dai_link->ops->shutdown(substream);
 }
 
+static int soc_rtd_prepare(struct snd_soc_pcm_runtime *rtd,
+			   struct snd_pcm_substream *substream)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->prepare)
+		return rtd->dai_link->ops->prepare(substream);
+	return 0;
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -716,13 +725,11 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
 
 	mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
 
-	if (rtd->dai_link->ops->prepare) {
-		ret = rtd->dai_link->ops->prepare(substream);
-		if (ret < 0) {
-			dev_err(rtd->card->dev, "ASoC: machine prepare error:"
-				" %d\n", ret);
-			goto out;
-		}
+	ret = soc_rtd_prepare(rtd, substream);
+	if (ret < 0) {
+		dev_err(rtd->card->dev,
+			"ASoC: machine prepare error: %d\n", ret);
+		goto out;
 	}
 
 	for_each_rtd_components(rtd, i, component) {
-- 
2.7.4

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

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

* [alsa-devel] [PATCH 4/7] ASoC: soc-pcm: add soc_rtd_hw_params()
  2020-01-22  0:44 [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2020-01-22  0:44 ` [alsa-devel] [PATCH 3/7] ASoC: soc-pcm: add soc_rtd_prepare() Kuninori Morimoto
@ 2020-01-22  0:44 ` Kuninori Morimoto
  2020-01-23 12:36   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_hw_params()" to the asoc tree Mark Brown
  2020-01-22  0:44 ` [alsa-devel] [PATCH 5/7] ASoC: soc-pcm: add soc_rtd_hw_free() Kuninori Morimoto
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2020-01-22  0:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


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

Add soc_rtd_hw_params() to make the code easier to read

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

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index ccd6c9c..d7fc6c5 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -54,6 +54,16 @@ static int soc_rtd_prepare(struct snd_soc_pcm_runtime *rtd,
 	return 0;
 }
 
+static int soc_rtd_hw_params(struct snd_soc_pcm_runtime *rtd,
+			     struct snd_pcm_substream *substream,
+			     struct snd_pcm_hw_params *params)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->hw_params)
+		return rtd->dai_link->ops->hw_params(substream, params);
+	return 0;
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -826,13 +836,11 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
 	if (ret)
 		goto out;
 
-	if (rtd->dai_link->ops->hw_params) {
-		ret = rtd->dai_link->ops->hw_params(substream, params);
-		if (ret < 0) {
-			dev_err(rtd->card->dev, "ASoC: machine hw_params"
-				" failed: %d\n", ret);
-			goto out;
-		}
+	ret = soc_rtd_hw_params(rtd, substream, params);
+	if (ret < 0) {
+		dev_err(rtd->card->dev,
+			"ASoC: machine hw_params failed: %d\n", ret);
+		goto out;
 	}
 
 	for_each_rtd_codec_dai(rtd, i, codec_dai) {
-- 
2.7.4

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

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

* [alsa-devel] [PATCH 5/7] ASoC: soc-pcm: add soc_rtd_hw_free()
  2020-01-22  0:44 [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Kuninori Morimoto
                   ` (3 preceding siblings ...)
  2020-01-22  0:44 ` [alsa-devel] [PATCH 4/7] ASoC: soc-pcm: add soc_rtd_hw_params() Kuninori Morimoto
@ 2020-01-22  0:44 ` Kuninori Morimoto
  2020-01-23 12:35   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_hw_free()" to the asoc tree Mark Brown
  2020-01-22  0:44 ` [alsa-devel] [PATCH 6/7] ASoC: soc-pcm: add soc_rtd_trigger() Kuninori Morimoto
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2020-01-22  0:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


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

Add soc_rtd_hw_free() to make the code easier to read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-pcm.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index d7fc6c5..718749f 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -64,6 +64,14 @@ static int soc_rtd_hw_params(struct snd_soc_pcm_runtime *rtd,
 	return 0;
 }
 
+static void soc_rtd_hw_free(struct snd_soc_pcm_runtime *rtd,
+			    struct snd_pcm_substream *substream)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->hw_free)
+		rtd->dai_link->ops->hw_free(substream);
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -935,8 +943,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
 		codec_dai->rate = 0;
 	}
 
-	if (rtd->dai_link->ops->hw_free)
-		rtd->dai_link->ops->hw_free(substream);
+	soc_rtd_hw_free(rtd, substream);
 
 	mutex_unlock(&rtd->card->pcm_mutex);
 	return ret;
@@ -979,8 +986,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
 	}
 
 	/* free any machine hw params */
-	if (rtd->dai_link->ops->hw_free)
-		rtd->dai_link->ops->hw_free(substream);
+	soc_rtd_hw_free(rtd, substream);
 
 	/* free any component resources */
 	soc_pcm_components_hw_free(substream, NULL);
-- 
2.7.4

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

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

* [alsa-devel] [PATCH 6/7] ASoC: soc-pcm: add soc_rtd_trigger()
  2020-01-22  0:44 [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Kuninori Morimoto
                   ` (4 preceding siblings ...)
  2020-01-22  0:44 ` [alsa-devel] [PATCH 5/7] ASoC: soc-pcm: add soc_rtd_hw_free() Kuninori Morimoto
@ 2020-01-22  0:44 ` Kuninori Morimoto
  2020-01-23 12:35   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_trigger()" to the asoc tree Mark Brown
  2020-01-22  0:45 ` [alsa-devel] [PATCH 7/7] ASoC: soc-core: remove null_snd_soc_ops Kuninori Morimoto
  2020-01-22  4:30 ` [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Sridharan, Ranjani
  7 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2020-01-22  0:44 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


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

Add soc_rtd_trigger() to make the code easier to read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-pcm.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 718749f..e66ac9c 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -72,6 +72,16 @@ static void soc_rtd_hw_free(struct snd_soc_pcm_runtime *rtd,
 		rtd->dai_link->ops->hw_free(substream);
 }
 
+static int soc_rtd_trigger(struct snd_soc_pcm_runtime *rtd,
+			   struct snd_pcm_substream *substream,
+			   int cmd)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->trigger)
+		return rtd->dai_link->ops->trigger(substream, cmd);
+	return 0;
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -1013,11 +1023,9 @@ static int soc_pcm_trigger_start(struct snd_pcm_substream *substream, int cmd)
 	struct snd_soc_dai *codec_dai;
 	int i, ret;
 
-	if (rtd->dai_link->ops->trigger) {
-		ret = rtd->dai_link->ops->trigger(substream, cmd);
-		if (ret < 0)
-			return ret;
-	}
+	ret = soc_rtd_trigger(rtd, substream, cmd);
+	if (ret < 0)
+		return ret;
 
 	for_each_rtd_components(rtd, i, component) {
 		ret = snd_soc_component_trigger(component, substream, cmd);
@@ -1062,11 +1070,9 @@ static int soc_pcm_trigger_stop(struct snd_pcm_substream *substream, int cmd)
 			return ret;
 	}
 
-	if (rtd->dai_link->ops->trigger) {
-		ret = rtd->dai_link->ops->trigger(substream, cmd);
-		if (ret < 0)
-			return ret;
-	}
+	ret = soc_rtd_trigger(rtd, substream, cmd);
+	if (ret < 0)
+		return ret;
 
 	return 0;
 }
-- 
2.7.4

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

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

* [alsa-devel] [PATCH 7/7] ASoC: soc-core: remove null_snd_soc_ops
  2020-01-22  0:44 [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Kuninori Morimoto
                   ` (5 preceding siblings ...)
  2020-01-22  0:44 ` [alsa-devel] [PATCH 6/7] ASoC: soc-pcm: add soc_rtd_trigger() Kuninori Morimoto
@ 2020-01-22  0:45 ` Kuninori Morimoto
  2020-01-23 12:35   ` [alsa-devel] Applied "ASoC: soc-core: remove null_snd_soc_ops" to the asoc tree Mark Brown
  2020-01-22  4:30 ` [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Sridharan, Ranjani
  7 siblings, 1 reply; 17+ messages in thread
From: Kuninori Morimoto @ 2020-01-22  0:45 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


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

All rtd->dai_link callback functions are controlled by soc_rtd_xxxx(),
and checking rtd->dai_link->ops.
We don't need to have null_snd_soc_ops anymore.
This patch removes it.

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

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f969a3b..068d809 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -342,8 +342,6 @@ struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(snd_soc_lookup_component);
 
-static const struct snd_soc_ops null_snd_soc_ops;
-
 struct snd_soc_pcm_runtime
 *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
 			 struct snd_soc_dai_link *dai_link)
@@ -488,8 +486,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
 	 */
 	rtd->card = card;
 	rtd->dai_link = dai_link;
-	if (!rtd->dai_link->ops)
-		rtd->dai_link->ops = &null_snd_soc_ops;
 
 	/* see for_each_card_rtds */
 	list_add_tail(&rtd->list, &card->rtd_list);
-- 
2.7.4

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

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

* Re: [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx()
  2020-01-22  0:44 [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Kuninori Morimoto
                   ` (6 preceding siblings ...)
  2020-01-22  0:45 ` [alsa-devel] [PATCH 7/7] ASoC: soc-core: remove null_snd_soc_ops Kuninori Morimoto
@ 2020-01-22  4:30 ` Sridharan, Ranjani
  2020-01-22 10:42   ` Pierre-Louis Bossart
  7 siblings, 1 reply; 17+ messages in thread
From: Sridharan, Ranjani @ 2020-01-22  4:30 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

On Tue, Jan 21, 2020 at 4:46 PM Kuninori Morimoto <
kuninori.morimoto.gx@renesas.com> wrote:

>
> Hi Mark
>
> My ALSA SoC cleanup series focus to soc-pcm as 2nd step :)
> These create new soc_rtd_xxx() function, and cleanup soc-pcm.c
> (It will be more cleanup later)
>
> Kuninori Morimoto (7):
>   ASoC: soc-pcm: add soc_rtd_startup()
>   ASoC: soc-pcm: add soc_rtd_shutdown()
>   ASoC: soc-pcm: add soc_rtd_prepare()
>   ASoC: soc-pcm: add soc_rtd_hw_params()
>   ASoC: soc-pcm: add soc_rtd_hw_free()
>   ASoC: soc-pcm: add soc_rtd_trigger()
>   ASoC: soc-core: remove null_snd_soc_ops

The series looks good. Thanks, Morimoto-san.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx()
  2020-01-22  4:30 ` [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Sridharan, Ranjani
@ 2020-01-22 10:42   ` Pierre-Louis Bossart
  0 siblings, 0 replies; 17+ messages in thread
From: Pierre-Louis Bossart @ 2020-01-22 10:42 UTC (permalink / raw)
  To: Sridharan, Ranjani, Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown


>> My ALSA SoC cleanup series focus to soc-pcm as 2nd step :)
>> These create new soc_rtd_xxx() function, and cleanup soc-pcm.c
>> (It will be more cleanup later)
>>
>> Kuninori Morimoto (7):
>>    ASoC: soc-pcm: add soc_rtd_startup()
>>    ASoC: soc-pcm: add soc_rtd_shutdown()
>>    ASoC: soc-pcm: add soc_rtd_prepare()
>>    ASoC: soc-pcm: add soc_rtd_hw_params()
>>    ASoC: soc-pcm: add soc_rtd_hw_free()
>>    ASoC: soc-pcm: add soc_rtd_trigger()
>>    ASoC: soc-core: remove null_snd_soc_ops
> 
> The series looks good. Thanks, Morimoto-san.
> 
> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

LGTM as well.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* [alsa-devel] Applied "ASoC: soc-core: remove null_snd_soc_ops" to the asoc tree
  2020-01-22  0:45 ` [alsa-devel] [PATCH 7/7] ASoC: soc-core: remove null_snd_soc_ops Kuninori Morimoto
@ 2020-01-23 12:35   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-01-23 12:35 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

The patch

   ASoC: soc-core: remove null_snd_soc_ops

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From d8e2e0d2491e78f3f7b451c3a93ba29950efe2cf Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 22 Jan 2020 09:45:00 +0900
Subject: [PATCH] ASoC: soc-core: remove null_snd_soc_ops

All rtd->dai_link callback functions are controlled by soc_rtd_xxxx(),
and checking rtd->dai_link->ops.
We don't need to have null_snd_soc_ops anymore.
This patch removes it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87zhegl3oz.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f969a3b8c82b..068d809c349a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -342,8 +342,6 @@ struct snd_soc_component *snd_soc_lookup_component(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(snd_soc_lookup_component);
 
-static const struct snd_soc_ops null_snd_soc_ops;
-
 struct snd_soc_pcm_runtime
 *snd_soc_get_pcm_runtime(struct snd_soc_card *card,
 			 struct snd_soc_dai_link *dai_link)
@@ -488,8 +486,6 @@ static struct snd_soc_pcm_runtime *soc_new_pcm_runtime(
 	 */
 	rtd->card = card;
 	rtd->dai_link = dai_link;
-	if (!rtd->dai_link->ops)
-		rtd->dai_link->ops = &null_snd_soc_ops;
 
 	/* see for_each_card_rtds */
 	list_add_tail(&rtd->list, &card->rtd_list);
-- 
2.20.1

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

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

* [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_trigger()" to the asoc tree
  2020-01-22  0:44 ` [alsa-devel] [PATCH 6/7] ASoC: soc-pcm: add soc_rtd_trigger() Kuninori Morimoto
@ 2020-01-23 12:35   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-01-23 12:35 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

The patch

   ASoC: soc-pcm: add soc_rtd_trigger()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From ad2bf9f252d667b385df606b4b762c26151bee78 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 22 Jan 2020 09:44:56 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_trigger()

Add soc_rtd_trigger() to make the code easier to read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/871rrsmi9j.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-pcm.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 718749f12979..e66ac9ce321b 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -72,6 +72,16 @@ static void soc_rtd_hw_free(struct snd_soc_pcm_runtime *rtd,
 		rtd->dai_link->ops->hw_free(substream);
 }
 
+static int soc_rtd_trigger(struct snd_soc_pcm_runtime *rtd,
+			   struct snd_pcm_substream *substream,
+			   int cmd)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->trigger)
+		return rtd->dai_link->ops->trigger(substream, cmd);
+	return 0;
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -1013,11 +1023,9 @@ static int soc_pcm_trigger_start(struct snd_pcm_substream *substream, int cmd)
 	struct snd_soc_dai *codec_dai;
 	int i, ret;
 
-	if (rtd->dai_link->ops->trigger) {
-		ret = rtd->dai_link->ops->trigger(substream, cmd);
-		if (ret < 0)
-			return ret;
-	}
+	ret = soc_rtd_trigger(rtd, substream, cmd);
+	if (ret < 0)
+		return ret;
 
 	for_each_rtd_components(rtd, i, component) {
 		ret = snd_soc_component_trigger(component, substream, cmd);
@@ -1062,11 +1070,9 @@ static int soc_pcm_trigger_stop(struct snd_pcm_substream *substream, int cmd)
 			return ret;
 	}
 
-	if (rtd->dai_link->ops->trigger) {
-		ret = rtd->dai_link->ops->trigger(substream, cmd);
-		if (ret < 0)
-			return ret;
-	}
+	ret = soc_rtd_trigger(rtd, substream, cmd);
+	if (ret < 0)
+		return ret;
 
 	return 0;
 }
-- 
2.20.1

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

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

* [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_hw_free()" to the asoc tree
  2020-01-22  0:44 ` [alsa-devel] [PATCH 5/7] ASoC: soc-pcm: add soc_rtd_hw_free() Kuninori Morimoto
@ 2020-01-23 12:35   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-01-23 12:35 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

The patch

   ASoC: soc-pcm: add soc_rtd_hw_free()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 49f020e5714d2c48c8ed9a89169ef6a058e54c2f Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 22 Jan 2020 09:44:52 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_hw_free()

Add soc_rtd_hw_free() to make the code easier to read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/8736c8mi9n.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-pcm.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index d7fc6c5d7906..718749f12979 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -64,6 +64,14 @@ static int soc_rtd_hw_params(struct snd_soc_pcm_runtime *rtd,
 	return 0;
 }
 
+static void soc_rtd_hw_free(struct snd_soc_pcm_runtime *rtd,
+			    struct snd_pcm_substream *substream)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->hw_free)
+		rtd->dai_link->ops->hw_free(substream);
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -935,8 +943,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
 		codec_dai->rate = 0;
 	}
 
-	if (rtd->dai_link->ops->hw_free)
-		rtd->dai_link->ops->hw_free(substream);
+	soc_rtd_hw_free(rtd, substream);
 
 	mutex_unlock(&rtd->card->pcm_mutex);
 	return ret;
@@ -979,8 +986,7 @@ static int soc_pcm_hw_free(struct snd_pcm_substream *substream)
 	}
 
 	/* free any machine hw params */
-	if (rtd->dai_link->ops->hw_free)
-		rtd->dai_link->ops->hw_free(substream);
+	soc_rtd_hw_free(rtd, substream);
 
 	/* free any component resources */
 	soc_pcm_components_hw_free(substream, NULL);
-- 
2.20.1

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

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

* [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_hw_params()" to the asoc tree
  2020-01-22  0:44 ` [alsa-devel] [PATCH 4/7] ASoC: soc-pcm: add soc_rtd_hw_params() Kuninori Morimoto
@ 2020-01-23 12:36   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-01-23 12:36 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

The patch

   ASoC: soc-pcm: add soc_rtd_hw_params()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From de9ad990284f16a435675e4e73c7ffaaea9ee4b2 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 22 Jan 2020 09:44:48 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_hw_params()

Add soc_rtd_hw_params() to make the code easier to read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/874kwomi9r.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-pcm.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index ccd6c9ca55ab..d7fc6c5d7906 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -54,6 +54,16 @@ static int soc_rtd_prepare(struct snd_soc_pcm_runtime *rtd,
 	return 0;
 }
 
+static int soc_rtd_hw_params(struct snd_soc_pcm_runtime *rtd,
+			     struct snd_pcm_substream *substream,
+			     struct snd_pcm_hw_params *params)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->hw_params)
+		return rtd->dai_link->ops->hw_params(substream, params);
+	return 0;
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -826,13 +836,11 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream,
 	if (ret)
 		goto out;
 
-	if (rtd->dai_link->ops->hw_params) {
-		ret = rtd->dai_link->ops->hw_params(substream, params);
-		if (ret < 0) {
-			dev_err(rtd->card->dev, "ASoC: machine hw_params"
-				" failed: %d\n", ret);
-			goto out;
-		}
+	ret = soc_rtd_hw_params(rtd, substream, params);
+	if (ret < 0) {
+		dev_err(rtd->card->dev,
+			"ASoC: machine hw_params failed: %d\n", ret);
+		goto out;
 	}
 
 	for_each_rtd_codec_dai(rtd, i, codec_dai) {
-- 
2.20.1

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

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

* [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_prepare()" to the asoc tree
  2020-01-22  0:44 ` [alsa-devel] [PATCH 3/7] ASoC: soc-pcm: add soc_rtd_prepare() Kuninori Morimoto
@ 2020-01-23 12:36   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-01-23 12:36 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

The patch

   ASoC: soc-pcm: add soc_rtd_prepare()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 44c1a75b0d889b3a5faff9edc837d972806bb46a Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 22 Jan 2020 09:44:44 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_prepare()

Add soc_rtd_prepare() to make the code easier to read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/875zh4mi9v.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-pcm.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8095c64c4e3e..ccd6c9ca55ab 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -45,6 +45,15 @@ static void soc_rtd_shutdown(struct snd_soc_pcm_runtime *rtd,
 		rtd->dai_link->ops->shutdown(substream);
 }
 
+static int soc_rtd_prepare(struct snd_soc_pcm_runtime *rtd,
+			   struct snd_pcm_substream *substream)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->prepare)
+		return rtd->dai_link->ops->prepare(substream);
+	return 0;
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -716,13 +725,11 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream)
 
 	mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
 
-	if (rtd->dai_link->ops->prepare) {
-		ret = rtd->dai_link->ops->prepare(substream);
-		if (ret < 0) {
-			dev_err(rtd->card->dev, "ASoC: machine prepare error:"
-				" %d\n", ret);
-			goto out;
-		}
+	ret = soc_rtd_prepare(rtd, substream);
+	if (ret < 0) {
+		dev_err(rtd->card->dev,
+			"ASoC: machine prepare error: %d\n", ret);
+		goto out;
 	}
 
 	for_each_rtd_components(rtd, i, component) {
-- 
2.20.1

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

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

* [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_shutdown()" to the asoc tree
  2020-01-22  0:44 ` [alsa-devel] [PATCH 2/7] ASoC: soc-pcm: add soc_rtd_shutdown() Kuninori Morimoto
@ 2020-01-23 12:36   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-01-23 12:36 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

The patch

   ASoC: soc-pcm: add soc_rtd_shutdown()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 0be429f9fcfccfbbbcdb40e154a5c2328da17ca9 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 22 Jan 2020 09:44:40 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_shutdown()

Add soc_rtd_shutdown() to make the code easier to read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e1kmi9z.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-pcm.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index c0018293c67b..8095c64c4e3e 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -37,6 +37,14 @@ static int soc_rtd_startup(struct snd_soc_pcm_runtime *rtd,
 	return 0;
 }
 
+static void soc_rtd_shutdown(struct snd_soc_pcm_runtime *rtd,
+			     struct snd_pcm_substream *substream)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->shutdown)
+		rtd->dai_link->ops->shutdown(substream);
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -602,8 +610,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
 	return 0;
 
 config_err:
-	if (rtd->dai_link->ops->shutdown)
-		rtd->dai_link->ops->shutdown(substream);
+	soc_rtd_shutdown(rtd, substream);
 
 machine_err:
 	i = rtd->num_codecs;
@@ -674,8 +681,7 @@ static int soc_pcm_close(struct snd_pcm_substream *substream)
 	for_each_rtd_codec_dai(rtd, i, codec_dai)
 		snd_soc_dai_shutdown(codec_dai, substream);
 
-	if (rtd->dai_link->ops->shutdown)
-		rtd->dai_link->ops->shutdown(substream);
+	soc_rtd_shutdown(rtd, substream);
 
 	soc_pcm_components_close(substream, NULL);
 
-- 
2.20.1

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

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

* [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_startup()" to the asoc tree
  2020-01-22  0:44 ` [alsa-devel] [PATCH 1/7] ASoC: soc-pcm: add soc_rtd_startup() Kuninori Morimoto
@ 2020-01-23 12:36   ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2020-01-23 12:36 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Mark Brown

The patch

   ASoC: soc-pcm: add soc_rtd_startup()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From f183f9277a0f16e340bbcb28bf30834652ef10e1 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 22 Jan 2020 09:44:35 +0900
Subject: [PATCH] ASoC: soc-pcm: add soc_rtd_startup()

Add soc_rtd_startup() to make the code easier to read

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/878sm0mia4.wl-kuninori.morimoto.gx@renesas.com
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-pcm.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 74d340d1c9f7..c0018293c67b 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -28,6 +28,15 @@
 
 #define DPCM_MAX_BE_USERS	8
 
+static int soc_rtd_startup(struct snd_soc_pcm_runtime *rtd,
+			   struct snd_pcm_substream *substream)
+{
+	if (rtd->dai_link->ops &&
+	    rtd->dai_link->ops->startup)
+		return rtd->dai_link->ops->startup(substream);
+	return 0;
+}
+
 /**
  * snd_soc_runtime_activate() - Increment active count for PCM runtime components
  * @rtd: ASoC PCM runtime that is activated
@@ -522,13 +531,11 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
 			codec_dai->rx_mask = 0;
 	}
 
-	if (rtd->dai_link->ops->startup) {
-		ret = rtd->dai_link->ops->startup(substream);
-		if (ret < 0) {
-			pr_err("ASoC: %s startup failed: %d\n",
-			       rtd->dai_link->name, ret);
-			goto machine_err;
-		}
+	ret = soc_rtd_startup(rtd, substream);
+	if (ret < 0) {
+		pr_err("ASoC: %s startup failed: %d\n",
+		       rtd->dai_link->name, ret);
+		goto machine_err;
 	}
 
 	/* Dynamic PCM DAI links compat checks use dynamic capabilities */
-- 
2.20.1

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

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

end of thread, other threads:[~2020-01-23 12:41 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-22  0:44 [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Kuninori Morimoto
2020-01-22  0:44 ` [alsa-devel] [PATCH 1/7] ASoC: soc-pcm: add soc_rtd_startup() Kuninori Morimoto
2020-01-23 12:36   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_startup()" to the asoc tree Mark Brown
2020-01-22  0:44 ` [alsa-devel] [PATCH 2/7] ASoC: soc-pcm: add soc_rtd_shutdown() Kuninori Morimoto
2020-01-23 12:36   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_shutdown()" to the asoc tree Mark Brown
2020-01-22  0:44 ` [alsa-devel] [PATCH 3/7] ASoC: soc-pcm: add soc_rtd_prepare() Kuninori Morimoto
2020-01-23 12:36   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_prepare()" to the asoc tree Mark Brown
2020-01-22  0:44 ` [alsa-devel] [PATCH 4/7] ASoC: soc-pcm: add soc_rtd_hw_params() Kuninori Morimoto
2020-01-23 12:36   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_hw_params()" to the asoc tree Mark Brown
2020-01-22  0:44 ` [alsa-devel] [PATCH 5/7] ASoC: soc-pcm: add soc_rtd_hw_free() Kuninori Morimoto
2020-01-23 12:35   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_hw_free()" to the asoc tree Mark Brown
2020-01-22  0:44 ` [alsa-devel] [PATCH 6/7] ASoC: soc-pcm: add soc_rtd_trigger() Kuninori Morimoto
2020-01-23 12:35   ` [alsa-devel] Applied "ASoC: soc-pcm: add soc_rtd_trigger()" to the asoc tree Mark Brown
2020-01-22  0:45 ` [alsa-devel] [PATCH 7/7] ASoC: soc-core: remove null_snd_soc_ops Kuninori Morimoto
2020-01-23 12:35   ` [alsa-devel] Applied "ASoC: soc-core: remove null_snd_soc_ops" to the asoc tree Mark Brown
2020-01-22  4:30 ` [alsa-devel] [PATCH 0/7] ASoC: soc-pcm: add soc_rtd_xxx() Sridharan, Ranjani
2020-01-22 10:42   ` Pierre-Louis Bossart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).