Message ID | 1423469892-48667-1-git-send-email-yang.a.fang@intel.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 052a9f698268e606ca01eb1ce2a672e548f2ce11 |
Headers | show |
At Mon, 9 Feb 2015 00:18:11 -0800, yang.a.fang@intel.com wrote: > > From: "Fang, Yang A" <yang.a.fang@intel.com> > > Add a helper to set pcm format directly from params > > Signed-off-by: Fang, Yang A <yang.a.fang@intel.com> Mark, feel free to take my ack when you apply these patches. Reviewed-by: Takashi Iwai <tiwai@suse.de> thanks, Takashi > --- > include/sound/pcm_params.h | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h > index 6b1c78f..f41a2d7 100644 > --- a/include/sound/pcm_params.h > +++ b/include/sound/pcm_params.h > @@ -366,4 +366,11 @@ 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 */ > -- > 1.7.9.5 >
On Mon, Feb 09, 2015 at 11:50:27AM +0100, Takashi Iwai wrote: > Mark, feel free to take my ack when you apply these patches. > Reviewed-by: Takashi Iwai <tiwai@suse.de> OK, it'll be after the merge window now.
On Mon, Feb 09, 2015 at 12:18:11AM -0800, yang.a.fang@intel.com wrote: > From: "Fang, Yang A" <yang.a.fang@intel.com> > > Add a helper to set pcm format directly from params Applied both, thanks.
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 6b1c78f..f41a2d7 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h @@ -366,4 +366,11 @@ 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 */