Skip to content

Commit

Permalink
ASoC: DaVinci: pcm, constrain buffer size to multiple of period
Browse files Browse the repository at this point in the history
The dma setup code assumes that the buffer size is a multiple
of the period size.

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Troy Kisky authored and Mark Brown committed Aug 7, 2009
1 parent 9bb7415 commit 6a90d53
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/soc/davinci/davinci-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ static int davinci_pcm_open(struct snd_pcm_substream *substream)
int ret = 0;

snd_soc_set_runtime_hwparams(substream, &davinci_pcm_hardware);
/* ensure that buffer size is a multiple of period size */
ret = snd_pcm_hw_constraint_integer(runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0)
return ret;

prtd = kzalloc(sizeof(struct davinci_runtime_data), GFP_KERNEL);
if (prtd == NULL)
Expand Down

0 comments on commit 6a90d53

Please sign in to comment.