summaryrefslogtreecommitdiff
path: root/include/sound
diff options
context:
space:
mode:
authorFang, Yang A <yang.a.fang@intel.com>2015-02-09 11:18:11 +0300
committerMark Brown <broonie@kernel.org>2015-02-23 18:43:18 +0300
commit052a9f698268e606ca01eb1ce2a672e548f2ce11 (patch)
tree62d16a8fe8c870ec8ee00b02e3f0890f6099e8d1 /include/sound
parentc517d838eb7d07bbe9507871fab3931deccff539 (diff)
downloadlinux-052a9f698268e606ca01eb1ce2a672e548f2ce11.tar.xz
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>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/pcm_params.h7
1 files changed, 7 insertions, 0 deletions
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 */