From: Mark Brown Date: Tue, 24 Dec 2013 12:24:28 +0000 (+0000) Subject: ALSA: Add params_width() helpers X-Git-Tag: v3.14-rc1~16^2~11^2^2^18~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8c5178fca4ce5a57711ea14b807648e19b105d0e;p=kernel%2Fkernel-generic.git 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 Reviewed-by: Takashi Iwai --- diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 37ae12e..6b1c78f 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) params_channels(p)) / 8; } +static inline int +params_width(const struct snd_pcm_hw_params *p) +{ + return snd_pcm_format_width(params_format(p)); +} + +static inline int +params_physical_width(const struct snd_pcm_hw_params *p) +{ + return snd_pcm_format_physical_width(params_format(p)); +} + #endif /* __SOUND_PCM_PARAMS_H */