From: Fang, Yang A Date: Mon, 9 Feb 2015 08:18:11 +0000 (-0800) Subject: ALSA: Add params_set_format helper X-Git-Tag: v5.15~15866^2~14^2~10^2~44 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=052a9f698268e606ca01eb1ce2a672e548f2ce11;p=platform%2Fkernel%2Flinux-starfive.git ALSA: Add params_set_format helper Add a helper to set pcm format directly from params Signed-off-by: Fang, Yang A Reviewed-by: Takashi Iwai Signed-off-by: Mark Brown --- diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 3c45f39..c704357 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h @@ -366,4 +366,11 @@ static inline int params_physical_width(const struct snd_pcm_hw_params *p) return snd_pcm_format_physical_width(params_format(p)); } +static inline void +params_set_format(struct snd_pcm_hw_params *p, snd_pcm_format_t fmt) +{ + snd_mask_set(hw_param_mask(p, SNDRV_PCM_HW_PARAM_FORMAT), + (__force int)fmt); +} + #endif /* __SOUND_PCM_PARAMS_H */