diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-11-10 11:08:04 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-11-12 11:45:48 -0500 |
commit | 7aae816dae150caad8880357e42303935c0179a8 (patch) | |
tree | e9adbb85d828e3e9eca5feca7afb6c71a4491f26 /include/sound/soc.h | |
parent | a68cc8daebdd8ba7fe457ab4b2a0ccdf3cedc9f8 (diff) |
ASoC: Add bit clock rate calculator utility functions
Many devices need to calculate the bit clock rate desired to
work out the clock configuration required for the device.
Provide utility functions to do this using both hw_params
structures and raw numbers.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'include/sound/soc.h')
-rw-r--r-- | include/sound/soc.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 7f3a4c5028da..310a21949a3e 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -227,6 +227,11 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | |||
227 | void snd_soc_free_pcms(struct snd_soc_device *socdev); | 227 | void snd_soc_free_pcms(struct snd_soc_device *socdev); |
228 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); | 228 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); |
229 | 229 | ||
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); | ||
232 | int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); | ||
233 | int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms); | ||
234 | |||
230 | /* set runtime hw params */ | 235 | /* set runtime hw params */ |
231 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, | 236 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, |
232 | const struct snd_pcm_hardware *hw); | 237 | const struct snd_pcm_hardware *hw); |