summaryrefslogtreecommitdiff
path: root/sound/soc/blackfin/bf5xx-ad1836.c
diff options
context:
space:
mode:
authorBarry Song <barry.song@analog.com>2009-09-15 11:24:52 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-09-15 13:33:59 +0100
commit08db48f1ee1adf8919484f731d4ad6b264cfc564 (patch)
treed492c5fb10cc2a3b48a5a84fc17034115f149309 /sound/soc/blackfin/bf5xx-ad1836.c
parentfd5ad654e665b5c30c8d755a106309c8ea9f3e7b (diff)
ASoC: use set_channel_map api to reorder channels for AD1938 and AD1836
Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ad1836.c')
-rw-r--r--sound/soc/blackfin/bf5xx-ad1836.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/blackfin/bf5xx-ad1836.c b/sound/soc/blackfin/bf5xx-ad1836.c
index cd361e304b0f..0f45a3f56be8 100644
--- a/sound/soc/blackfin/bf5xx-ad1836.c
+++ b/sound/soc/blackfin/bf5xx-ad1836.c
@@ -52,6 +52,7 @@ static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
+ unsigned int channel_map[] = {0, 4, 1, 5, 2, 6, 3, 7};
int ret = 0;
/* set cpu DAI configuration */
ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
@@ -65,6 +66,12 @@ static int bf5xx_ad1836_hw_params(struct snd_pcm_substream *substream,
if (ret < 0)
return ret;
+ /* set cpu DAI channel mapping */
+ ret = snd_soc_dai_set_channel_map(cpu_dai, ARRAY_SIZE(channel_map),
+ channel_map, ARRAY_SIZE(channel_map), channel_map);
+ if (ret < 0)
+ return ret;
+
return 0;
}