linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next v2 8/9] ASoC: rsnd: ssi: Request dedicated dma channels for busif0 to 7
@ 2018-10-03  9:01 jiada_wang
  2018-10-04  1:12 ` Kuninori Morimoto
  0 siblings, 1 reply; 3+ messages in thread
From: jiada_wang @ 2018-10-03  9:01 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, kuninori.morimoto.gx
  Cc: alsa-devel, linux-kernel, jiada_wang

From: Jiada Wang <jiada_wang@mentor.com>

Currently ssi driver only request dma channel for SSI_0,
which is used to transfer data to/from busif0.

But in GEN3 busif1 to busif7 also maybe used, dedicated dma channels
are requested for data transfer through these busif.

Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
---
 sound/soc/sh/rcar/ssi.c | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)

diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 3adcc4f778f7..992aeac09e76 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -76,6 +76,8 @@
 
 #define SSI_NAME "ssi"
 
+#define SSI_DMA_NAME_SIZE	10
+
 struct rsnd_ssi {
 	struct rsnd_mod mod;
 
@@ -938,12 +940,28 @@ static struct dma_chan *rsnd_ssi_dma_req(struct rsnd_dai_stream *io,
 {
 	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
 	int is_play = rsnd_io_is_play(io);
-	char *name;
+	char name[SSI_DMA_NAME_SIZE];
 
-	if (rsnd_ssi_use_busif(io))
-		name = is_play ? "rxu" : "txu";
-	else
-		name = is_play ? "rx" : "tx";
+	if (rsnd_ssi_use_busif(io)) {
+		if (is_play)
+			snprintf(name, SSI_DMA_NAME_SIZE, "rxu");
+		else
+			snprintf(name, SSI_DMA_NAME_SIZE, "txu");
+
+		if (rsnd_is_gen3(priv)) {
+			/*
+			 * Gen3 supports to use all available BUSIF
+			 */
+			int busif = rsnd_ssi_get_busif(io);
+
+			snprintf(name, SSI_DMA_NAME_SIZE, "%s%d", name, busif);
+		}
+	} else {
+		if (is_play)
+			snprintf(name, SSI_DMA_NAME_SIZE, "rx");
+		else
+			snprintf(name, SSI_DMA_NAME_SIZE, "tx");
+	}
 
 	return rsnd_dma_request_channel(rsnd_ssi_of_node(priv),
 					mod, name);
-- 
2.17.0


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

* Re: [PATCH linux-next v2 8/9] ASoC: rsnd: ssi: Request dedicated dma channels for busif0 to 7
  2018-10-03  9:01 [PATCH linux-next v2 8/9] ASoC: rsnd: ssi: Request dedicated dma channels for busif0 to 7 jiada_wang
@ 2018-10-04  1:12 ` Kuninori Morimoto
  2018-10-04  3:00   ` Jiada Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Kuninori Morimoto @ 2018-10-04  1:12 UTC (permalink / raw)
  To: jiada_wang; +Cc: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel


Hi Jiada

Thank you for your patch

> Currently ssi driver only request dma channel for SSI_0,
> which is used to transfer data to/from busif0.
> 
> But in GEN3 busif1 to busif7 also maybe used, dedicated dma channels
> are requested for data transfer through these busif.
> 
> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
> ---
(snip)
> +	if (rsnd_ssi_use_busif(io)) {
> +		if (is_play)
> +			snprintf(name, SSI_DMA_NAME_SIZE, "rxu");
> +		else
> +			snprintf(name, SSI_DMA_NAME_SIZE, "txu");
> +
> +		if (rsnd_is_gen3(priv)) {
> +			/*
> +			 * Gen3 supports to use all available BUSIF
> +			 */
> +			int busif = rsnd_ssi_get_busif(io);
> +
> +			snprintf(name, SSI_DMA_NAME_SIZE, "%s%d", name, busif);
> +		}

I think unspecified GenX is better idea.
For example, we might want to have same setting on Gen2 in the future.
(and this is not Gen3 HW specific feature
 But yes, we have SW side reason)

How about like this ?
We can keep compatibility, and both Gen2/Gen3 can use it.

	if (rsnd_ssi_use_busif(io)) {
		/*
		 * 1) try to find txu%d/rxu%d first
		 * 2) If can't find it, try to find old txu/rxu
		 */
	}

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

* Re: [PATCH linux-next v2 8/9] ASoC: rsnd: ssi: Request dedicated dma channels for busif0 to 7
  2018-10-04  1:12 ` Kuninori Morimoto
@ 2018-10-04  3:00   ` Jiada Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jiada Wang @ 2018-10-04  3:00 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: lgirdwood, broonie, perex, tiwai, alsa-devel, linux-kernel

Hi Morimoto-san


On 2018/10/04 10:12, Kuninori Morimoto wrote:
> Hi Jiada
>
> Thank you for your patch
>
>> Currently ssi driver only request dma channel for SSI_0,
>> which is used to transfer data to/from busif0.
>>
>> But in GEN3 busif1 to busif7 also maybe used, dedicated dma channels
>> are requested for data transfer through these busif.
>>
>> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
>> ---
> (snip)
>> +	if (rsnd_ssi_use_busif(io)) {
>> +		if (is_play)
>> +			snprintf(name, SSI_DMA_NAME_SIZE, "rxu");
>> +		else
>> +			snprintf(name, SSI_DMA_NAME_SIZE, "txu");
>> +
>> +		if (rsnd_is_gen3(priv)) {
>> +			/*
>> +			 * Gen3 supports to use all available BUSIF
>> +			 */
>> +			int busif = rsnd_ssi_get_busif(io);
>> +
>> +			snprintf(name, SSI_DMA_NAME_SIZE, "%s%d", name, busif);
>> +		}
> I think unspecified GenX is better idea.
> For example, we might want to have same setting on Gen2 in the future.
> (and this is not Gen3 HW specific feature
>   But yes, we have SW side reason)
>
> How about like this ?
> We can keep compatibility, and both Gen2/Gen3 can use it.
>
> 	if (rsnd_ssi_use_busif(io)) {
> 		/*
> 		 * 1) try to find txu%d/rxu%d first
> 		 * 2) If can't find it, try to find old txu/rxu
> 		 */
> 	}
I think this is a good idea, by doing so,
in case GEN2 DT also starts to support different BUSIF,
then no driver side change is required.

I will update accordingly in next version

Thanks,
Jiada


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

end of thread, other threads:[~2018-10-04  3:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03  9:01 [PATCH linux-next v2 8/9] ASoC: rsnd: ssi: Request dedicated dma channels for busif0 to 7 jiada_wang
2018-10-04  1:12 ` Kuninori Morimoto
2018-10-04  3:00   ` Jiada Wang

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).