ALSA: ASoC: DaVinci: davinci-i2s clean up
authorTroy Kisky <troy.kisky@boundarydevices.com>
Thu, 18 Dec 2008 19:36:44 +0000 (12:36 -0700)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 20 Dec 2008 13:05:38 +0000 (13:05 +0000)
Minor, just move a block of code to make next patch clearer.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/davinci/davinci-i2s.c

index 028682846f4eefd2a7851066a4fe6d904998a827..24fe9db2c75e1ffe92991ad0b29ed4c79849b0e0 100644 (file)
@@ -238,6 +238,21 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
                return -EINVAL;
        }
 
+       rcr = DAVINCI_MCBSP_RCR_RFRLEN1(1);
+       xcr = DAVINCI_MCBSP_XCR_XFIG | DAVINCI_MCBSP_XCR_XFRLEN1(1);
+       switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+       case SND_SOC_DAIFMT_RIGHT_J:
+               break;
+       case SND_SOC_DAIFMT_I2S:
+       case SND_SOC_DAIFMT_DSP_B:
+               rcr |= DAVINCI_MCBSP_RCR_RDATDLY(1);
+               xcr |= DAVINCI_MCBSP_XCR_XDATDLY(1);
+               break;
+       default:
+               printk(KERN_ERR "%s:bad format\n", __func__);
+               return -EINVAL;
+       }
+
        switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
        case SND_SOC_DAIFMT_IB_NF:
                /* CLKRP Receive clock polarity,
@@ -290,21 +305,6 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
        default:
                return -EINVAL;
        }
-
-       rcr = DAVINCI_MCBSP_RCR_RFRLEN1(1);
-       xcr = DAVINCI_MCBSP_XCR_XFIG | DAVINCI_MCBSP_XCR_XFRLEN1(1);
-       switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
-       case SND_SOC_DAIFMT_RIGHT_J:
-               break;
-       case SND_SOC_DAIFMT_I2S:
-       case SND_SOC_DAIFMT_DSP_B:
-               rcr |= DAVINCI_MCBSP_RCR_RDATDLY(1);
-               xcr |= DAVINCI_MCBSP_XCR_XDATDLY(1);
-               break;
-       default:
-               printk(KERN_ERR "%s:bad format\n", __func__);
-               return -EINVAL;
-       }
        davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, srgr);
        davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, pcr);
        davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, rcr);