From: Fang, Yang A Date: Mon, 9 Feb 2015 08:18:11 +0000 (-0800) Subject: ALSA: Add params_set_format helper X-Git-Tag: v4.1-rc1~117^2~1^2~13^2~3^5~13 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=052a9f698268e606ca01eb1ce2a672e548f2ce11;p=karo-tx-linux.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 3c45f3924ba7..c704357775fc 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 */