summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2011-07-24 20:59:44 +0100
committerAndy Green <andy.green@linaro.org>2011-08-25 07:38:04 +0100
commiteba8370d90adc597d7411dd10a9d93b3deb72e2a (patch)
treef5340b0d515020193367d54b4ee1004216af95f8 /sound
parentc682e0152cabf0989a4483d3317b095db87aa9a3 (diff)
Subject: [PATCH 075/104] ALSA: pcm - add support for hostless audio
Allow some PCM devices to be hostless, i.e. there is no PCM data transferred to or from the host CPU. This can be used to minimise power on systems since the CPU can idle/sleep during the PCM device operation (e.g. a phone call where the DAI is between a MODEM and DSP) TODO: cleanup, look at adding a read/write blocker. Singed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/pcm_lib.c3
-rw-r--r--sound/core/pcm_native.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index f1341308bed..13b95ddfd68 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1946,6 +1946,9 @@ static int pcm_sanity_check(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime;
if (PCM_RUNTIME_CHECK(substream))
return -ENXIO;
+ /* TODO: consider and -EINVAL here */
+ if (substream->hw_no_buffer)
+ snd_printd("%s: warning this PCM is host less\n", __func__);
runtime = substream->runtime;
if (snd_BUG_ON(!substream->ops->copy && !runtime->dma_area))
return -EINVAL;
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 1c6be91dfb9..c6698efb44c 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -842,6 +842,7 @@ static int snd_pcm_pre_start(struct snd_pcm_substream *substream, int state)
if (runtime->status->state != SNDRV_PCM_STATE_PREPARED)
return -EBADFD;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+ !substream->hw_no_buffer &&
!snd_pcm_playback_data(substream))
return -EPIPE;
runtime->trigger_master = substream;