]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - sound/soc/blackfin/bf5xx-ad1938.c
ASoC: use set_channel_map api to reorder channels for AD1938 and AD1836
[net-next-2.6.git] / sound / soc / blackfin / bf5xx-ad1938.c
index 08269e91810ca6e3bf0189d1cf3844a66e111728..2ef1e5013b8c68292b0fac642f8823af33869c72 100644 (file)
@@ -61,6 +61,7 @@ static int bf5xx_ad1938_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, 1, 2, 3, 4, 5, 6, 7};
        int ret = 0;
        /* set cpu DAI configuration */
        ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_DSP_A |
@@ -75,7 +76,13 @@ static int bf5xx_ad1938_hw_params(struct snd_pcm_substream *substream,
                return ret;
 
        /* set codec DAI slots, 8 channels, all channels are enabled */
-       ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xFF, 8);
+       ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xFF, 0xFF, 8, 32);
+       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;