summaryrefslogtreecommitdiff
path: root/sound/soc/omap/omap-pcm.c
diff options
context:
space:
mode:
authorJorge Eduardo Candelaria <jorge.candelaria@ti.com>2010-07-25 15:52:51 +0100
committerRicardo Perez Olivares <x0081762@ti.com>2010-09-14 19:27:12 -0500
commite66d0041fcaba1ed8c306fb6bfd8efe03616bd18 (patch)
tree0ca34df5bcfaab4be4398e4c2730ae20f5a2efee /sound/soc/omap/omap-pcm.c
parent491ed390623ac3d6bd68d57dc1bf94d6f0fad6d2 (diff)
ASoC: OMAP PCM - Add hardware constraint for HDMI and ABE
The ABE needs a step size of 24 * 4, whilst HDMI requires a step size of 32 * 4 bits. Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Diffstat (limited to 'sound/soc/omap/omap-pcm.c')
-rw-r--r--sound/soc/omap/omap-pcm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 8caeb8d305c3..6f362e5d4969 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -280,6 +280,14 @@ static int omap_pcm_open(struct snd_pcm_substream *substream)
if (ret < 0)
goto out;
+ /* ABE needs a step of 24 * 4 data bits, and HDMI 32 * 4
+ * Ensure buffer size satisfies both constraints.
+ */
+ ret = snd_pcm_hw_constraint_step(runtime, 0,
+ SNDRV_PCM_HW_PARAM_BUFFER_BYTES, 384);
+ if (ret < 0)
+ goto out;
+
prtd = kzalloc(sizeof(*prtd), GFP_KERNEL);
if (prtd == NULL) {
ret = -ENOMEM;