Skip to contentSkip to conversation

ASoC: audio-graph: cleanups

PATCH In review Kuninori Morimoto 3 participants 11 messages Apr 19, 2021 – Aug 27, 2021

Subsystems (4)
lore
Share & tools
lore

Kuninori Morimoto

author maintainer
#0 lore raw

cover ASoC: audio-graph: cleanups

Hi Mark

These patches cleanups audio-graph.
This is part of prepare for new audio-graph-card2.

Kuninori Morimoto (6):
ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.c
ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.c
ASoC: audio-graph: check ports if exists
ASoC: audio-graph: remove "audio-graph-card," preix support
ASoC: audio-graph: remove unused "node" from graph_parse_mclk_fs()
ASoC: audio-graph: remove Platform support

 include/sound/graph_card.h               |  4 --
 include/sound/simple_card_utils.h        |  3 ++
 sound/soc/generic/audio-graph-card.c     | 52 ++++--------------------
 sound/soc/generic/simple-card-utils.c    | 25 ++++++++++++
 sound/soc/generic/simple-card.c          |  7 ----
 sound/soc/tegra/tegra_audio_graph_card.c |  4 +-
 6 files changed, 38 insertions(+), 57 deletions(-)
Signature · 11 lines
2.25.1





Thank you for your help !!

Best regards
---
Kuninori Morimoto
author maintainer
#1 lore raw

PATCH 1/6 ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.c

From: Kuninori Morimoto <[email protected]>

audio-graph-card2 can reuse audio_graph_card_probe(). This patch moves it to simple-card-utils.c.

---
 include/sound/graph_card.h               |  2 --
 include/sound/simple_card_utils.h        |  3 +++
 sound/soc/generic/audio-graph-card.c     | 19 +------------------
 sound/soc/generic/simple-card-utils.c    | 17 +++++++++++++++++
 sound/soc/tegra/tegra_audio_graph_card.c |  2 +-
 5 files changed, 22 insertions(+), 21 deletions(-)
include/sound/graph_card.h +0 -2
index 013784467bec..9c2feb792742 100644
@@ -9,8 +9,6 @@
 
 #include <sound/simple_card_utils.h>
 
-int audio_graph_card_probe(struct snd_soc_card *card);
-
 int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev);
 
 int audio_graph_remove(struct platform_device *pdev);
include/sound/simple_card_utils.h +3 -0
index e318a2d4ac44..656c7e30b6e4 100644
@@ -178,6 +178,9 @@ int asoc_simple_init_jack(struct snd_soc_card *card,
 int asoc_simple_init_priv(struct asoc_simple_priv *priv,
 			       struct link_info *li);
 
+int asoc_graph_card_probe(struct snd_soc_card *card);
+
+
 #ifdef DEBUG
 static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
 					 char *name,
sound/soc/generic/audio-graph-card.c +1 -18
index c7369beee805..2d004a980f0c 100644
@@ -717,23 +717,6 @@ static int graph_get_dais_count(struct asoc_simple_priv *priv,
 				   graph_count_dpcm);
 }
 
-int audio_graph_card_probe(struct snd_soc_card *card)
-{
-	struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
-	int ret;
-
-	ret = asoc_simple_init_hp(card, &priv->hp_jack, NULL);
-	if (ret < 0)
-		return ret;
-
-	ret = asoc_simple_init_mic(card, &priv->mic_jack, NULL);
-	if (ret < 0)
-		return ret;
-
-	return 0;
-}
-EXPORT_SYMBOL_GPL(audio_graph_card_probe);
-
 static int graph_probe(struct platform_device *pdev)
 {
 	struct asoc_simple_priv *priv;
@@ -748,7 +731,7 @@ static int graph_probe(struct platform_device *pdev)
 	card = simple_priv_to_card(priv);
 	card->dapm_widgets	= graph_dapm_widgets;
 	card->num_dapm_widgets	= ARRAY_SIZE(graph_dapm_widgets);
-	card->probe		= audio_graph_card_probe;
+	card->probe		= asoc_graph_card_probe;
 
 	if (of_device_get_match_data(dev))
 		priv->dpcm_selectable = 1;
sound/soc/generic/simple-card-utils.c +17 -0
index e1b7b30a4c8c..ed2cad6d9ac1 100644
@@ -740,6 +740,23 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
 }
 EXPORT_SYMBOL_GPL(asoc_simple_init_priv);
 
