aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2011-07-24 15:59:44 -0400
committerPaolo Pisati <paolo.pisati@canonical.com>2012-08-17 04:18:25 -0400
commite9965c2a5d98e0d698afe45394b1c77ecc0c99ad (patch)
tree3cf2e7919ebfc75ca84a452442a7ec8cf3715309 /sound/core
parentad578b9dd93624c073edc24bf5185cd8a90c748d (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/core')
-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 33884426a64..cd69b38622b 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1961,6 +1961,9 @@ static int pcm_sanity_check(struct snd_pcm_substream *substream)
1961 struct snd_pcm_runtime *runtime; 1961 struct snd_pcm_runtime *runtime;
1962 if (PCM_RUNTIME_CHECK(substream)) 1962 if (PCM_RUNTIME_CHECK(substream))
1963 return -ENXIO; 1963 return -ENXIO;
1964 /* TODO: consider and -EINVAL here */
1965 if (substream->hw_no_buffer)
1966 snd_printd("%s: warning this PCM is host less\n", __func__);
1964 runtime = substream->runtime; 1967 runtime = substream->runtime;
1965 if (snd_BUG_ON(!substream->ops->copy && !runtime->dma_area)) 1968 if (snd_BUG_ON(!substream->ops->copy && !runtime->dma_area))
1966 return -EINVAL; 1969 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)
842 if (runtime->status->state != SNDRV_PCM_STATE_PREPARED) 842 if (runtime->status->state != SNDRV_PCM_STATE_PREPARED)
843 return -EBADFD; 843 return -EBADFD;
844 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && 844 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
845 !substream->hw_no_buffer &&
845 !snd_pcm_playback_data(substream)) 846 !snd_pcm_playback_data(substream))
846 return -EPIPE; 847 return -EPIPE;
847 runtime->trigger_master = substream; 848 runtime->trigger_master = substream;