All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ASoC: merge audio-graph-scu into audio-graph - step1
@ 2018-11-21  2:08 Kuninori Morimoto
  2018-11-21  2:08 ` [PATCH 1/4] ASoC: simple-card-utils: remove asoc_simple_card_clk_register() Kuninori Morimoto
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Kuninori Morimoto @ 2018-11-21  2:08 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


Hi Mark

audio-graph     card can handle normal sound card, and
audio-graph-scu card can handle DPCM   sound card.
But, we can't use these feature in same time now.

ex)
audio-graph can handle normal sound card

	CPU1 -- Codec1
	CPU2 -- Codec2

audio-graph-scu can handle DPCM sound card

	CPU1 --- Codec1
	CPU2 -/

But, we can't use these in same time

	CPU1 --- Codec1
	CPU2 --- Codec2
	CPU3 -/

So, this is the time to merge audio-graph and audio-graph-scu.
The patch-set are a little bit huge (and few patches are depend
on posted OF patch. I'm now waiting...),
thus, I separated these into few steps.
This is step1 as prepare merging.
I think it will be 4 or more steps.

"simple card" and "audio graph card" are similar sound card,
and now I'm focusing to "audio graph card" merging only.
Basically simple-card and simple-scu-card are similar too,
and we can merge it. But I have no plan for it now.
Please try it someone ;P

Kuninori Morimoto (4):
  ASoC: simple-card-utils: remove asoc_simple_card_clk_register()
  ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx()
  ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert()
  ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing()

 include/sound/simple_card_utils.h        |  6 +++---
 sound/soc/generic/audio-graph-card.c     |  2 +-
 sound/soc/generic/audio-graph-scu-card.c |  4 ++--
 sound/soc/generic/simple-card-utils.c    | 34 +++++++++++++++-----------------
 sound/soc/generic/simple-card.c          |  2 +-
 sound/soc/generic/simple-scu-card.c      |  4 ++--
 6 files changed, 25 insertions(+), 27 deletions(-)

-- 
2.7.4

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

* [PATCH 1/4] ASoC: simple-card-utils: remove asoc_simple_card_clk_register()
  2018-11-21  2:08 [PATCH 0/4] ASoC: merge audio-graph-scu into audio-graph - step1 Kuninori Morimoto
@ 2018-11-21  2:08 ` Kuninori Morimoto
  2018-11-21 13:29   ` Applied "ASoC: simple-card-utils: remove asoc_simple_card_clk_register()" to the asoc tree Mark Brown
  2018-11-21  2:09 ` [PATCH 2/4] ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx() Kuninori Morimoto
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Kuninori Morimoto @ 2018-11-21  2:08 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

asoc_simple_card_clk_register() is used but only 1 user,
and very pointless code. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/simple-card-utils.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index a191d59..dcac45dad 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -151,12 +151,6 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);
 
-static void asoc_simple_card_clk_register(struct asoc_simple_dai *dai,
-					  struct clk *clk)
-{
-	dai->clk = clk;
-}
-
 int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai)
 {
 	return clk_prepare_enable(dai->clk);
@@ -200,7 +194,7 @@ int asoc_simple_card_parse_clk(struct device *dev,
 	if (!IS_ERR(clk)) {
 		simple_dai->sysclk = clk_get_rate(clk);
 
-		asoc_simple_card_clk_register(simple_dai, clk);
+		simple_dai->clk = clk;
 	} else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
 		simple_dai->sysclk = val;
 	} else {
-- 
2.7.4

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

* [PATCH 2/4] ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx()
  2018-11-21  2:08 [PATCH 0/4] ASoC: merge audio-graph-scu into audio-graph - step1 Kuninori Morimoto
  2018-11-21  2:08 ` [PATCH 1/4] ASoC: simple-card-utils: remove asoc_simple_card_clk_register() Kuninori Morimoto
@ 2018-11-21  2:09 ` Kuninori Morimoto
  2018-11-21 13:29   ` Applied "ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx()" to the asoc tree Mark Brown
  2018-11-21  2:10 ` [PATCH 3/4] ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert() Kuninori Morimoto
  2018-11-21  2:11 ` [PATCH 4/4] ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing() Kuninori Morimoto
  3 siblings, 1 reply; 9+ messages in thread
From: Kuninori Morimoto @ 2018-11-21  2:09 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

If simple-card-utils accept NULL pointer on asoc_simple_card_xxx(),
each driver code will be more simple.
Let's accept NULL pointer.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/simple-card-utils.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index dcac45dad..2fe7ea2 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -153,13 +153,17 @@ EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);
 
 int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai)
 {
-	return clk_prepare_enable(dai->clk);
+	if (dai)
+		return clk_prepare_enable(dai->clk);
+
+	return 0;
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_clk_enable);
 
 void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai)
 {
-	clk_disable_unprepare(dai->clk);
+	if (dai)
+		clk_disable_unprepare(dai->clk);
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_clk_disable);
 
@@ -345,6 +349,9 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
 {
 	int ret;
 
+	if (!simple_dai)
+		return 0;
+
 	if (simple_dai->sysclk) {
 		ret = snd_soc_dai_set_sysclk(dai, 0, simple_dai->sysclk,
 					     simple_dai->clk_direction);
-- 
2.7.4

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

* [PATCH 3/4] ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert()
  2018-11-21  2:08 [PATCH 0/4] ASoC: merge audio-graph-scu into audio-graph - step1 Kuninori Morimoto
  2018-11-21  2:08 ` [PATCH 1/4] ASoC: simple-card-utils: remove asoc_simple_card_clk_register() Kuninori Morimoto
  2018-11-21  2:09 ` [PATCH 2/4] ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx() Kuninori Morimoto
@ 2018-11-21  2:10 ` Kuninori Morimoto
  2018-11-21 13:29   ` Applied "ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert()" to the asoc tree Mark Brown
  2018-11-21  2:11 ` [PATCH 4/4] ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing() Kuninori Morimoto
  3 siblings, 1 reply; 9+ messages in thread
From: Kuninori Morimoto @ 2018-11-21  2:10 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

Current simple-card-utils has asoc_simple_card_parse_convert() to parse
convert channel/rate for be_hw_params_fixup.
But, it is parsing from top of node.

If sound card had multi subnode, we need to parse it from each sub node.
This patch tidyup asoc_simple_card_parse_convert() to allow parsing
settings from each node.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/simple_card_utils.h        | 3 ++-
 sound/soc/generic/audio-graph-scu-card.c | 2 +-
 sound/soc/generic/simple-card-utils.c    | 5 +++--
 sound/soc/generic/simple-scu-card.c      | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index fb0318f..d1f1717 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -116,7 +116,8 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card);
 
 void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data,
 				      struct snd_pcm_hw_params *params);
