aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2008-12-18 14:36:44 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2008-12-20 08:05:38 -0500
commit69ab820c862250d460dfaaf82164972a4a69418a (patch)
tree203cf96dcaf2316fc1a0f65b4aef7d26ba6510c0 /sound/soc
parent21903c1c9ecb7a210eb985aa8d82ad68c78283cc (diff)
ALSA: ASoC: DaVinci: davinci-i2s clean up
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>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/davinci/davinci-i2s.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index 028682846f4e..24fe9db2c75e 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -238,6 +238,21 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
238 return -EINVAL; 238 return -EINVAL;
239 } 239 }
240 240
241 rcr = DAVINCI_MCBSP_RCR_RFRLEN1(1);
242 xcr = DAVINCI_MCBSP_XCR_XFIG | DAVINCI_MCBSP_XCR_XFRLEN1(1);
243 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
244 case SND_SOC_DAIFMT_RIGHT_J:
245 break;
246 case SND_SOC_DAIFMT_I2S:
247 case SND_SOC_DAIFMT_DSP_B:
248 rcr |= DAVINCI_MCBSP_RCR_RDATDLY(1);
249 xcr |= DAVINCI_MCBSP_XCR_XDATDLY(1);
250 break;
251 default:
252 printk(KERN_ERR "%s:bad format\n", __func__);
253 return -EINVAL;
254 }
255
241 switch (fmt & SND_SOC_DAIFMT_INV_MASK) { 256 switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
242 case SND_SOC_DAIFMT_IB_NF: 257 case SND_SOC_DAIFMT_IB_NF:
243 /* CLKRP Receive clock polarity, 258 /* CLKRP Receive clock polarity,
@@ -290,21 +305,6 @@ static int davinci_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
290 default: 305 default:
291 return -EINVAL; 306 return -EINVAL;
292 } 307 }
293
294 rcr = DAVINCI_MCBSP_RCR_RFRLEN1(1);
295 xcr = DAVINCI_MCBSP_XCR_XFIG | DAVINCI_MCBSP_XCR_XFRLEN1(1);
296 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
297 case SND_SOC_DAIFMT_RIGHT_J:
298 break;
299 case SND_SOC_DAIFMT_I2S:
300 case SND_SOC_DAIFMT_DSP_B:
301 rcr |= DAVINCI_MCBSP_RCR_RDATDLY(1);
302 xcr |= DAVINCI_MCBSP_XCR_XDATDLY(1);
303 break;
304 default:
305 printk(KERN_ERR "%s:bad format\n", __func__);
306 return -EINVAL;
307 }
308 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, srgr); 308 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SRGR_REG, srgr);
309 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, pcr); 309 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, pcr);
310 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, rcr); 310 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, rcr);