From 1128a8de588805c0a3bcd3c93f1d052e858606cb Mon Sep 17 00:00:00 2001 From: Misael Lopez Cruz Date: Wed, 2 Mar 2011 16:22:55 -0600 Subject: [PATCH 53/60] ASoC: OMAP4: Add buffer size contrainst for ABE and HDMI commit 52ae8447071c4ad9ec9a6e3e547c53deb0dd163d upstream ABE needs a step size of 24 * 4, whilst HDMI requires a step size of 32 * 4 bits. These constraints are only applicable for OMAP4. Change-Id: I338f207816ef6c165ffb06dc8c346b29969ef4ee Signed-off-by: Margarita Olaya Cabrera Signed-off-by: Misael Lopez Cruz Integrated-by: Jingdong Lu --- sound/soc/omap/omap-pcm.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 129ee7b..aaf6bfc 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -281,6 +281,16 @@ static int omap_pcm_open(struct snd_pcm_substream *substream) if (ret < 0) goto out; + if (cpu_is_omap44xx()) { + /* 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; -- 1.7.4.1