[alsa-devel] [RFC PATCH] ASoC: fsl-ssi: Add support for CBM_CFS 16/24 bit

Markus Pargmann mpa at pengutronix.de
Tue Jul 29 08:18:14 CEST 2014


Hi,

On Mon, Jul 28, 2014 at 02:46:38PM +0200, Michael Trimarchi wrote:
> Signed-off-by: Michael Trimarchi <michael at amarulasolutions.com>

A commit description what you are doing in this patch and how your setup
looks like would be good.

> ---
>  sound/soc/fsl/fsl_ssi.c | 27 +++++++++++++++++++++++++--
>  1 file changed, 25 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 9bfef55..743e50d 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -724,10 +724,19 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream,
>  		regmap_update_bits(regs, CCSR_SSI_SRCCR, CCSR_SSI_SxCCR_WL_MASK,
>  				wl);
>  
> -	if (!fsl_ssi_is_ac97(ssi_private))
> +	if (!fsl_ssi_is_ac97(ssi_private)) {
> +		u8 i2smode;
> +
> +		if (ssi_private->i2s_mode == (CCSR_SSI_SCR_I2S_MODE_NORMAL |
> +		    CCSR_SSI_SCR_NET) && sample_size >= 24)

This condition seems a bit fragile using the i2s_mode variable.

I don't know about this bitclock master mode, why is this condition
necessary, what is the difference with sample_size >= 24?

Regards,

Markus

> +			i2smode = CCSR_SSI_SCR_I2S_MODE_MASTER;
> +		else
> +			i2smode = ssi_private->i2s_mode;
> +
>  		regmap_update_bits(regs, CCSR_SSI_SCR,
>  				CCSR_SSI_SCR_NET | CCSR_SSI_SCR_I2S_MODE_MASK,
> -				channels == 1 ? 0 : ssi_private->i2s_mode);
> +				channels == 1 ? 0 : i2smode);
> +	}
>  
>  	return 0;
>  }
> @@ -789,6 +798,15 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi_private *ssi_private,
>  					CCSR_SSI_SxCCR_DC_MASK,
>  					CCSR_SSI_SxCCR_DC(2));
>  			break;
> +		case SND_SOC_DAIFMT_CBM_CFS:
> +			ssi_private->i2s_mode |= CCSR_SSI_SCR_I2S_MODE_NORMAL;
> +			regmap_update_bits(regs, CCSR_SSI_STCCR,
> +					CCSR_SSI_SxCCR_DC_MASK,
> +					CCSR_SSI_SxCCR_DC(2));
> +			regmap_update_bits(regs, CCSR_SSI_SRCCR,
> +					CCSR_SSI_SxCCR_DC_MASK,
> +					CCSR_SSI_SxCCR_DC(2));
> +			break;
>  		case SND_SOC_DAIFMT_CBM_CFM:
>  			ssi_private->i2s_mode |= CCSR_SSI_SCR_I2S_MODE_SLAVE;
>  			break;
> @@ -853,6 +871,11 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi_private *ssi_private,
>  	case SND_SOC_DAIFMT_CBM_CFM:
>  		scr &= ~CCSR_SSI_SCR_SYS_CLK_EN;
>  		break;
> +	case SND_SOC_DAIFMT_CBM_CFS:
> +		strcr &= ~CCSR_SSI_STCR_TXDIR;
> +		strcr |= CCSR_SSI_STCR_TFDIR;
> +		scr &= ~CCSR_SSI_SCR_SYS_CLK_EN;
> +		break;
>  	default:
>  		return -EINVAL;
>  	}
> -- 
> 1.8.1.2
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20140729/37670d81/attachment-0001.sig>


More information about the Alsa-devel mailing list