clear-pkgs-linux-iot-lts2018/0256-ASoC-Intel-Skylake-Pro...

67 lines
2.3 KiB
Diff

From 87760347095de7331192f47273943a4ebcdd3c7e Mon Sep 17 00:00:00 2001
From: "Pawse, GuruprasadX" <guruprasadx.pawse@intel.com>
Date: Tue, 14 Jun 2016 18:19:44 +0530
Subject: [PATCH 256/743] ASoC: Intel: Skylake: Probe - Start DMA before
setting probe params
FW starts probe module soon after its params are set. But to avoid
xruns from FW point of view, DMA has to be started before this.
So, reorder the sequence as below so that there is no initial
packet loss in the captured data:
1. Call skl_probe_compr_trigger(START) which starts the DMA.
2. Call skl_tplg_set_probe_params() which tells the DSP to start
the probe stream.
Change-Id: I0a23ded05ca60ab0e35e53c784681ebf502f138a
Signed-off-by: Pawse, GuruprasadX <guruprasadx.pawse@intel.com>
Reviewed-on:
Reviewed-by: Babu, Ramesh <ramesh.babu@intel.com>
Tested-by: Babu, Ramesh <ramesh.babu@intel.com>
---
sound/soc/intel/skylake/skl-probe.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/sound/soc/intel/skylake/skl-probe.c b/sound/soc/intel/skylake/skl-probe.c
index 7c6e3779c213..7d2379806daf 100644
--- a/sound/soc/intel/skylake/skl-probe.c
+++ b/sound/soc/intel/skylake/skl-probe.c
@@ -149,10 +149,6 @@ int skl_probe_compr_set_params(struct snd_compr_stream *substream,
if (substream->direction == SND_COMPRESS_PLAYBACK)
skl_tplg_attach_probe_dma(pconfig->w, skl->skl_sst, dai);
- ret = skl_tplg_set_probe_params(pconfig->w, skl->skl_sst, substream->direction, dai);
- if (ret < 0)
- return -EINVAL;
-
pconfig->probe_count++;
#if USE_SPIB
@@ -293,6 +289,9 @@ int skl_probe_compr_trigger(struct snd_compr_stream *substream, int cmd,
struct hdac_stream *hstr;
int start;
unsigned long cookie;
+ struct skl *skl = get_skl_ctx(dai->dev);
+ struct skl_probe_config *pconfig = &skl->skl_sst->probe_config;
+ int ret;
stream = get_hdac_ext_compr_stream(substream);
hstr = hdac_stream(stream);
@@ -326,5 +325,14 @@ int skl_probe_compr_trigger(struct snd_compr_stream *substream, int cmd,
spin_unlock_irqrestore(&bus->reg_lock, cookie);
+ if (start) {
+ /* FW starts probe module soon after its params are set.
+ * So to avoid xruns, start DMA first and then set probe params.
+ */
+ ret = skl_tplg_set_probe_params(pconfig->w, skl->skl_sst, substream->direction, dai);
+ if (ret < 0)
+ return -EINVAL;
+ }
+
return 0;
}
--
2.19.2