aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/davinci/davinci-i2s.c
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2009-09-11 14:29:02 -0700
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-09-23 10:08:56 -0700
commit81ac55aa14c863821248d9e82694c79bb556694d (patch)
tree6484713a22832c2557cbdf79901481b80abf3191 /sound/soc/davinci/davinci-i2s.c
parentdf0fd5e5e117329436fdea568455545ca18a71f0 (diff)
ASoC: DaVinci: Fix divide by zero error during 1st execution
When both playback and capture stream were open davinci_i2s_hw_params was setting parameters for the wrong stream. The fix for davinci_i2s_hw_params is sufficient, but it looks like a race still happens in davici_pcm_open. This patch also makes the race smaller but the next patch provides a better fix. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci/davinci-i2s.c')
-rw-r--r--sound/soc/davinci/davinci-i2s.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index 12a6c549ee6..d32e1974fdf 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -353,8 +353,9 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
- struct davinci_pcm_dma_params *dma_params = dai->dma_data;
struct davinci_mcbsp_dev *dev = dai->private_data;
+ struct davinci_pcm_dma_params *dma_params =
+ dev->dma_params[substream->stream];
struct snd_interval *i = NULL;
int mcbsp_word_length;
unsigned int rcr, xcr, srgr;