alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	alsa-devel@alsa-project.org
Subject: [PATCH 4/5] ASoC: wm8960: add support for big-endian audio samples
Date: Fri, 14 Sep 2012 16:14:37 -0500	[thread overview]
Message-ID: <1347657278-25295-4-git-send-email-timur@freescale.com> (raw)
In-Reply-To: <1347657278-25295-1-git-send-email-timur@freescale.com>

PowerPC ASoC drivers frequently use the _BE variants of the SNDRV_PCM_FORMAT
macros, so we need to look for those as well.

Signed-off-by: Timur Tabi <timur@freescale.com>
---
 sound/soc/codecs/wm8960.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 8740423..782faa0 100644
--- a/sound/soc/codecs/wm8960.c
+++ b/sound/soc/codecs/wm8960.c
@@ -557,18 +557,25 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_codec *codec = dai->codec;
 	struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
 	u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3;
+	snd_pcm_format_t format = params_format(params);
 	int i;
 
 	/* bit size */
-	switch (params_format(params)) {
+	switch (format) {
 	case SNDRV_PCM_FORMAT_S16_LE:
+	case SNDRV_PCM_FORMAT_S16_BE:
 		break;
 	case SNDRV_PCM_FORMAT_S20_3LE:
+	case SNDRV_PCM_FORMAT_S20_3BE:
 		iface |= 0x0004;
 		break;
 	case SNDRV_PCM_FORMAT_S24_LE:
+	case SNDRV_PCM_FORMAT_S24_BE:
 		iface |= 0x0008;
 		break;
+	default:
+		dev_err(codec->dev, "unsupported format %i\n", format);
+		return -EINVAL;
 	}
 
 	/* Update filters for the new rate */
-- 
1.7.3.4

  parent reply	other threads:[~2012-09-14 21:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14 21:14 [PATCH 1/5] [v3] ASoC: fsl: use snd_soc_register_card to register the card Timur Tabi
2012-09-14 21:14 ` [PATCH 2/5] ASoC: fsl: move machine drivers to late_initcall() Timur Tabi
2012-09-19  2:35   ` Mark Brown
2012-09-14 21:14 ` [PATCH 3/5] ASoC: fsl: remove unnecessary call to dma_unmap_single Timur Tabi
2012-09-19  2:35   ` Mark Brown
2012-09-14 21:14 ` Timur Tabi [this message]
2012-09-19  2:34   ` [PATCH 4/5] ASoC: wm8960: add support for big-endian audio samples Mark Brown
2012-09-19  2:58     ` Tabi Timur-B04825
2012-09-19  3:13       ` Mark Brown
2012-09-14 21:14 ` [PATCH 5/5] ASoC: add support for the Freescale / iVeia P1022 RDK reference board Timur Tabi
2012-09-19  2:32   ` Mark Brown
2012-09-19  2:47     ` Tabi Timur-B04825
2012-09-19  3:12       ` Mark Brown
2012-09-19 15:17         ` Timur Tabi
2012-09-19  2:35 ` [PATCH 1/5] [v3] ASoC: fsl: use snd_soc_register_card to register the card Mark Brown

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=1347657278-25295-4-git-send-email-timur@freescale.com \
    --to=timur@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).