Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c5178fc authored by Mark Brown's avatar Mark Brown
Browse files

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: default avatarMark Brown <broonie@linaro.org>
Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 6ce4eac1
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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 */