Skip to content

Commit 8c5178f

Browse files
committed
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>
1 parent 6ce4eac commit 8c5178f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎include/sound/pcm_params.h‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,4 +354,16 @@ params_period_bytes(const struct snd_pcm_hw_params *p)
354354
params_channels(p)) / 8;
355355
}
356356

357+
static inline int
358+
params_width(const struct snd_pcm_hw_params *p)
359+
{
360+
return snd_pcm_format_width(params_format(p));
361+
}
362+
363+
static inline int
364+
params_physical_width(const struct snd_pcm_hw_params *p)
365+
{
366+
return snd_pcm_format_physical_width(params_format(p));
367+
}
368+
357369
#endif /* __SOUND_PCM_PARAMS_H */

0 commit comments

Comments
 (0)