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

Commit 052a9f69 authored by Fang, Yang A's avatar Fang, Yang A Committed by Mark Brown
Browse files

ALSA: Add params_set_format helper



Add a helper to set pcm format directly from params

Signed-off-by: default avatarFang, Yang A <yang.a.fang@intel.com>
Reviewed-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent c517d838
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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 */