lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 19 Apr 2013 19:38:01 +0200
From:	Daniel Mack <zonque@...il.com>
To:	Michal Bachraty <michal.bachraty@...eamunlimited.com>
CC:	perex@...ex.cz, tiwai@...e.de, alsa-devel@...a-project.org,
	linux-kernel@...r.kernel.org, marek.belisko@...eamunlimited.com,
	broonie@...nsource.wolfsonmicro.com, lgirdwood@...il.com
Subject: Re: [alsa-devel] [PATCH 2/2] ALSA: ASoc: davinci-mcasp: Add Support
 BCLK-to-LRCLK ratio for TDM modes

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@...eamunlimited.com>

Acked-by: Daniel Mack <zonque@...il.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;
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