-void asoc_simple_card_parse_convert(struct device *dev, char *prefix,
+void asoc_simple_card_parse_convert(struct device *dev,
+				    struct device_node *np, char *prefix,
 				    struct asoc_simple_card_data *data);
 
 int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c
index 2ba35bd..1f75493 100644
--- a/sound/soc/generic/audio-graph-scu-card.c
+++ b/sound/soc/generic/audio-graph-scu-card.c
@@ -204,7 +204,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
 	if (ret < 0)
 		return ret;
 
-	asoc_simple_card_parse_convert(dev, NULL, &priv->adata);
+	asoc_simple_card_parse_convert(dev, node, NULL, &priv->adata);
 
 	/*
 	 * it supports multi CPU, single CODEC only here
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 2fe7ea2..f588c93 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -32,10 +32,11 @@ void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data,
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_convert_fixup);
 
-void asoc_simple_card_parse_convert(struct device *dev, char *prefix,
+void asoc_simple_card_parse_convert(struct device *dev,
+				    struct device_node *np,
+				    char *prefix,
 				    struct asoc_simple_card_data *data)
 {
-	struct device_node *np = dev->of_node;
 	char prop[128];
 
 	if (!prefix)
diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c
index 85b46f0..2d3ef6e 100644
--- a/sound/soc/generic/simple-scu-card.c
+++ b/sound/soc/generic/simple-scu-card.c
@@ -202,7 +202,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
 	if (ret < 0)
 		return ret;
 
-	asoc_simple_card_parse_convert(dev, PREFIX, &priv->adata);
+	asoc_simple_card_parse_convert(dev, node, PREFIX, &priv->adata);
 
 	/* find 1st codec */
 	np = of_get_child_by_name(node, PREFIX "codec");
-- 
2.7.4

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

* [PATCH 4/4] ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing()
  2018-11-21  2:08 [PATCH 0/4] ASoC: merge audio-graph-scu into audio-graph - step1 Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2018-11-21  2:10 ` [PATCH 3/4] ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert() Kuninori Morimoto
@ 2018-11-21  2:11 ` Kuninori Morimoto
  2018-11-21 13:29   ` Applied "ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing()" to the asoc tree Mark Brown
  3 siblings, 1 reply; 9+ messages in thread
From: Kuninori Morimoto @ 2018-11-21  2:11 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

asoc_simple_card_of_parse_routing() had "option" parameter
to consider error handling, but it is very pointless parameter.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/simple_card_utils.h        |  3 +--
 sound/soc/generic/audio-graph-card.c     |  2 +-
 sound/soc/generic/audio-graph-scu-card.c |  2 +-
 sound/soc/generic/simple-card-utils.c    | 10 +++-------
 sound/soc/generic/simple-card.c          |  2 +-
 sound/soc/generic/simple-scu-card.c      |  2 +-
 6 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index d1f1717..6d69ed2 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -121,8 +121,7 @@ void asoc_simple_card_parse_convert(struct device *dev,
 				    struct asoc_simple_card_data *data);
 
 int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
-				      char *prefix,
-				      int optional);
+				      char *prefix);
 int asoc_simple_card_of_parse_widgets(struct snd_soc_card *card,
 				      char *prefix);
 
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 26eb6ff..101c7da 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -238,7 +238,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
 	if (ret < 0)
 		return ret;
 
-	ret = asoc_simple_card_of_parse_routing(card, NULL, 1);
+	ret = asoc_simple_card_of_parse_routing(card, NULL);
 	if (ret < 0)
 		return ret;
 
diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c
index 1f75493..c469473 100644
--- a/sound/soc/generic/audio-graph-scu-card.c
+++ b/sound/soc/generic/audio-graph-scu-card.c
@@ -200,7 +200,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
 	 * see simple-card
 	 */
 
-	ret = asoc_simple_card_of_parse_routing(card, NULL, 0);
+	ret = asoc_simple_card_of_parse_routing(card, NULL);
 	if (ret < 0)
 		return ret;
 
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index f588c93..119f831 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -420,8 +420,7 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card)
 EXPORT_SYMBOL_GPL(asoc_simple_card_clean_reference);
 
 int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
-				      char *prefix,
-				      int optional)
+				      char *prefix)
 {
 	struct device_node *node = card->dev->of_node;
 	char prop[128];
@@ -431,11 +430,8 @@ int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
 
 	snprintf(prop, sizeof(prop), "%s%s", prefix, "routing");
 
-	if (!of_property_read_bool(node, prop)) {
-		if (optional)
-			return 0;
-		return -EINVAL;
-	}
+	if (!of_property_read_bool(node, prop))
+		return 0;
 
 	return snd_soc_of_parse_audio_routing(card, prop);
 }
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 5a3f59a..ff3f9fa 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -300,7 +300,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
 	if (ret < 0)
 		goto card_parse_end;
 
-	ret = asoc_simple_card_of_parse_routing(card, PREFIX, 1);
+	ret = asoc_simple_card_of_parse_routing(card, PREFIX);
 	if (ret < 0)
 		goto card_parse_end;
 
diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c
index 2d3ef6e..e650143 100644
--- a/sound/soc/generic/simple-scu-card.c
+++ b/sound/soc/generic/simple-scu-card.c
@@ -198,7 +198,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
 	if (ret < 0)
 		return ret;
 
-	ret = asoc_simple_card_of_parse_routing(card, PREFIX, 0);
+	ret = asoc_simple_card_of_parse_routing(card, PREFIX);
 	if (ret < 0)
 		return ret;
 
-- 
2.7.4

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

* Applied "ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing()" to the asoc tree
  2018-11-21  2:11 ` [PATCH 4/4] ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing() Kuninori Morimoto
@ 2018-11-21 13:29   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-11-21 13:29 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown

The patch

   ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing()

has been applied to the asoc tree at

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

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 33404f3f10beaf0d69d8765f5804b6fb3b305f0f Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 21 Nov 2018 02:11:13 +0000
Subject: [PATCH] ASoC: simple_card_utils: remove "option" from
 asoc_simple_card_of_parse_routing()

asoc_simple_card_of_parse_routing() had "option" parameter
to consider error handling, but it is very pointless parameter.
Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 include/sound/simple_card_utils.h        |  3 +--
 sound/soc/generic/audio-graph-card.c     |  2 +-
 sound/soc/generic/audio-graph-scu-card.c |  2 +-
 sound/soc/generic/simple-card-utils.c    | 10 +++-------
 sound/soc/generic/simple-card.c          |  2 +-
 sound/soc/generic/simple-scu-card.c      |  2 +-
 6 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index d1f17172dce2..6d69ed2bd7b1 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -121,8 +121,7 @@ void asoc_simple_card_parse_convert(struct device *dev,
 				    struct asoc_simple_card_data *data);
 
 int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
-				      char *prefix,
-				      int optional);
+				      char *prefix);
 int asoc_simple_card_of_parse_widgets(struct snd_soc_card *card,
 				      char *prefix);
 
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 26eb6ff9b9f3..101c7da2df7c 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -238,7 +238,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
 	if (ret < 0)
 		return ret;
 
-	ret = asoc_simple_card_of_parse_routing(card, NULL, 1);
+	ret = asoc_simple_card_of_parse_routing(card, NULL);
 	if (ret < 0)
 		return ret;
 
diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c
index 1f754933ea9f..c46947393f80 100644
--- a/sound/soc/generic/audio-graph-scu-card.c
+++ b/sound/soc/generic/audio-graph-scu-card.c
@@ -200,7 +200,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
 	 * see simple-card
 	 */
 
-	ret = asoc_simple_card_of_parse_routing(card, NULL, 0);
+	ret = asoc_simple_card_of_parse_routing(card, NULL);
 	if (ret < 0)
 		return ret;
 
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index a16373193b56..c69ce1e563cd 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -417,8 +417,7 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card)
 EXPORT_SYMBOL_GPL(asoc_simple_card_clean_reference);
 
 int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
-				      char *prefix,
-				      int optional)
+				      char *prefix)
 {
 	struct device_node *node = card->dev->of_node;
 	char prop[128];
@@ -428,11 +427,8 @@ int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
 
 	snprintf(prop, sizeof(prop), "%s%s", prefix, "routing");
 
-	if (!of_property_read_bool(node, prop)) {
-		if (optional)
-			return 0;
-		return -EINVAL;
-	}
+	if (!of_property_read_bool(node, prop))
+		return 0;
 
 	return snd_soc_of_parse_audio_routing(card, prop);
 }
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 5a3f59aa4ba5..ff3f9fa9ab5a 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -300,7 +300,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
 	if (ret < 0)
 		goto card_parse_end;
 
-	ret = asoc_simple_card_of_parse_routing(card, PREFIX, 1);
+	ret = asoc_simple_card_of_parse_routing(card, PREFIX);
 	if (ret < 0)
 		goto card_parse_end;
 
diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c
index 2d3ef6ebe863..e650143eb532 100644
--- a/sound/soc/generic/simple-scu-card.c
+++ b/sound/soc/generic/simple-scu-card.c
@@ -198,7 +198,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
 	if (ret < 0)
 		return ret;
 
-	ret = asoc_simple_card_of_parse_routing(card, PREFIX, 0);
+	ret = asoc_simple_card_of_parse_routing(card, PREFIX);
 	if (ret < 0)
 		return ret;
 
-- 
2.19.0.rc2

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

* Applied "ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert()" to the asoc tree
  2018-11-21  2:10 ` [PATCH 3/4] ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert() Kuninori Morimoto
@ 2018-11-21 13:29   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-11-21 13:29 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown

The patch

   ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert()

has been applied to the asoc tree at

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

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 a48bf02b35d9325eedb56ab531038511695a2734 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 21 Nov 2018 02:10:51 +0000
Subject: [PATCH] ASoC: simple-card-utils: tidyup
 asoc_simple_card_parse_convert()

Current simple-card-utils has asoc_simple_card_parse_convert() to parse
convert channel/rate for be_hw_params_fixup.
But, it is parsing from top of node.

If sound card had multi subnode, we need to parse it from each sub node.
This patch tidyup asoc_simple_card_parse_convert() to allow parsing
settings from each node.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 include/sound/simple_card_utils.h        | 3 ++-
 sound/soc/generic/audio-graph-scu-card.c | 2 +-
 sound/soc/generic/simple-card-utils.c    | 5 +++--
 sound/soc/generic/simple-scu-card.c      | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index fb0318f9b10f..d1f17172dce2 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -116,7 +116,8 @@ int asoc_simple_card_clean_reference(struct snd_soc_card *card);
 
 void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data,
 				      struct snd_pcm_hw_params *params);
-void asoc_simple_card_parse_convert(struct device *dev, char *prefix,
+void asoc_simple_card_parse_convert(struct device *dev,
+				    struct device_node *np, char *prefix,
 				    struct asoc_simple_card_data *data);
 
 int asoc_simple_card_of_parse_routing(struct snd_soc_card *card,
diff --git a/sound/soc/generic/audio-graph-scu-card.c b/sound/soc/generic/audio-graph-scu-card.c
index 2ba35bdd3b38..1f754933ea9f 100644
--- a/sound/soc/generic/audio-graph-scu-card.c
+++ b/sound/soc/generic/audio-graph-scu-card.c
@@ -204,7 +204,7 @@ static int asoc_graph_card_parse_of(struct graph_card_data *priv)
 	if (ret < 0)
 		return ret;
 
-	asoc_simple_card_parse_convert(dev, NULL, &priv->adata);
+	asoc_simple_card_parse_convert(dev, node, NULL, &priv->adata);
 
 	/*
 	 * it supports multi CPU, single CODEC only here
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index f3183a4718b3..a16373193b56 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -32,10 +32,11 @@ void asoc_simple_card_convert_fixup(struct asoc_simple_card_data *data,
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_convert_fixup);
 
-void asoc_simple_card_parse_convert(struct device *dev, char *prefix,
+void asoc_simple_card_parse_convert(struct device *dev,
+				    struct device_node *np,
+				    char *prefix,
 				    struct asoc_simple_card_data *data)
 {
-	struct device_node *np = dev->of_node;
 	char prop[128];
 
 	if (!prefix)
diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c
index 85b46f0eae0f..2d3ef6ebe863 100644
--- a/sound/soc/generic/simple-scu-card.c
+++ b/sound/soc/generic/simple-scu-card.c
@@ -202,7 +202,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
 	if (ret < 0)
 		return ret;
 
-	asoc_simple_card_parse_convert(dev, PREFIX, &priv->adata);
+	asoc_simple_card_parse_convert(dev, node, PREFIX, &priv->adata);
 
 	/* find 1st codec */
 	np = of_get_child_by_name(node, PREFIX "codec");
-- 
2.19.0.rc2

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

* Applied "ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx()" to the asoc tree
  2018-11-21  2:09 ` [PATCH 2/4] ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx() Kuninori Morimoto
@ 2018-11-21 13:29   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-11-21 13:29 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown

The patch

   ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx()

has been applied to the asoc tree at

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

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 f31a17105560f5f074f4d26fd5469a221f50af18 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 21 Nov 2018 02:09:16 +0000
Subject: [PATCH] ASoC: simple-card-utils: accept NULL parameter on
 asoc_simple_card_xxx()

