Re: [PATCH] ASoC: rcar: adg: correct TIMSEL setting for SSI9

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Eugeniu

Thank you for the patch

> Timing select register for SRC and CMD is by default
> referring to the corresponding SSI word select.
> The calculation rule from HW spec skips SSI8, which has
> no clock connection.
> 
> 0110: ssi_ws0
> 0111: ssi_ws1
> 1000: ssi_ws2
> 1001: ssi_ws3
> 1010: ssi_ws4
> 1011: ssi_ws5
> 1100: ssi_ws6
> 1101: ssi_ws7
> <GAP>
> 1110: ssi_ws9
> 1111: Setting prohibited
> 
> The driver does not currently reflect that GAP, leading to
> prohibited timsel value 1111 (0xf) for SSI9:
> 
> [21.695055] rcar_sound ec500000.sound: b adg[0]-CMDOUT_TIMSEL (32):00000f00/00000f1f
> 
> Correct the timsel assignment.
> 
> Fixes: 629509c5bc478c ("ASoC: rsnd: add Gen2 SRC and DMAEngine support")
> Signed-off-by: Andreas Pape <Andreas.Pape4@xxxxxxxxx>
> Signed-off-by: Yeswanth Rayapati <yeswanth.rayapati@xxxxxxxxxxxx>
> [erosca: minor improvements in commit description]
> Signed-off-by: Eugeniu Rosca <eugeniu.rosca@xxxxxxxxx>
> ---
>  sound/soc/sh/rcar/adg.c | 25 ++++++++++++++++++++-----
>  1 file changed, 20 insertions(+), 5 deletions(-)
> 
> diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
> index 230c48648af359..137db9feab495e 100644
> --- a/sound/soc/sh/rcar/adg.c
> +++ b/sound/soc/sh/rcar/adg.c
> @@ -95,25 +95,40 @@ static u32 rsnd_adg_ssi_ws_timing_gen2(struct rsnd_dai_stream *io)
>  {
>  	struct rsnd_mod *ssi_mod = rsnd_io_to_mod_ssi(io);
>  	int id = rsnd_mod_id(ssi_mod);
> -	int ws = id;
> +
> +	u8 ssi_ws[] = {
> +		0x6, /* ssi0 */
> +		0x7, /* ssi1 */
> +		0x8, /* ssi2 */
> +		0x9, /* ssi3 */
> +		0xa, /* ssi4 */
> +		0xb, /* ssi5 */
> +		0xc, /* ssi6 */
> +		0xd, /* ssi7 */
> +		0xf, /* INVALID */
> +		0xe, /* ssi9 */
> +	};
>  
>  	if (rsnd_ssi_is_pin_sharing(io)) {
>  		switch (id) {
>  		case 1:
>  		case 2:
>  		case 9:
> -			ws = 0;
> +			id = 0;
>  			break;
>  		case 4:
> -			ws = 3;
> +			id = 3;
>  			break;
>  		case 8:
> -			ws = 7;
> +			id = 7;
>  			break;
>  		}
>  	}
>  
> -	return (0x6 + ws) << 8;
> +	if (id > 9)
> +		return 0xf << 8;
> +	else
> +		return ssi_ws[id] << 8;
>  }

I don't think we want to have table for this purpose.
SSIx special handling exist every where on this IP.

How about below ? It is more simple.

---------------------------------
diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
index 230c48648af3..bbc7845c68b3 100644
--- a/sound/soc/sh/rcar/adg.c
+++ b/sound/soc/sh/rcar/adg.c
@@ -113,6 +113,13 @@ static u32 rsnd_adg_ssi_ws_timing_gen2(struct rsnd_dai_stream *io)
 		}
 	}
 
+	/*
+	 * SSI8 is not connected to ADG.
+	 * Thus SSI9 is using 8
+	 */
+	if (id == 9)
+		ws = 8;
+
 	return (0x6 + ws) << 8;
 }
---------------------------------



Thank you for your help !!

Best regards
---
Renesas Electronics
Ph.D. Kuninori Morimoto




[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux