Skip to content

Commit

Permalink
ASoC: davinci-mcasp: Do not allow multiple streams in one direction
Browse files Browse the repository at this point in the history
Make sure that the user can not start multiple streams with the same
direction.

Signed-off-by: Peter Ujfalusi <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Peter Ujfalusi authored and broonie committed May 9, 2016
1 parent 5f9a50c commit 1935736
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/soc/davinci/davinci-mcasp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,11 +1230,15 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream,
int i, dir;
int tdm_slots = mcasp->tdm_slots;

if (mcasp->tdm_mask[substream->stream])
tdm_slots = hweight32(mcasp->tdm_mask[substream->stream]);
/* Do not allow more then one stream per direction */
if (mcasp->substreams[substream->stream])
return -EBUSY;

mcasp->substreams[substream->stream] = substream;

if (mcasp->tdm_mask[substream->stream])
tdm_slots = hweight32(mcasp->tdm_mask[substream->stream]);

if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE)
return 0;

Expand Down

0 comments on commit 1935736

Please sign in to comment.