If simple-card-utils accept NULL pointer on asoc_simple_card_xxx(),
each driver code will be more simple.
Let's accept NULL pointer.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/generic/simple-card-utils.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 996bfe42bc8d..f3183a4718b3 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -153,13 +153,17 @@ EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);
 
 int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai)
 {
-	return clk_prepare_enable(dai->clk);
+	if (dai)
+		return clk_prepare_enable(dai->clk);
+
+	return 0;
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_clk_enable);
 
 void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai)
 {
-	clk_disable_unprepare(dai->clk);
+	if (dai)
+		clk_disable_unprepare(dai->clk);
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_clk_disable);
 
@@ -342,6 +346,9 @@ int asoc_simple_card_init_dai(struct snd_soc_dai *dai,
 {
 	int ret;
 
+	if (!simple_dai)
+		return 0;
+
 	if (simple_dai->sysclk) {
 		ret = snd_soc_dai_set_sysclk(dai, 0, simple_dai->sysclk,
 					     simple_dai->clk_direction);
-- 
2.19.0.rc2

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

* Applied "ASoC: simple-card-utils: remove asoc_simple_card_clk_register()" to the asoc tree
  2018-11-21  2:08 ` [PATCH 1/4] ASoC: simple-card-utils: remove asoc_simple_card_clk_register() Kuninori Morimoto
@ 2018-11-21 13:29   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-11-21 13:29 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown

The patch

   ASoC: simple-card-utils: remove asoc_simple_card_clk_register()

has been applied to the asoc tree at

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

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 c0f4697c5dbca0c9bdd1264bcf2d7c5d15a14f67 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Wed, 21 Nov 2018 02:08:59 +0000
Subject: [PATCH] ASoC: simple-card-utils: remove
 asoc_simple_card_clk_register()

asoc_simple_card_clk_register() is used but only 1 user,
and very pointless code. Let's remove it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/generic/simple-card-utils.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index f34cc6cddfa2..996bfe42bc8d 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -151,12 +151,6 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card,
 }
 EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name);
 
-static void asoc_simple_card_clk_register(struct asoc_simple_dai *dai,
-					  struct clk *clk)
-{
-	dai->clk = clk;
-}
-
 int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai)
 {
 	return clk_prepare_enable(dai->clk);
@@ -200,7 +194,7 @@ int asoc_simple_card_parse_clk(struct device *dev,
 	if (!IS_ERR(clk)) {
 		simple_dai->sysclk = clk_get_rate(clk);
 
-		asoc_simple_card_clk_register(simple_dai, clk);
+		simple_dai->clk = clk;
 	} else if (!of_property_read_u32(node, "system-clock-frequency", &val)) {
 		simple_dai->sysclk = val;
 	} else {
-- 
2.19.0.rc2

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

end of thread, other threads:[~2018-11-21 13:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21  2:08 [PATCH 0/4] ASoC: merge audio-graph-scu into audio-graph - step1 Kuninori Morimoto
2018-11-21  2:08 ` [PATCH 1/4] ASoC: simple-card-utils: remove asoc_simple_card_clk_register() Kuninori Morimoto
2018-11-21 13:29   ` Applied "ASoC: simple-card-utils: remove asoc_simple_card_clk_register()" to the asoc tree Mark Brown
2018-11-21  2:09 ` [PATCH 2/4] ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx() Kuninori Morimoto
2018-11-21 13:29   ` Applied "ASoC: simple-card-utils: accept NULL parameter on asoc_simple_card_xxx()" to the asoc tree Mark Brown
2018-11-21  2:10 ` [PATCH 3/4] ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert() Kuninori Morimoto
2018-11-21 13:29   ` Applied "ASoC: simple-card-utils: tidyup asoc_simple_card_parse_convert()" to the asoc tree Mark Brown
2018-11-21  2:11 ` [PATCH 4/4] ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing() Kuninori Morimoto
2018-11-21 13:29   ` Applied "ASoC: simple_card_utils: remove "option" from asoc_simple_card_of_parse_routing()" to the asoc tree 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.