diff mbox series

[linux-next,01/10] ASoC: rsnd: ssi: Request dedicated dma channels for busif1 to 7

Message ID 20180927050407.17765-2-jiada_wang@mentor.com (mailing list archive)
State New, archived
Headers show
Series ASoC: rsnd: support to set different busif | expand

Commit Message

Wang, Jiada Sept. 27, 2018, 5:03 a.m. UTC
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 since busif1 to busif7 also maybe used, dedicated dma channels
are request for data transfer between these busif.

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

Comments

Kuninori Morimoto Sept. 28, 2018, 12:08 a.m. UTC | #1
Hi Jiada
Cc: linux-renesas-soc ML

Thank you for your patch

> 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 since busif1 to busif7 also maybe used, dedicated dma channels
> are request for data transfer between these busif.
> 
> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
> ---
(snip)
> @@ -938,12 +940,20 @@ 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;
> +	int busif = rsnd_ssi_get_busif(io);
> +	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%d", busif);
> +		else
> +			snprintf(name, SSI_DMA_NAME_SIZE, "txu%d", busif);
> +	} else {
> +		if (is_play)
> +			snprintf(name, SSI_DMA_NAME_SIZE, "rx");
> +		else
> +			snprintf(name, SSI_DMA_NAME_SIZE, "tx");
> +	}

Unfortunately, this patch breaks "git bisect", and Gen2 platforms.
We need to keep existing "rxu/txu" more. Please consider compatibility.
# we can remove it 2 or 3 version later ?

If the commit which has this patch, but doesn't have [02/xx] or later,
it can't use BUSIF.

And your patch doesn't care Gen2 series.
DT compatibility is very sensitive...
Wang, Jiada Oct. 2, 2018, 7:52 a.m. UTC | #2
Hi Morimoto-san


On 2018/09/28 9:08, Kuninori Morimoto wrote:
> Hi Jiada
> Cc: linux-renesas-soc ML
>
> Thank you for your patch
>
>> 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 since busif1 to busif7 also maybe used, dedicated dma channels
>> are request for data transfer between these busif.
>>
>> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
>> ---
> (snip)
>> @@ -938,12 +940,20 @@ 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;
>> +	int busif = rsnd_ssi_get_busif(io);
>> +	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%d", busif);
>> +		else
>> +			snprintf(name, SSI_DMA_NAME_SIZE, "txu%d", busif);
>> +	} else {
>> +		if (is_play)
>> +			snprintf(name, SSI_DMA_NAME_SIZE, "rx");
>> +		else
>> +			snprintf(name, SSI_DMA_NAME_SIZE, "tx");
>> +	}
> Unfortunately, this patch breaks "git bisect", and Gen2 platforms.
> We need to keep existing "rxu/txu" more. Please consider compatibility.
> # we can remove it 2 or 3 version later ?
>
> If the commit which has this patch, but doesn't have [02/xx] or later,
> it can't use BUSIF.
>
> And your patch doesn't care Gen2 series.
> DT compatibility is very sensitive...
Thanks for your review comments, I will send out v2 patch set to take 
care of GEN2 series,
and move this patch after other DT related patches

Thanks,
Jiada
diff mbox series

Patch

diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 3adcc4f778f7..75a3d15084c2 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,20 @@  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;
+	int busif = rsnd_ssi_get_busif(io);
+	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%d", busif);
+		else
+			snprintf(name, SSI_DMA_NAME_SIZE, "txu%d", 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);