瀏覽代碼

ALSA: Add params_set_format helper

Add a helper to set pcm format directly from params

Signed-off-by: Fang, Yang A <yang.a.fang@intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Fang, Yang A 10 年之前
父節點
當前提交
052a9f6982
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      include/sound/pcm_params.h

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