All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: simpe-card/audio-graph fixups
@ 2022-11-01  4:21 Kuninori Morimoto
  2022-11-01  4:21 ` [PATCH 1/3] ASoC: simple-card-utils: remove asoc_simple_convert_fixup() Kuninori Morimoto
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2022-11-01  4:21 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


Hi Mark

These are simpe-card/audio-graph fixup patches.

Kuninori Morimoto (3):
  ASoC: simple-card-utils: remove asoc_simple_convert_fixup()
  ASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer)
  ASoC: audio-graph-card2: check also dpcm node for convert-xxx

 include/sound/simple_card_utils.h             |  2 --
 .../audio-graph-card2-custom-sample.dtsi      | 10 ++++--
 sound/soc/generic/audio-graph-card2.c         |  3 +-
 sound/soc/generic/simple-card-utils.c         | 35 +++++++------------
 4 files changed, 23 insertions(+), 27 deletions(-)

-- 
2.25.1

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* [PATCH 1/3] ASoC: simple-card-utils: remove asoc_simple_convert_fixup()
  2022-11-01  4:21 [PATCH 0/3] ASoC: simpe-card/audio-graph fixups Kuninori Morimoto
@ 2022-11-01  4:21 ` Kuninori Morimoto
  2022-11-01  4:22 ` [PATCH 2/3] ASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer) Kuninori Morimoto
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2022-11-01  4:21 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

No one is using asoc_simple_convert_fixup(), we don't need to
export its symbol. This patch removes it.

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

diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index 25e049f44178..38590f1ae9ee 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -173,8 +173,6 @@ void asoc_simple_canonicalize_cpu(struct snd_soc_dai_link_component *cpus,
 
 void asoc_simple_clean_reference(struct snd_soc_card *card);
 
-void asoc_simple_convert_fixup(struct asoc_simple_data *data,
-				      struct snd_pcm_hw_params *params);
 void asoc_simple_parse_convert(struct device_node *np, char *prefix,
 			       struct asoc_simple_data *data);
 bool asoc_simple_is_convert_required(const struct asoc_simple_data *data);
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index be69bbc47f81..e35becce9635 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -41,27 +41,6 @@ static void asoc_simple_fixup_sample_fmt(struct asoc_simple_data *data,
 	}
 }
 
-void asoc_simple_convert_fixup(struct asoc_simple_data *data,
-			       struct snd_pcm_hw_params *params)
-{
-	struct snd_interval *rate = hw_param_interval(params,
-						SNDRV_PCM_HW_PARAM_RATE);
-	struct snd_interval *channels = hw_param_interval(params,
-						SNDRV_PCM_HW_PARAM_CHANNELS);
-
-	if (data->convert_rate)
-		rate->min =
-		rate->max = data->convert_rate;
-
-	if (data->convert_channels)
-		channels->min =
-		channels->max = data->convert_channels;
-
-	if (data->convert_sample_format)
-		asoc_simple_fixup_sample_fmt(data, params);
-}
-EXPORT_SYMBOL_GPL(asoc_simple_convert_fixup);
-
 void asoc_simple_parse_convert(struct device_node *np,
 			       char *prefix,
 			       struct asoc_simple_data *data)
@@ -522,8 +501,20 @@ int asoc_simple_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
 {
 	struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
 	struct simple_dai_props *dai_props = simple_priv_to_props(priv, rtd->num);
+	struct asoc_simple_data *data = &dai_props->adata;
+	struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
+	struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS);
+
+	if (data->convert_rate)
+		rate->min =
+		rate->max = data->convert_rate;
 
-	asoc_simple_convert_fixup(&dai_props->adata, params);
+	if (data->convert_channels)
+		channels->min =
+		channels->max = data->convert_channels;
+
+	if (data->convert_sample_format)
+		asoc_simple_fixup_sample_fmt(data, params);
 
 	return 0;
 }
-- 
2.25.1


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

* [PATCH 2/3] ASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer)
  2022-11-01  4:21 [PATCH 0/3] ASoC: simpe-card/audio-graph fixups Kuninori Morimoto
  2022-11-01  4:21 ` [PATCH 1/3] ASoC: simple-card-utils: remove asoc_simple_convert_fixup() Kuninori Morimoto
@ 2022-11-01  4:22 ` Kuninori Morimoto
  2022-11-01  4:22 ` [PATCH 3/3] ASoC: audio-graph-card2: check also dpcm node for convert-xxx Kuninori Morimoto
  2022-11-10 17:55 ` [PATCH 0/3] ASoC: simpe-card/audio-graph fixups Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2022-11-01  4:22 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

audio-graph-card2-custom-sample.dtsi is assuming that
DPCM sample is MIXer connection.

	FE		BE
	        ****
	CPU3 -- *  * -- Codec3
	CPU4 -- *  *
	        ****

CPU3/CPU4 need to convert rate in this case.
This patch adds missing "convert-rate" setting sample for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card2-custom-sample.dtsi | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/sound/soc/generic/audio-graph-card2-custom-sample.dtsi b/sound/soc/generic/audio-graph-card2-custom-sample.dtsi
index fe547c18771f..994db61a26b3 100644
--- a/sound/soc/generic/audio-graph-card2-custom-sample.dtsi
+++ b/sound/soc/generic/audio-graph-card2-custom-sample.dtsi
@@ -49,10 +49,13 @@ / {
 	 *		+-+		+-+
 	 *
 	 * [DPCM]
+	 *
+	 *	CPU3/CPU4 are converting rate to 44100
+	 *
 	 *	FE		BE
 	 *		  ****
 	 *	cpu3 <-@--*  *--@-> codec3
-	 *	cpu4 <-@--*  *
+	 *	cpu4 <-@--*  *  (44.1kHz)
 	 *		  ****
 	 *
 	 * [DPCM-Multi]
@@ -286,7 +289,10 @@ ports {
 			port@2  { codec2_ep:  endpoint { remote-endpoint = <&mcodec2_ep>; }; };
 
 			/* [DPCM]::BE */
-			port@3  { codec3_ep:  endpoint { remote-endpoint = <&be00_ep>; }; };
+			port@3  {
+				convert-rate = <44100>;
+				codec3_ep:  endpoint { remote-endpoint = <&be00_ep>; };
+			};
 
 			/* [DPCM-Multi]::BE */
 			port@4  { codec4_ep:  endpoint { remote-endpoint = <&mbe1_ep>; }; };
-- 
2.25.1


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

* [PATCH 3/3] ASoC: audio-graph-card2: check also dpcm node for convert-xxx
  2022-11-01  4:21 [PATCH 0/3] ASoC: simpe-card/audio-graph fixups Kuninori Morimoto
  2022-11-01  4:21 ` [PATCH 1/3] ASoC: simple-card-utils: remove asoc_simple_convert_fixup() Kuninori Morimoto
  2022-11-01  4:22 ` [PATCH 2/3] ASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer) Kuninori Morimoto
@ 2022-11-01  4:22 ` Kuninori Morimoto
  2022-11-10 17:55 ` [PATCH 0/3] ASoC: simpe-card/audio-graph fixups Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Kuninori Morimoto @ 2022-11-01  4:22 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA

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

DPCM connection on Card2, its DT looks like below.
Current Card2 is checking (a)/(b) part only for convert-xxx settings.
But it is not useful. This patch enables its settings at (A)/(B) part
too. (A)/(B) settings will be overwritten (a)/(b) settings if it has.

<Image>		      (A)	(a)
	Card2 <--+--> FE <---> CPU
		 |
		 +--> BE <---> Codec
		      (B)	(b)

<DT>
	card2-sound {
		...
		links = <fe, be>; /* (A) (B) */
	};

	dpcm {
		/* FE */
		ports@0 {
			/* (A) */
			fe: port { fe_ep: endpoint { remote-endpoint = <&cpu_ep>; } };
		};
		/* BE */
		ports@1 {
			/* (B) */
			be: port {
				convert-rate = <44100>; /* This patch enables this */
				be_ep: endpoint { remote-endpoint = <&codec_ep>; }
			};
		};
	};

	cpu {
		/* CPU (a) */
		port { cpu_ep: endpoint { remote-endpoint = <&fe_ep>; } };
	};

	codec {
		/* Codec (b) */
		port {
			convert-rate = <48000>; /* (B) settings will be over written here */
			codec_ep: endpoint { remote-endpoint = <&be_ep>; }
		};
	};

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/generic/audio-graph-card2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index 8ac6df645ee6..e34c3433d354 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -849,7 +849,8 @@ int audio_graph2_link_dpcm(struct asoc_simple_priv *priv,
 			goto err;
 	}
 
-	graph_parse_convert(rep, dai_props);
+	graph_parse_convert(ep,  dai_props); /* at node of <dpcm> */
+	graph_parse_convert(rep, dai_props); /* at node of <CPU/Codec> */
 
 	snd_soc_dai_link_set_capabilities(dai_link);
 
-- 
2.25.1


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

* Re: [PATCH 0/3] ASoC: simpe-card/audio-graph fixups
  2022-11-01  4:21 [PATCH 0/3] ASoC: simpe-card/audio-graph fixups Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2022-11-01  4:22 ` [PATCH 3/3] ASoC: audio-graph-card2: check also dpcm node for convert-xxx Kuninori Morimoto
@ 2022-11-10 17:55 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-11-10 17:55 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA

On Tue, 1 Nov 2022 04:21:18 +0000, Kuninori Morimoto wrote:
> These are simpe-card/audio-graph fixup patches.
> 
> Kuninori Morimoto (3):
>   ASoC: simple-card-utils: remove asoc_simple_convert_fixup()
>   ASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer)
>   ASoC: audio-graph-card2: check also dpcm node for convert-xxx
> 
> [...]

Applied to

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

Thanks!

[1/3] ASoC: simple-card-utils: remove asoc_simple_convert_fixup()
      commit: 5c065eaf445d14e70cbdb1da75e12567c7ae9b91
[2/3] ASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer)
      commit: 2dc025aba7fbebd6c6f3a05bc3530af31776a6fa
[3/3] ASoC: audio-graph-card2: check also dpcm node for convert-xxx
      commit: 8f5979833b45b318d0971f384de3fb17924042f0

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

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

end of thread, other threads:[~2022-11-10 17:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01  4:21 [PATCH 0/3] ASoC: simpe-card/audio-graph fixups Kuninori Morimoto
2022-11-01  4:21 ` [PATCH 1/3] ASoC: simple-card-utils: remove asoc_simple_convert_fixup() Kuninori Morimoto
2022-11-01  4:22 ` [PATCH 2/3] ASoC: audio-graph-card2-custom-sample.dtsi: add convert-rate for DPCM (MIXer) Kuninori Morimoto
2022-11-01  4:22 ` [PATCH 3/3] ASoC: audio-graph-card2: check also dpcm node for convert-xxx Kuninori Morimoto
2022-11-10 17:55 ` [PATCH 0/3] ASoC: simpe-card/audio-graph fixups 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.