Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 563a5071 authored by Meng Wang's avatar Meng Wang Committed by Gerrit - the friendly Code Review server
Browse files

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 system 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.

Change-Id: Ib9bef6710b9af2b0a2785d81afb252a4e7ca7d4b
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: default avatarPatrick Lai <plai@codeaurora.org>
Git-commit: efea68f4f76c7d921201bbb1410a370dfd5ce83c
Git-repo: https://source.codeaurora.org/quic/la/kernel/msm/log/?h=msm-2.6.38


[bgoswami@codeaurora.org: Fix checkpatch errors
 for line over 80 characters in commit text.]
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: default avatarMeng Wang <mwang@codeaurora.org>
parent b071d2a1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -494,6 +494,7 @@ struct snd_pcm_substream {
#endif /* CONFIG_SND_VERBOSE_PROCFS */
	/* misc flags */
	unsigned int hw_opened: 1;
	unsigned int hw_no_buffer: 1; /* substream may not have a buffer */
};

#define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)
+3 −0
Original line number Diff line number Diff line
@@ -2061,6 +2061,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_user && !runtime->dma_area))
		return -EINVAL;
+1 −0
Original line number Diff line number Diff line
@@ -1196,6 +1196,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_tstamp_latched = false;