aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2016-05-09 06:39:14 -0400
committerMark Brown <broonie@kernel.org>2016-05-09 11:24:31 -0400
commit19357366633cfc53532b587180af3655f0e453f3 (patch)
tree0c95e622a3b3d6b3f8ff5b9b1854bc7b772fbb9a
parent5f9a50c3e55ee887b7a0ccb68045b92579972b55 (diff)
ASoC: davinci-mcasp: Do not allow multiple streams in one direction
Make sure that the user can not start multiple streams with the same direction. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/davinci/davinci-mcasp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index e1324989bd6b..020d8660e4e5 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -1230,11 +1230,15 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
1230 int i, dir; 1230 int i, dir;
1231 int tdm_slots = mcasp->tdm_slots; 1231 int tdm_slots = mcasp->tdm_slots;
1232 1232
1233 if (mcasp->tdm_mask[substream->stream]) 1233 /* Do not allow more then one stream per direction */
1234 tdm_slots = hweight32(mcasp->tdm_mask[substream->stream]); 1234 if (mcasp->substreams[substream->stream])
1235 return -EBUSY;
1235 1236
1236 mcasp->substreams[substream->stream] = substream; 1237 mcasp->substreams[substream->stream] = substream;
1237 1238
1239 if (mcasp->tdm_mask[substream->stream])
1240 tdm_slots = hweight32(mcasp->tdm_mask[substream->stream]);
1241
1238 if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE) 1242 if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE)
1239 return 0; 1243 return 0;
1240 1244