소스 검색

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>
Mark Brown 11 년 전
부모
커밋
8c5178fca4
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      include/sound/pcm_params.h

+ 12 - 0
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 */