aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2012-09-14 17:14:37 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-09-18 22:32:44 -0400
commit4c2474c007867c102c96482f3bacb1fdf209958c (patch)
treed147197cb113f80c05db9172d0c9876bc1eb2eaf /sound
parentd55438beb2329493cb54df5175d83be65a8d5100 (diff)
ASoC: wm8960: add support for big-endian audio samples
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> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8960.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c
index 7cb0d07ca8a6..066250e3f7f4 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,
557 struct snd_soc_codec *codec = dai->codec; 557 struct snd_soc_codec *codec = dai->codec;
558 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); 558 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec);
559 u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3; 559 u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3;
560 snd_pcm_format_t format = params_format(params);
560 int i; 561 int i;
561 562
562 /* bit size */ 563 /* bit size */
563 switch (params_format(params)) { 564 switch (format) {
564 case SNDRV_PCM_FORMAT_S16_LE: 565 case SNDRV_PCM_FORMAT_S16_LE:
566 case SNDRV_PCM_FORMAT_S16_BE:
565 break; 567 break;
566 case SNDRV_PCM_FORMAT_S20_3LE: 568 case SNDRV_PCM_FORMAT_S20_3LE:
569 case SNDRV_PCM_FORMAT_S20_3BE:
567 iface |= 0x0004; 570 iface |= 0x0004;
568 break; 571 break;
569 case SNDRV_PCM_FORMAT_S24_LE: 572 case SNDRV_PCM_FORMAT_S24_LE:
573 case SNDRV_PCM_FORMAT_S24_BE:
570 iface |= 0x0008; 574 iface |= 0x0008;
571 break; 575 break;
576 default:
577 dev_err(codec->dev, "unsupported format %i\n", format);
578 return -EINVAL;
572 } 579 }
573 580
574 /* Update filters for the new rate */ 581 /* Update filters for the new rate */