From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] ASoC: Use snd_pcm_format_width() in snd_soc_params_to_frame_size()
Date: Tue, 01 Feb 2011 14:30:35 +0000 [thread overview]
Message-ID: <1296570635.3327.40.camel@odin> (raw)
In-Reply-To: <1296567050-32607-1-git-send-email-broonie@opensource.wolfsonmicro.com>
On Tue, 2011-02-01 at 13:30 +0000, Mark Brown wrote:
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
> ---
> sound/soc/soc-utils.c | 23 +++--------------------
> 1 files changed, 3 insertions(+), 20 deletions(-)
>
> diff --git a/sound/soc/soc-utils.c b/sound/soc/soc-utils.c
> index 1d07b93..3f45e6a 100644
> --- a/sound/soc/soc-utils.c
> +++ b/sound/soc/soc-utils.c
> @@ -28,26 +28,9 @@ int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params)
> {
> int sample_size;
>
> - switch (params_format(params)) {
> - case SNDRV_PCM_FORMAT_S16_LE:
> - case SNDRV_PCM_FORMAT_S16_BE:
> - sample_size = 16;
> - break;
> - case SNDRV_PCM_FORMAT_S20_3LE:
> - case SNDRV_PCM_FORMAT_S20_3BE:
> - sample_size = 20;
> - break;
> - case SNDRV_PCM_FORMAT_S24_LE:
> - case SNDRV_PCM_FORMAT_S24_BE:
> - sample_size = 24;
> - break;
> - case SNDRV_PCM_FORMAT_S32_LE:
> - case SNDRV_PCM_FORMAT_S32_BE:
> - sample_size = 32;
> - break;
> - default:
> - return -ENOTSUPP;
> - }
> + sample_size = snd_pcm_format_width(params_format(params));
> + if (sample_size < 0)
> + return sample_size;
>
> return snd_soc_calc_frame_size(sample_size, params_channels(params),
> 1);
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
prev parent reply other threads:[~2011-02-01 14:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-01 13:30 [PATCH] ASoC: Use snd_pcm_format_width() in snd_soc_params_to_frame_size() Mark Brown
2011-02-01 14:30 ` Liam Girdwood [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1296570635.3327.40.camel@odin \
--to=lrg@slimlogic.co.uk \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=patches@opensource.wolfsonmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.