summaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2009-08-07 01:55:32 +0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-08-07 12:38:29 +0200
commit6a90d536feeccb2c84a2831252b1ed4642684da3 (patch)
tree905efb7119d18da62350bf797d6399191a316276 /sound/soc/davinci
parentASoC: DaVinci: i2s: don't bounce through rtd to get dai (diff)
downloadlinux-6a90d536feeccb2c84a2831252b1ed4642684da3.tar.xz
linux-6a90d536feeccb2c84a2831252b1ed4642684da3.zip
ASoC: DaVinci: pcm, constrain buffer size to multiple of period
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>
Diffstat (limited to 'sound/soc/davinci')
-rw-r--r--sound/soc/davinci/davinci-pcm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
index 8fd0c3cdc710..ab43a539c11d 100644
--- a/sound/soc/davinci/davinci-pcm.c
+++ b/sound/soc/davinci/davinci-pcm.c
@@ -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)