]> Pileus Git - ~andy/linux/blobdiff - sound/soc/davinci/davinci-mcasp.c
Merge tag 'kvm-3.10-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[~andy/linux] / sound / soc / davinci / davinci-mcasp.c
index 59143373afc6e7d3632877440aabd2342daad95a..56ecfc72f2e9500ebda81214d972b65f291cd518 100644 (file)
@@ -505,7 +505,10 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
                mcasp_set_bits(base + DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE);
                mcasp_set_bits(base + DAVINCI_MCASP_RXFMCTL_REG, AFSRE);
 
-               mcasp_set_bits(base + DAVINCI_MCASP_PDIR_REG, ACLKX | AFSX);
+               mcasp_set_bits(base + DAVINCI_MCASP_PDIR_REG,
+                               ACLKX | ACLKR);
+               mcasp_set_bits(base + DAVINCI_MCASP_PDIR_REG,
+                               AFSX | AFSR);
                break;
        case SND_SOC_DAIFMT_CBM_CFS:
                /* codec is clock master and frame slave */
@@ -565,7 +568,7 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai,
                mcasp_set_bits(base + DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL);
                mcasp_clr_bits(base + DAVINCI_MCASP_TXFMCTL_REG, FSXPOL);
 
-               mcasp_clr_bits(base + DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL);
+               mcasp_set_bits(base + DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL);
                mcasp_clr_bits(base + DAVINCI_MCASP_RXFMCTL_REG, FSRPOL);
                break;
 
@@ -636,11 +639,12 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
         * callback, take it into account here. That allows us to for example
         * send 32 bits per channel to the codec, while only 16 of them carry
         * audio payload.
-        * The clock ratio is given for a full period of data (both left and
-        * right channels), so it has to be divided by 2.
+        * The clock ratio is given for a full period of data (for I2S format
+        * both left and right channels), so it has to be divided by number of
+        * tdm-slots (for I2S - divided by 2).
         */
        if (dev->bclk_lrclk_ratio)
-               word_length = dev->bclk_lrclk_ratio / 2;
+               word_length = dev->bclk_lrclk_ratio / dev->tdm_slots;
 
        /* mapping of the XSSZ bit-field as described in the datasheet */
        fmt = (word_length >> 1) - 1;