diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-07-26 06:02:56 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-07-26 11:21:24 -0400 |
commit | b51beb756aaf0770e4fa8bb2cb142888051aa356 (patch) | |
tree | 89d6905997ef2f9094bc9c08d5fc88631a007e44 /include/sound/pcm_params.h | |
parent | 4d7fbdbcb1d563b1822c74da3c9e4aa4523d8d6d (diff) |
ALSA: Make pcm.h self-contained
Move the macros depending on snd_mask_min() and co out of pcm.h into
pcm_params.h. Otherwise using some params_*() macros will give comiple
errors without inclusion of pcm_params.h.
Also use hw_param_interval_c() and hw_param_mask_c() for const pointer.
Reported-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/pcm_params.h')
-rw-r--r-- | include/sound/pcm_params.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h index 85cf1cf4f31a..f494f1e3c900 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) | |||
337 | return 0; | 337 | return 0; |
338 | } | 338 | } |
339 | 339 | ||
340 | #endif /* __SOUND_PCM_PARAMS_H */ | 340 | #define params_access(p) ((__force snd_pcm_access_t)\ |
341 | snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_ACCESS))) | ||
342 | #define params_format(p) ((__force snd_pcm_format_t)\ | ||
343 | snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_FORMAT))) | ||
344 | #define params_subformat(p) \ | ||
345 | snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_SUBFORMAT)) | ||
341 | 346 | ||
347 | static inline unsigned int | ||
348 | params_period_bytes(const struct snd_pcm_hw_params *p) | ||
349 | { | ||
350 | return (params_period_size(p) * | ||
351 | snd_pcm_format_physical_width(params_format(p)) * | ||
352 | params_channels(p)) / 8; | ||
353 | } | ||
354 | |||
355 | #endif /* __SOUND_PCM_PARAMS_H */ | ||