diff options
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/davinci/davinci-i2s.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index 8c1bf876031d..11c20d0b7bcc 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c | |||
@@ -295,10 +295,14 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, | |||
295 | u32 w; | 295 | u32 w; |
296 | 296 | ||
297 | /* general line settings */ | 297 | /* general line settings */ |
298 | davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, | 298 | w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG); |
299 | DAVINCI_MCBSP_SPCR_RINTM(3) | | 299 | if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { |
300 | DAVINCI_MCBSP_SPCR_XINTM(3) | | 300 | w |= DAVINCI_MCBSP_SPCR_RINTM(3) | DAVINCI_MCBSP_SPCR_FREE; |
301 | DAVINCI_MCBSP_SPCR_FREE); | 301 | davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w); |
302 | } else { | ||
303 | w |= DAVINCI_MCBSP_SPCR_XINTM(3) | DAVINCI_MCBSP_SPCR_FREE; | ||
304 | davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, w); | ||
305 | } | ||
302 | 306 | ||
303 | i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS); | 307 | i = hw_param_interval(params, SNDRV_PCM_HW_PARAM_SAMPLE_BITS); |
304 | w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SRGR_REG); | 308 | w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SRGR_REG); |
@@ -329,16 +333,19 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, | |||
329 | return -EINVAL; | 333 | return -EINVAL; |
330 | } | 334 | } |
331 | 335 | ||
332 | w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_RCR_REG); | 336 | if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { |
333 | MOD_REG_BIT(w, DAVINCI_MCBSP_RCR_RWDLEN1(mcbsp_word_length) | | 337 | w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_RCR_REG); |
334 | DAVINCI_MCBSP_RCR_RWDLEN2(mcbsp_word_length), 1); | 338 | MOD_REG_BIT(w, DAVINCI_MCBSP_RCR_RWDLEN1(mcbsp_word_length) | |
335 | davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, w); | 339 | DAVINCI_MCBSP_RCR_RWDLEN2(mcbsp_word_length), 1); |
340 | davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, w); | ||
336 | 341 | ||
337 | w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_XCR_REG); | 342 | } else { |
338 | MOD_REG_BIT(w, DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) | | 343 | w = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_XCR_REG); |
339 | DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length), 1); | 344 | MOD_REG_BIT(w, DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) | |
340 | davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, w); | 345 | DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length), 1); |
346 | davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, w); | ||
341 | 347 | ||
348 | } | ||
342 | return 0; | 349 | return 0; |
343 | } | 350 | } |
344 | 351 | ||