ASoC: Cold start latency reduction

This patch parallelizes FE (front end) and BE (back end)
when playback/capture path is set up. FE's and BE's which can
be parallelized should be indicated in corresponding machine file.
All the operations can be started asynchronously provided the usecase
supports asynchronous operation.
Parallelizing reduces the startup latency as both FE and BE operations
run in parallel.

Change-Id: I17e7e1c3d406713cc728ec262cfe388f7251f7de
Signed-off-by: Walter Yang <yandongy@codeaurora.org>
Signed-off-by: Fred Oh <fred@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
index 8060590..22b5b86 100644
--- a/include/sound/soc-dpcm.h
+++ b/include/sound/soc-dpcm.h
@@ -17,6 +17,7 @@
 
 struct snd_soc_pcm_runtime;
 
+#define DPCM_MAX_BE_USERS   8
 /*
  * Types of runtime_update to perform. e.g. originated from FE PCM ops
  * or audio route changes triggered by muxes/mixers.
@@ -86,6 +87,7 @@
 #ifdef CONFIG_DEBUG_FS
 	struct dentry *debugfs_state;
 #endif
+	int stream;
 };
 
 /*
@@ -148,8 +150,13 @@
 void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream);
 int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream);
 int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int tream);
+int dpcm_fe_dai_hw_params_be(struct snd_soc_pcm_runtime *fe,
+	struct snd_soc_pcm_runtime *be, struct snd_pcm_hw_params *hw_params,
+							    int stream);
 int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, int cmd);
 int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream);
+int dpcm_fe_dai_prepare_be(struct snd_soc_pcm_runtime *fe,
+	struct snd_soc_pcm_runtime *be, int stream);
 int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
 	int event);