ASoC: Add BCLK calculation utility for TDM mode too
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 19 Nov 2009 11:36:10 +0000 (11:36 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 25 Nov 2009 19:55:46 +0000 (19:55 +0000)
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc.h
sound/soc/soc-utils.c

index 13b117aac5d9bdb2ad328c3df75af4dba1c79201..0d7718f9280db3e00e3da7e4232fa231510e0673 100644 (file)
@@ -230,6 +230,7 @@ int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid);
 /* Utility functions to get clock rates from various things */
 int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
 int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params);
+int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots);
 int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms);
 
 /* set runtime hw params */
index b16aaaeb0aabbbed7eccbe6bf397a815af8f6802..1d07b931f3d8993d6d6844e4d2cd2a520e2cbced 100644 (file)
@@ -54,6 +54,12 @@ int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params)
 }
 EXPORT_SYMBOL_GPL(snd_soc_params_to_frame_size);
 
+int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots)
+{
+       return fs * snd_soc_calc_frame_size(sample_size, channels, tdm_slots);
+}
+EXPORT_SYMBOL_GPL(snd_soc_calc_bclk);
+
 int snd_soc_params_to_bclk(struct snd_pcm_hw_params *params)
 {
        int ret;