aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci/davinci-i2s.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/davinci/davinci-i2s.c')
-rw-r--r--sound/soc/davinci/davinci-i2s.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index 73a0fd8e182f..42609654b5e3 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -146,11 +146,14 @@ static void davinci_mcbsp_start(struct davinci_mcbsp_dev *dev,
146 spcr & ~mask); 146 spcr & ~mask);
147 toggle_clock(dev, playback); 147 toggle_clock(dev, playback);
148 } 148 }
149 /* Start the sample generator and enable transmitter/receiver */ 149 if (dev->pcr & (DAVINCI_MCBSP_PCR_FSXM | DAVINCI_MCBSP_PCR_FSRM |
150 spcr |= DAVINCI_MCBSP_SPCR_GRST; 150 DAVINCI_MCBSP_PCR_CLKXM | DAVINCI_MCBSP_PCR_CLKRM)) {
151 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr); 151 /* Start the sample generator */
152 spcr |= DAVINCI_MCBSP_SPCR_GRST;
153 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr);
154 }
152 155
153 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 156 if (playback) {
154 /* Stop the DMA to avoid data loss */ 157 /* Stop the DMA to avoid data loss */
155 /* while the transmitter is out of reset to handle XSYNCERR */ 158 /* while the transmitter is out of reset to handle XSYNCERR */
156 if (platform->pcm_ops->trigger) { 159 if (platform->pcm_ops->trigger) {
@@ -181,23 +184,16 @@ static void davinci_mcbsp_start(struct davinci_mcbsp_dev *dev,
181 if (ret < 0) 184 if (ret < 0)
182 printk(KERN_DEBUG "Playback DMA start failed\n"); 185 printk(KERN_DEBUG "Playback DMA start failed\n");
183 } 186 }
184 /* Enable the transmitter */
185 spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
186 spcr |= DAVINCI_MCBSP_SPCR_XRST;
187 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr);
188
189 } else {
190
191 /* Enable the reciever */
192 spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
193 spcr |= DAVINCI_MCBSP_SPCR_RRST;
194 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr);
195 } 187 }
196 188
197 189 /* Enable transmitter or receiver */
198 /* Start frame sync */
199 spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG); 190 spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
200 spcr |= DAVINCI_MCBSP_SPCR_FRST; 191 spcr |= mask;
192
193 if (dev->pcr & (DAVINCI_MCBSP_PCR_FSXM | DAVINCI_MCBSP_PCR_FSRM)) {
194 /* Start frame sync */
195 spcr |= DAVINCI_MCBSP_SPCR_FRST;
196 }
201 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr); 197 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr);
202} 198}
203 199