diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-11-19 06:36:10 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-11-25 14:55:46 -0500 |
commit | c0fa59df7214e546f8a37bc677867ac7b67b5c93 (patch) | |
tree | 80d1e2e8861f5b84d61d195bf880933c0ace727d | |
parent | 2449ae85e3c88ef27853aef0d19772149e269ae7 (diff) |
ASoC: Add BCLK calculation utility for TDM mode too
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | include/sound/soc.h | 1 | ||||
-rw-r--r-- | sound/soc/soc-utils.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 13b117aac5d9..0d7718f9280d 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -230,6 +230,7 @@ int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); | |||
230 | /* Utility functions to get clock rates from various things */ | 230 | /* Utility functions to get clock rates from various things */ |
231 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | 231 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); |
232 | int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); | 232 | int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); |
233 | int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots); | ||
233 | int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms); | 234 | int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms); |
234 | 235 | ||
235 | /* set runtime hw params */ | 236 | /* set runtime hw params */ |
diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c index b16aaaeb0aab..1d07b931f3d8 100644 --- a/sound/soc/soc-utils.c +++ b/sound/soc/soc-utils.c | |||
@@ -54,6 +54,12 @@ int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params) | |||
54 | } | 54 | } |
55 | EXPORT_SYMBOL_GPL(snd_soc_params_to_frame_size); | 55 | EXPORT_SYMBOL_GPL(snd_soc_params_to_frame_size); |
56 | 56 | ||
57 | int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots) | ||
58 | { | ||
59 | return fs * snd_soc_calc_frame_size(sample_size, channels, tdm_slots); | ||
60 | } | ||
61 | EXPORT_SYMBOL_GPL(snd_soc_calc_bclk); | ||
62 | |||
57 | int snd_soc_params_to_bclk(struct snd_pcm_hw_params *params) | 63 | int snd_soc_params_to_bclk(struct snd_pcm_hw_params *params) |
58 | { | 64 | { |
59 | int ret; | 65 | int ret; |