ASoC: davinci-mcasp: don't overwrite DIT settings
authorYegor Yefremov <yegorslists@googlemail.com>
Thu, 4 Apr 2013 14:13:20 +0000 (16:13 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 5 Apr 2013 10:27:13 +0000 (11:27 +0100)
Channel size settings will be made at the end of
davinci_mcasp_hw_params() routine and thus overwrite frame
format settings made for DIT mode. This patch fixes this issue
by taking op_mode into account. Tested with official PSP 3.2
kernel and sii9022a HDMI transmitter.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/davinci/davinci-mcasp.c

index 337431862f364d3f2ce0688580bee413b6aaad26..7252df86c55d9d6d9f869074241d84d11650c091 100644 (file)
@@ -645,16 +645,20 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
        /* mapping of the XSSZ bit-field as described in the datasheet */
        fmt = (word_length >> 1) - 1;
 
-       mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
-                                       RXSSZ(fmt), RXSSZ(0x0F));
-       mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
-                                       TXSSZ(fmt), TXSSZ(0x0F));
-       mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXROT(rotate),
-                                                       TXROT(7));
-       mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG, RXROT(rotate),
-                                                       RXROT(7));
+       if (dev->op_mode != DAVINCI_MCASP_DIT_MODE) {
+               mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
+                               RXSSZ(fmt), RXSSZ(0x0F));
+               mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
+                               TXSSZ(fmt), TXSSZ(0x0F));
+               mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,
+                               TXROT(rotate), TXROT(7));
+               mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
+                               RXROT(rotate), RXROT(7));
+               mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG,
+                               mask);
+       }
+
        mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, mask);
-       mcasp_set_reg(dev->base + DAVINCI_MCASP_RXMASK_REG, mask);
 
        return 0;
 }
@@ -795,9 +799,6 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream)
 /* S/PDIF */
 static void davinci_hw_dit_param(struct davinci_audio_dev *dev)
 {
-       /* TXMASK for 24 bits */
-       mcasp_set_reg(dev->base + DAVINCI_MCASP_TXMASK_REG, 0x00FFFFFF);
-
        /* Set the TX format : 24 bit right rotation, 32 bit slot, Pad 0
           and LSB first */
        mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG,