ALSA: Add params_width() helpers
PATCH 1/1 ALSA: Add params_width() helpers
From: Mark Brown <[email protected]>
Add helpers for obtaining the width of a format directly from params since this is expected to become a common operation in ASoC.
Signed-off-by Mark Brown <[email protected]>
--- include/sound/pcm_params.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)
include/sound/pcm_params.h +12 -0
@@ -354,4 +354,16 @@ params_period_bytes(const struct snd_pcm_hw_params *p) params_channels(p)) / 8; } +static inline int +params_width (const struct snd_pcm_hw_params *p) +{ +return snd_pcm_format_width (params_format (p)); +} + +static inline int +params_physical_width (const struct snd_pcm_hw_params *p) +{ +return snd_pcm_format_physical_width (params_format (p)); +} +#endif /* __SOUND_PCM_PARAMS_H */
Signature · 1 line
1.8.5.2
At Tue, 24 Dec 2013 12:24:28 +0000,
Quoted 7 lines · Mark Brown
From: Mark Brown <[email protected]>
Add helpers for obtaining the width of a format directly from params since this is expected to become a common operation in ASoC.
Signed-off-by Mark Brown <[email protected]>
Looks good. Since you seem to have already codes using these helpers, feel free to take it via your tree with my ack, then I'll pull yours later.
Reviewed-by Takashi Iwai <[email protected]>
thanks,
Takashi
Quoted 28 lines
--- include/sound/pcm_params.h | 12 ++++++++++++ 1 file changed, 12 insertions(+)include/sound/pcm_params.h +12
-0@@ -354,4 +354,16 @@ params_period_bytes(const struct snd_pcm_hw_params *p) params_channels(p)) / 8; } +static inline int +params_width (const struct snd_pcm_hw_params *p) +{ +return snd_pcm_format_width (params_format (p)); +} + +static inline int +params_physical_width (const struct snd_pcm_hw_params *p) +{ +return snd_pcm_format_physical_width (params_format (p)); +} +#endif /* __SOUND_PCM_PARAMS_H */ Signature · 1 line
1.8.5.2