public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Michal Bachraty <michal.bachraty@streamunlimited.com>
Cc: perex@perex.cz, tiwai@suse.de, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, marek.belisko@streamunlimited.com,
	broonie@opensource.wolfsonmicro.com, lgirdwood@gmail.com
Subject: Re: [alsa-devel] [PATCH 2/2] ALSA: ASoc: davinci-mcasp: Add Support BCLK-to-LRCLK ratio for TDM modes
Date: Fri, 19 Apr 2013 19:38:01 +0200	[thread overview]
Message-ID: <517180F9.8060601@gmail.com> (raw)
In-Reply-To: <1366378124-14368-1-git-send-email-michal.bachraty@streamunlimited.com>

On 19.04.2013 15:28, Michal Bachraty wrote:
> For TDM mode, BCLK-to-LCLK ratio is computed as (tdm_slots) x (word_length).
> I2S mode is only subset of TDM mode with specific tdm_slots = 2 channels.
> Also bclk_lrclk_ratio can be greater than 255, therefore u16 need to be used.
> 
> Signed-off-by: Michal Bachraty <michal.bachraty@streamunlimited.com>

Acked-by: Daniel Mack <zonque@gmail.com>

> ---
>  sound/soc/davinci/davinci-mcasp.c |    7 ++++---
>  sound/soc/davinci/davinci-mcasp.h |    2 +-
>  2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
> index 63633e9..d54e0d9 100644
> --- a/sound/soc/davinci/davinci-mcasp.c
> +++ b/sound/soc/davinci/davinci-mcasp.c
> @@ -636,11 +636,12 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
>  	 * callback, take it into account here. That allows us to for example
>  	 * send 32 bits per channel to the codec, while only 16 of them carry
>  	 * audio payload.
> -	 * The clock ratio is given for a full period of data (both left and
> -	 * right channels), so it has to be divided by 2.
> +	 * The clock ratio is given for a full period of data (for I2S format
> +	 * both left and right channels), so it has to be divided by number of
> +	 * tdm-slots (for I2S - divided by 2).
>  	 */
>  	if (dev->bclk_lrclk_ratio)
> -		word_length = dev->bclk_lrclk_ratio / 2;
> +		word_length = dev->bclk_lrclk_ratio / dev->tdm_slots;
>  
>  	/* mapping of the XSSZ bit-field as described in the datasheet */
>  	fmt = (word_length >> 1) - 1;
> diff --git a/sound/soc/davinci/davinci-mcasp.h b/sound/soc/davinci/davinci-mcasp.h
> index 0edd3b5..a9ac0c1 100644
> --- a/sound/soc/davinci/davinci-mcasp.h
> +++ b/sound/soc/davinci/davinci-mcasp.h
> @@ -38,7 +38,7 @@ struct davinci_audio_dev {
>  	u8	num_serializer;
>  	u8	*serial_dir;
>  	u8	version;
> -	u8	bclk_lrclk_ratio;
> +	u16	bclk_lrclk_ratio;
>  
>  	/* McASP FIFO related */
>  	u8	txnumevt;
> 


  reply	other threads:[~2013-04-19 17:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 13:28 [PATCH 2/2] ALSA: ASoc: davinci-mcasp: Add Support BCLK-to-LRCLK ratio for TDM modes Michal Bachraty
2013-04-19 17:38 ` Daniel Mack [this message]
2013-04-23 13:51 ` Mark Brown

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=517180F9.8060601@gmail.com \
    --to=zonque@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.belisko@streamunlimited.com \
    --cc=michal.bachraty@streamunlimited.com \
    --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