+int asoc_graph_card_probe(struct snd_soc_card *card)
+{
+	struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
+	int ret;
+
+	ret = asoc_simple_init_hp(card, &priv->hp_jack, NULL);
+	if (ret < 0)
+		return ret;
+
+	ret = asoc_simple_init_mic(card, &priv->mic_jack, NULL);
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(asoc_graph_card_probe);
+
 /* Module information */
 MODULE_AUTHOR("Kuninori Morimoto <[email protected]>");
 MODULE_DESCRIPTION("ALSA SoC Simple Card Utils");
sound/soc/tegra/tegra_audio_graph_card.c +1 -1
index 47b319504c8c..35d008b5d373 100644
@@ -184,7 +184,7 @@ static int tegra_audio_graph_card_probe(struct snd_soc_card *card)
 		return PTR_ERR(priv->clk_plla_out0);
 	}
 
-	return audio_graph_card_probe(card);
+	return asoc_graph_card_probe(card);
 }
 
 static int tegra_audio_graph_probe(struct platform_device *pdev)
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH 2/6 ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.c

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

audio-graph-card2 can reuse audio_graph_remove() / asoc_simple_remove(). This patch moves it to simple-card-utils.c.

---
 include/sound/graph_card.h               |  2 --
 include/sound/simple_card_utils.h        |  2 +-
 sound/soc/generic/audio-graph-card.c     | 10 +---------
 sound/soc/generic/simple-card-utils.c    |  8 ++++++++
 sound/soc/generic/simple-card.c          |  7 -------
 sound/soc/tegra/tegra_audio_graph_card.c |  2 +-
 6 files changed, 11 insertions(+), 20 deletions(-)
include/sound/graph_card.h +0 -2
index 9c2feb792742..6f10bfb0d5ee 100644
@@ -11,6 +11,4 @@
 
 int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev);
 
-int audio_graph_remove(struct platform_device *pdev);
-
 #endif /* __GRAPH_CARD_H */
include/sound/simple_card_utils.h +1 -1
index 656c7e30b6e4..51b3b485a92e 100644
@@ -177,10 +177,10 @@ int asoc_simple_init_jack(struct snd_soc_card *card,
 			       int is_hp, char *prefix, char *pin);
 int asoc_simple_init_priv(struct asoc_simple_priv *priv,
 			       struct link_info *li);
+int asoc_simple_remove(struct platform_device *pdev);
 
 int asoc_graph_card_probe(struct snd_soc_card *card);
 
-
 #ifdef DEBUG
 static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
 					 char *name,
sound/soc/generic/audio-graph-card.c +1 -9
index 2d004a980f0c..54e8be90b109 100644
@@ -739,14 +739,6 @@ static int graph_probe(struct platform_device *pdev)
 	return audio_graph_parse_of(priv, dev);
 }
 
-int audio_graph_remove(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	return asoc_simple_clean_reference(card);
-}
-EXPORT_SYMBOL_GPL(audio_graph_remove);
-
 static const struct of_device_id graph_of_match[] = {
 	{ .compatible = "audio-graph-card", },
 	{ .compatible = "audio-graph-scu-card",
@@ -762,7 +754,7 @@ static struct platform_driver graph_card = {
 		.of_match_table = graph_of_match,
 	},
 	.probe = graph_probe,
-	.remove = audio_graph_remove,
+	.remove = asoc_simple_remove,
 };
 module_platform_driver(graph_card);
 
sound/soc/generic/simple-card-utils.c +8 -0
index ed2cad6d9ac1..fa1247f0dda1 100644
@@ -740,6 +740,14 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
 }
 EXPORT_SYMBOL_GPL(asoc_simple_init_priv);
 
+int asoc_simple_remove(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+	return asoc_simple_clean_reference(card);
+}
+EXPORT_SYMBOL_GPL(asoc_simple_remove);
+
 int asoc_graph_card_probe(struct snd_soc_card *card)
 {
 	struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
sound/soc/generic/simple-card.c +0 -7
index 8b9964d25757..ece7dac3e8c5 100644
@@ -705,13 +705,6 @@ static int asoc_simple_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int asoc_simple_remove(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	return asoc_simple_clean_reference(card);
-}
-
 static const struct of_device_id simple_of_match[] = {
 	{ .compatible = "simple-audio-card", },
 	{ .compatible = "simple-scu-audio-card",
sound/soc/tegra/tegra_audio_graph_card.c +1 -1
index 35d008b5d373..1f2c5018bf5a 100644
@@ -244,7 +244,7 @@ static struct platform_driver tegra_audio_graph_card = {
 		.of_match_table = graph_of_tegra_match,
 	},
 	.probe = tegra_audio_graph_probe,
-	.remove = audio_graph_remove,
+	.remove = asoc_simple_remove,
 };
 module_platform_driver(tegra_audio_graph_card);
 
Signature · 1 line
2.25.1
author maintainer
#3 lore raw

PATCH 3/6 ASoC: audio-graph: check ports if exists

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

"endpoint" and "port" are always exists, but there is no guarantee for "ports". This patch checks "ports" if exists, otherwise, it might set un-expected settings.

This patch also do align to 100 char in 1 line.

---
 sound/soc/generic/audio-graph-card.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
sound/soc/generic/audio-graph-card.c +6 -4
index 54e8be90b109..0006c71f4f69 100644
@@ -182,7 +182,8 @@ static void graph_parse_convert(struct device *dev,
 
 	asoc_simple_parse_convert(top,   NULL,   adata);
 	asoc_simple_parse_convert(node,  PREFIX, adata);
-	asoc_simple_parse_convert(ports, NULL,   adata);
+	if (of_node_name_eq(ports, "ports"))
+		asoc_simple_parse_convert(ports, NULL, adata);
 	asoc_simple_parse_convert(port,  NULL,   adata);
 	asoc_simple_parse_convert(ep,    NULL,   adata);
 
@@ -200,7 +201,8 @@ static void graph_parse_mclk_fs(struct device_node *top,
 	struct device_node *node	= of_graph_get_port_parent(ep);
 
 	of_property_read_u32(top,	"mclk-fs", &props->mclk_fs);
-	of_property_read_u32(ports,	"mclk-fs", &props->mclk_fs);
+	if (of_node_name_eq(ports, "ports"))
+		of_property_read_u32(ports, "mclk-fs", &props->mclk_fs);
 	of_property_read_u32(port,	"mclk-fs", &props->mclk_fs);
 	of_property_read_u32(ep,	"mclk-fs", &props->mclk_fs);
 
@@ -311,8 +313,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
 					      "prefix");
 		snd_soc_of_parse_node_prefix(node, cconf, codecs->of_node,
 					     PREFIX "prefix");
-		snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node,
-					     "prefix");
+		if (of_node_name_eq(ports, "ports"))
+			snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix");
 		snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node,
 					     "prefix");
 	}
Signature · 1 line
2.25.1
author maintainer
#4 lore raw

PATCH 4/6 ASoC: audio-graph: remove "audio-graph-card, " preix support

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

No upstream code is using "audio-graph-card," preix, and Yaml base Document doesn't indicate it. Let's remove it.

---
 sound/soc/generic/audio-graph-card.c | 5 -----
 1 file changed, 5 deletions(-)
sound/soc/generic/audio-graph-card.c +0 -5
index 0006c71f4f69..029611c19c15 100644
@@ -22,8 +22,6 @@
 
 #define DPCM_SELECTABLE 1
 
-#define PREFIX	"audio-graph-card,"
-
 static int graph_outdrv_event(struct snd_soc_dapm_widget *w,
 			      struct snd_kcontrol *kcontrol,
 			      int event)
@@ -181,7 +179,6 @@ static void graph_parse_convert(struct device *dev,
 	struct device_node *node = of_graph_get_port_parent(ep);
 
 	asoc_simple_parse_convert(top,   NULL,   adata);
-	asoc_simple_parse_convert(node,  PREFIX, adata);
 	if (of_node_name_eq(ports, "ports"))
 		asoc_simple_parse_convert(ports, NULL, adata);
 	asoc_simple_parse_convert(port,  NULL,   adata);
@@ -311,8 +308,6 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
 		/* check "prefix" from top node */
 		snd_soc_of_parse_node_prefix(top, cconf, codecs->of_node,
 					      "prefix");
-		snd_soc_of_parse_node_prefix(node, cconf, codecs->of_node,
-					     PREFIX "prefix");
 		if (of_node_name_eq(ports, "ports"))
 			snd_soc_of_parse_node_prefix(ports, cconf, codecs->of_node, "prefix");
 		snd_soc_of_parse_node_prefix(port, cconf, codecs->of_node,
Signature · 1 line
2.25.1
author maintainer
#5 lore raw

PATCH 5/6 ASoC: audio-graph: remove unused "node" from graph_parse_mclk_fs()

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

graph_parse_mclk_fs() has "node", but is not used. This patch removes unused "node"

---
 sound/soc/generic/audio-graph-card.c | 2 --
 1 file changed, 2 deletions(-)
sound/soc/generic/audio-graph-card.c +0 -2
index 029611c19c15..5594eab9902e 100644
@@ -195,7 +195,6 @@ static void graph_parse_mclk_fs(struct device_node *top,
 {
 	struct device_node *port	= of_get_parent(ep);
 	struct device_node *ports	= of_get_parent(port);
-	struct device_node *node	= of_graph_get_port_parent(ep);
 
 	of_property_read_u32(top,	"mclk-fs", &props->mclk_fs);
 	if (of_node_name_eq(ports, "ports"))
@@ -205,7 +204,6 @@ static void graph_parse_mclk_fs(struct device_node *top,
 
 	of_node_put(port);
 	of_node_put(ports);
-	of_node_put(node);
 }
 
 static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
Signature · 1 line
2.25.1
author maintainer
#6 lore raw

PATCH 6/6 ASoC: audio-graph: remove Platform support

In reply to Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

Platform was one of mandatory component on ASoC before, and audio-graph-card was assuming that CPU and Platform were same driver.

But it is no longer mandatory on ASoC.
Current ASoC will just ignore if Platform and CPU were same or doplicated component.

Of course ASoC is supporting Platform, but current audio-graph-card doesn't support detecting it from DT.

This means current audio-graph-card operation for Platform so far is 100% useless. This patch removes it.
We can respawn it when we need it.

---
 sound/soc/generic/audio-graph-card.c | 6 ------
 1 file changed, 6 deletions(-)
sound/soc/generic/audio-graph-card.c +0 -6
index 5594eab9902e..3c4915d1e528 100644
@@ -223,7 +223,6 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
 	struct asoc_simple_dai *dai;
 	struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
 	struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
-	struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
 	int ret;
 
 	port	= of_get_parent(ep);
@@ -275,7 +274,6 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
 
 		/* card->num_links includes Codec */
 		asoc_simple_canonicalize_cpu(cpus, is_single_links);
-		asoc_simple_canonicalize_platform(platforms, cpus);
 	} else {
 		struct snd_soc_codec_conf *cconf;
 
@@ -354,7 +352,6 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
 	struct asoc_simple_dai *codec_dai = simple_props_to_dai_codec(dai_props, 0);
 	struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
 	struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
-	struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
 	int ret, single_cpu = 0;
 
 	dev_dbg(dev, "link_of (%pOF)\n", cpu_ep);
@@ -405,7 +402,6 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
 	dai_link->init = asoc_simple_dai_init;
 
 	asoc_simple_canonicalize_cpu(cpus, single_cpu);
-	asoc_simple_canonicalize_platform(platforms, cpus);
 
 	return 0;
 }
@@ -621,7 +617,6 @@ static int graph_count_noml(struct asoc_simple_priv *priv,
 
 	li->num[li->link].cpus		= 1;
 	li->num[li->link].codecs	= 1;
-	li->num[li->link].platforms	= 1;
 
 	li->link += 1; /* 1xCPU-Codec */
 
@@ -644,7 +639,6 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
 
 	if (li->cpu) {
 		li->num[li->link].cpus		= 1;
-		li->num[li->link].platforms	= 1;
 
 		li->link++; /* 1xCPU-dummy */
 	} else {
Signature · 1 line
2.25.1
#7 lore raw

Re: [PATCH 6/6] ASoC: audio-graph: remove Platform support

Hello Kuninori,

I have seen that the STM32MP15 audio sound card is no more functional with recent kernels (5.13 or 5.14)
The sound card is registered, but the all devices are issuing an error at runtime. These devices are using stm32_sai.c or stm32_i2s.c drivers.

I found that the regression is linked to the commit 63f2f9cceb09f8e5f668e36c1cf764eea468ebed "ASoC: audio-graph: remove Platform support", as reverting this commit fixes the issue.

When the platform component is missing the pcm_construct ops in the pcm dmaengine, is never called, resulting in an incomplete initialization of the sound card. I can't figure out what is the right way to handle this change, however.
Do I need to update the CPU drivers to work without a platform component
or does the audio-graph card has to be changed in some way ?
What do you mean "We can respawn it when we need it", in the commit message ?

Thanks for your help
regards
Olivier

Quoted 76 lines · Kuninori Morimoto

From: Kuninori Morimoto <[email protected]>

Platform was one of mandatory component on ASoC before, and audio-graph-card was assuming that CPU and Platform were same driver.

But it is no longer mandatory on ASoC.
Current ASoC will just ignore if Platform and CPU were same or doplicated component.

Of course ASoC is supporting Platform, but current audio-graph-card doesn't support detecting it from DT.

This means current audio-graph-card operation for Platform so far is 100% useless. This patch removes it.
We can respawn it when we need it.

---
  sound/soc/generic/audio-graph-card.c | 6 ------
  1 file changed, 6 deletions(-)
sound/soc/generic/audio-graph-card.c +0 -6
index 5594eab9902e..3c4915d1e528 100644
@@ -223,7 +223,6 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
  	struct asoc_simple_dai *dai;
  	struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
  	struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
-	struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
  	int ret;
 
  	port	= of_get_parent(ep);
@@ -275,7 +274,6 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv,
 
  		/* card->num_links includes Codec */
  		asoc_simple_canonicalize_cpu(cpus, is_single_links);
-		asoc_simple_canonicalize_platform(platforms, cpus);
  	} else {
  		struct snd_soc_codec_conf *cconf;
 
@@ -354,7 +352,6 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
  	struct asoc_simple_dai *codec_dai = simple_props_to_dai_codec(dai_props, 0);
  	struct snd_soc_dai_link_component *cpus = asoc_link_to_cpu(dai_link, 0);
  	struct snd_soc_dai_link_component *codecs = asoc_link_to_codec(dai_link, 0);
-	struct snd_soc_dai_link_component *platforms = asoc_link_to_platform(dai_link, 0);
  	int ret, single_cpu = 0;
 
  	dev_dbg(dev, "link_of (%pOF)\n", cpu_ep);
@@ -405,7 +402,6 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv,
  	dai_link->init = asoc_simple_dai_init;
 
  	asoc_simple_canonicalize_cpu(cpus, single_cpu);
-	asoc_simple_canonicalize_platform(platforms, cpus);
 
  	return 0;
  }
@@ -621,7 +617,6 @@ static int graph_count_noml(struct asoc_simple_priv *priv,
 
  	li->num[li->link].cpus		= 1;
  	li->num[li->link].codecs	= 1;
-	li->num[li->link].platforms	= 1;
 
  	li->link += 1; /* 1xCPU-Codec */
 
@@ -644,7 +639,6 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv,
 
  	if (li->cpu) {
  		li->num[li->link].cpus		= 1;
-		li->num[li->link].platforms	= 1;
 
  		li->link++; /* 1xCPU-dummy */
  	} else {
author maintainer
#8 lore raw

Re: [PATCH 6/6] ASoC: audio-graph: remove Platform support

Hi Olivier

Thank you for conntacting me

Quoted 10 lines

I have seen that the STM32MP15 audio sound card is no more functional with recent kernels (5.13 or 5.14)
The sound card is registered, but the all devices are issuing an error at runtime. These devices are using stm32_sai.c or stm32_i2s.c drivers.

I found that the regression is linked to the commit 63f2f9cceb09f8e5f668e36c1cf764eea468ebed "ASoC: audio-graph: remove Platform support", as reverting this commit fixes the issue.

Quoted 6 lines

When the platform component is missing the pcm_construct ops in the pcm dmaengine, is never called, resulting in an incomplete initialization of the sound card.
I can't figure out what is the right way to handle this change, however. Do I need to update the CPU drivers to work without a platform component or does the audio-graph card has to be changed in some way ?

Ahh, OK, I see.
Indeed the dev which is used for CPU is used at soc-generic-dmaengine as Platform, without indicating it at DT (= simple-card has "plat" support for platform at DT, but audio-graph doesn't ).

I think key funciton is asoc_simple_canonicalize_platform().

Quoted 2 lines

What do you mean "We can respawn it when we need it", in the commit message ?

This means we can revert this patch if needed, and yes it is needed :) Could you please respawn the feature ? or I can do it if you want.

Thank you for your help !!

Best regards
---
Kuninori Morimoto

#9 lore raw

Re: [PATCH 6/6] ASoC: audio-graph: remove Platform support

Hi Kuninori,

Thanks for your feedback

Quoted 22 lines · Kuninori Morimoto

Hi Olivier

Thank you for conntacting me

Quoted 10 lines

I have seen that the STM32MP15 audio sound card is no more functional with recent kernels (5.13 or 5.14)
The sound card is registered, but the all devices are issuing an error at runtime. These devices are using stm32_sai.c or stm32_i2s.c drivers.

I found that the regression is linked to the commit 63f2f9cceb09f8e5f668e36c1cf764eea468ebed "ASoC: audio-graph: remove Platform support", as reverting this commit fixes the issue.

Quoted 6 lines

When the platform component is missing the pcm_construct ops in the pcm dmaengine, is never called, resulting in an incomplete initialization of the sound card.
I can't figure out what is the right way to handle this change, however. Do I need to update the CPU drivers to work without a platform component or does the audio-graph card has to be changed in some way ?

Quoted 5 lines

Ahh, OK, I see.
Indeed the dev which is used for CPU is used at soc-generic-dmaengine as Platform, without indicating it at DT (= simple-card has "plat" support for platform at DT, but audio-graph doesn't ).

Yes, it seems that there is no way to force CPU to be used as platform with audio-graph. so, asoc_simple_canonicalize_platform() is necessary to do the job in this case.

Quoted 8 lines

I think key funciton is asoc_simple_canonicalize_platform().

Quoted 2 lines

What do you mean "We can respawn it when we need it", in the commit message ?

This means we can revert this patch if needed, and yes it is needed :) Could you please respawn the feature ? or I can do it if you want.

I feel more confortable if you revert the commit, as you are the author of the patch. Thanks.

BRs
Olivier

Quoted 6 lines

Thank you for your help !!

Best regards
---
Kuninori Morimoto

maintainer
#10 lore raw
In reply to Kuninori Morimoto
Quoted 11 lines · Kuninori Morimoto

These patches cleanups audio-graph.
This is part of prepare for new audio-graph-card2.

Kuninori Morimoto (6):
ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.c
ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.c
ASoC: audio-graph: check ports if exists
ASoC: audio-graph: remove "audio-graph-card," preix support
ASoC: audio-graph: remove unused "node" from graph_parse_mclk_fs()
ASoC: audio-graph: remove Platform support

Quoted 1 line

[...]

Applied to

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

Thanks!

[1/6] ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.c

      commit: 1a456b1c6be13514a8fc5c1a99e6763f491d17e9
[2/6] ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.c
      commit: f6fcc820e0c96664e2f21c0d6bb60630243ef36a
[3/6] ASoC: audio-graph: check ports if exists
      commit: 6769ea1e4315999624ce4637c9c338b9d88a85e6
[4/6] ASoC: audio-graph: remove "audio-graph-card, " preix support
      commit: 14d78d74d7bc47c6ff3a66fb9d405084de7b6b02
[5/6] ASoC: audio-graph: remove unused "node" from graph_parse_mclk_fs()
      commit: 67800ae93982eb4496f446cfd06f98ba7382ce36
[6/6] ASoC: audio-graph: remove Platform support
      commit: 63f2f9cceb09f8e5f668e36c1cf764eea468ebed

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