summaryrefslogtreecommitdiff
path: root/sound/soc/omap/omap-pcm.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2009-04-22 05:56:50 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-04-22 19:57:18 +0400
commit1b4246a1fc487370665bf6c55aac8eae379642c0 (patch)
tree2ec4cbc96af1cfc57859bcb900503669fc4d877e /sound/soc/omap/omap-pcm.c
parentb75576d76d4be50196773f36709cb7a4f5ac2ab7 (diff)
downloadlinux-1b4246a1fc487370665bf6c55aac8eae379642c0.tar.xz
ASoC: OMAP: Add checking to detect bufferless pcms
Add checking in hw_params and prepare to detect bufferless pcms(i.e. BT <--> codec). Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/omap/omap-pcm.c')
-rw-r--r--sound/soc/omap/omap-pcm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 07cf7f46b584..6454e15f7d28 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -87,8 +87,10 @@ static int omap_pcm_hw_params(struct snd_pcm_substream *substream,
struct omap_pcm_dma_data *dma_data = rtd->dai->cpu_dai->dma_data;
int err = 0;
+ /* return if this is a bufferless transfer e.g.
+ * codec <--> BT codec or GSM modem -- lg FIXME */
if (!dma_data)
- return -ENODEV;
+ return 0;
snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
runtime->dma_bytes = params_buffer_bytes(params);
@@ -134,6 +136,11 @@ static int omap_pcm_prepare(struct snd_pcm_substream *substream)
struct omap_pcm_dma_data *dma_data = prtd->dma_data;
struct omap_dma_channel_params dma_params;
+ /* return if this is a bufferless transfer e.g.
+ * codec <--> BT codec or GSM modem -- lg FIXME */
+ if (!prtd->dma_data)
+ return 0;
+
memset(&dma_params, 0, sizeof(dma_params));
/*
* Note: Regardless of interface data formats supported by OMAP McBSP