Skip to content

Commit

Permalink
ALSA: Add params_width() helpers
Browse files Browse the repository at this point in the history
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 <broonie@linaro.org>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Mark Brown committed Dec 30, 2013
1 parent 6ce4eac commit 8c5178f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/sound/pcm_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 8c5178f

Please sign in to comment.