aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-12-24 07:24:28 -0500
committerMark Brown <broonie@linaro.org>2013-12-30 07:19:26 -0500
commit8c5178fca4ce5a57711ea14b807648e19b105d0e (patch)
tree03f1adde517d1292f4e87f49bff21e2dfd88c774
parent6ce4eac1f600b34f2f7f58f9cd8f0503d79e42ae (diff)
ALSA: Add params_width() helpers
Add helpers for obtaining the width of a format directly from params since this is expected to become a common operation in ASoC. Signed-off-by: Mark Brown <broonie@linaro.org> Reviewed-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--include/sound/pcm_params.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index 37ae12e0ab06..6b1c78f05fab 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -354,4 +354,16 @@ params_period_bytes(const struct snd_pcm_hw_params *p)
354 params_channels(p)) / 8; 354 params_channels(p)) / 8;
355} 355}
356 356
357static inline int
358params_width(const struct snd_pcm_hw_params *p)
359{
360 return snd_pcm_format_width(params_format(p));
361}
362
363static inline int
364params_physical_width(const struct snd_pcm_hw_params *p)
365{
366 return snd_pcm_format_physical_width(params_format(p));
367}
368
357#endif /* __SOUND_PCM_PARAMS_H */ 369#endif /* __SOUND_PCM_PARAMS_H */