public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bo Shen <voice.shen@atmel.com>
To: Peter Rosin <peda@lysator.liu.se>, <alsa-devel@alsa-project.org>
Cc: Peter Rosin <peda@axentia.se>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ASoC: atmel_ssc_dai: Support SND_SOC_DAIFMT_CBM_CFS on I2S
Date: Fri, 30 Jan 2015 11:49:21 +0800	[thread overview]
Message-ID: <54CAFF41.2060908@atmel.com> (raw)
In-Reply-To: <1422526589-9451-1-git-send-email-peda@lysator.liu.se>

Hi Peter,
   Thanks for you patch.

On 01/29/2015 06:16 PM, Peter Rosin wrote:
> From: Peter Rosin <peda@axentia.se>
>
> Signed-off-by: Peter Rosin <peda@axentia.se>

Acked-by: Bo Shen <voice.shen@atmel.com>

> ---
>   sound/soc/atmel/atmel_ssc_dai.c |   48 +++++++++++++++++++++++++++++++++++++++
>   1 file changed, 48 insertions(+)
>
> diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
> index 3cd70597d109..f55f3aab8bdd 100644
> --- a/sound/soc/atmel/atmel_ssc_dai.c
> +++ b/sound/soc/atmel/atmel_ssc_dai.c
> @@ -485,6 +485,54 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream,
>   			| SSC_BF(TFMR_DATLEN, (bits - 1));
>   		break;
>
> +	case SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFS:
> +		/* I2S format, CODEC supplies BCLK, SSC supplies LRCLK. */
> +		if (bits > 16 && !ssc->pdata->has_fslen_ext) {
> +			dev_err(dai->dev,
> +				"sample size %d is too large for SSC device\n",
> +				bits);
> +			return -EINVAL;
> +		}
> +
> +		fslen_ext = (bits - 1) / 16;
> +		fslen = (bits - 1) % 16;
> +
> +		rcmr =	  SSC_BF(RCMR_PERIOD, ssc_p->rcmr_period)
> +			| SSC_BF(RCMR_STTDLY, START_DELAY)
> +			| SSC_BF(RCMR_START, SSC_START_FALLING_RF)
> +			| SSC_BF(RCMR_CKI, SSC_CKI_RISING)
> +			| SSC_BF(RCMR_CKO, SSC_CKO_NONE)
> +			| SSC_BF(RCMR_CKS, ssc->clk_from_rk_pin ?
> +					   SSC_CKS_PIN : SSC_CKS_CLOCK);
> +
> +		rfmr =    SSC_BF(RFMR_FSLEN_EXT, fslen_ext)
> +			| SSC_BF(RFMR_FSEDGE, SSC_FSEDGE_POSITIVE)
> +			| SSC_BF(RFMR_FSOS, SSC_FSOS_NEGATIVE)
> +			| SSC_BF(RFMR_FSLEN, fslen)
> +			| SSC_BF(RFMR_DATNB, (channels - 1))
> +			| SSC_BIT(RFMR_MSBF)
> +			| SSC_BF(RFMR_LOOP, 0)
> +			| SSC_BF(RFMR_DATLEN, (bits - 1));
> +
> +		tcmr =	  SSC_BF(TCMR_PERIOD, ssc_p->tcmr_period)
> +			| SSC_BF(TCMR_STTDLY, START_DELAY)
> +			| SSC_BF(TCMR_START, SSC_START_FALLING_RF)
> +			| SSC_BF(TCMR_CKI, SSC_CKI_FALLING)
> +			| SSC_BF(TCMR_CKO, SSC_CKO_NONE)
> +			| SSC_BF(TCMR_CKS, ssc->clk_from_rk_pin ?
> +					   SSC_CKS_CLOCK : SSC_CKS_PIN);
> +
> +		tfmr =    SSC_BF(TFMR_FSLEN_EXT, fslen_ext)
> +			| SSC_BF(TFMR_FSEDGE, SSC_FSEDGE_NEGATIVE)
> +			| SSC_BF(TFMR_FSDEN, 0)
> +			| SSC_BF(TFMR_FSOS, SSC_FSOS_NEGATIVE)
> +			| SSC_BF(TFMR_FSLEN, fslen)
> +			| SSC_BF(TFMR_DATNB, (channels - 1))
> +			| SSC_BIT(TFMR_MSBF)
> +			| SSC_BF(TFMR_DATDEF, 0)
> +			| SSC_BF(TFMR_DATLEN, (bits - 1));
> +		break;
> +
>   	case SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_CBS_CFS:
>   		/*
>   		 * DSP/PCM Mode A format, SSC provides BCLK and LRC clocks.
>

Best Regards,
Bo Shen

      reply	other threads:[~2015-01-30  3:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 10:16 [PATCH] ASoC: atmel_ssc_dai: Support SND_SOC_DAIFMT_CBM_CFS on I2S Peter Rosin
2015-01-30  3:49 ` Bo Shen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54CAFF41.2060908@atmel.com \
    --to=voice.shen@atmel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peda@axentia.se \
    --cc=peda@lysator.liu.se \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox