X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=include%2Fsound%2Fpcm_params.h;h=f494f1e3c900ef775a56909e2baeb6e99bd120ca;hb=60ad4466821a96913a9b567115e194ed1087c2d7;hp=85cf1cf4f31a7a202e8e5faa91f992f3aa1a90ef;hpb=62ed948cb1405fe95d61d8c6445c102e0c9da0a6;p=~andy%2Flinux diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 85cf1cf4f31..f494f1e3c90 100644 --- a/include/sound/pcm_params.h +++ b/include/sound/pcm_params.h @@ -337,5 +337,19 @@ static inline unsigned int sub(unsigned int a, unsigned int b) return 0; } -#endif /* __SOUND_PCM_PARAMS_H */ +#define params_access(p) ((__force snd_pcm_access_t)\ + snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_ACCESS))) +#define params_format(p) ((__force snd_pcm_format_t)\ + snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_FORMAT))) +#define params_subformat(p) \ + snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_SUBFORMAT)) +static inline unsigned int +params_period_bytes(const struct snd_pcm_hw_params *p) +{ + return (params_period_size(p) * + snd_pcm_format_physical_width(params_format(p)) * + params_channels(p)) / 8; +} + +#endif /* __SOUND_PCM_PARAMS_H */