[alsa-devel] [PATCH v5 0/3] ASoC: Intel: Skylake: Driver updates
From: Jeeja KP jeeja.kp@intel.com
This patch series includes driver updates for the handling scenarios during System S0/S3 transitions when audio stream is stopped during system. o move DMA configuration in DSP Gateway Module widget event handler to ensure DMA is configured after resume. o Enable SSP MLCK using Supply widget. This will ensure the MCLK is enabled when the widget is power on. o Check DMA decouple register state before coupling/decoupling the DMA. o In case of HDMI pass-through pipe, reset only the FE Pipe when stream in in XRUN state. o Resume the stream from HW renderer position. o HDMI Codec pin and converter state need to be restored when stream is resumed.
Changes in v2: - Addressed Mark's comment on patch 1, split this into 2 as this had additional changes other than configuring the DMA. - Addressed Takashi's comment on the usage of snd_hdac_updatel()
Changes in v3: - Addressed Takashi's comment on superfluous shift used in reading the value of PPCTL register and also cleaned the condition for updating the reg value.
Changes in v4: - Acked by Takashi for patch "ALSA: hda: check stream decoupled register state". - Removed compilation warning in patch "ASoC: hdac_hdmi: Enable pin and converter in prepare". - Remove 4 patches which are already applied.
Changes in v5: - Removed the SSP MCLK patchs from this series, will rework and posted later based on Marks' comments.
Jeeja KP (3): ASoC: Intel: Skylake: Don't reset pass-through pipe in BE prepare ASoC: Intel: Skylake: set the resume point to LPIB ASoC: hdac_hdmi: Enable pin and converter in prepare
sound/soc/codecs/hdac_hdmi.c | 37 +++++++++++++++++-------------------- sound/soc/intel/skylake/skl-pcm.c | 6 +++--- 2 files changed, 20 insertions(+), 23 deletions(-)
From: Jeeja KP jeeja.kp@intel.com
When pipe is pass-through, BE and FE modules are defined inside a pipe, reset of pipe will be done in FE DAI prepare. So don't reset in the BE prepare.
Signed-off-by: Jeeja KP jeeja.kp@intel.com --- sound/soc/intel/skylake/skl-pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 10fa10d..aefcfca 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -572,8 +572,8 @@ static int skl_link_pcm_prepare(struct snd_pcm_substream *substream,
/* In case of XRUN recovery, reset the FW pipe to clean state */ mconfig = skl_tplg_be_get_cpr_module(dai, substream->stream); - if (mconfig && (substream->runtime->status->state == - SNDRV_PCM_STATE_XRUN)) + if (mconfig && !mconfig->pipe->passthru && + (substream->runtime->status->state == SNDRV_PCM_STATE_XRUN)) skl_reset_pipe(skl->skl_sst, mconfig->pipe);
return 0;
From: Jeeja KP jeeja.kp@intel.com
In system suspend, the firmware pipelines will be deleted and there is no need to save the pipeline context. Driver will save the DPIB and LPIB pointers in suspend.
In system resume, the firmware pipelines will be created again and the RD/RW pointers in the Firmware buffer points to the base address. So need to fetch the non-played data again to firmware buffer. LPIB indicates the HW rendered position.
Instead of setting DPIB as resume point, set it to LPIB to restore from the HW render position so that DMA would fetch the non-played data one more time.
Signed-off-by: Jeeja KP jeeja.kp@intel.com --- sound/soc/intel/skylake/skl-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index aefcfca..ae7997a 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -474,7 +474,7 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd, snd_hdac_ext_stream_drsm_enable(ebus, true, hdac_stream(stream)->index); snd_hdac_ext_stream_set_dpibr(ebus, stream, - stream->dpib); + stream->lpib); snd_hdac_ext_stream_set_lpib(stream, stream->lpib); }
From: Jeeja KP jeeja.kp@intel.com
Instead of enabling pin and cvt in pcm_open(), need to restore pin and cvt state after system resume to restart the playback which is paused/stopped before system suspend. So enable pin and cvt in playback_prepare and call prepare when trigger cmd is paused/started and resume to reconfigure pin and cvt.
Signed-off-by: Sachin Mokashi sachinx.mokashi@intel.com Signed-off-by: Jeeja KP jeeja.kp@intel.com --- sound/soc/codecs/hdac_hdmi.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index c602c49..1da4405 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -114,6 +114,12 @@ struct hdac_hdmi_priv { struct hdac_chmap chmap; };
+static void hdac_hdmi_enable_cvt(struct hdac_ext_device *edev, + struct hdac_hdmi_dai_pin_map *dai_map); + +static int hdac_hdmi_enable_pin(struct hdac_ext_device *hdac, + struct hdac_hdmi_dai_pin_map *dai_map); + static struct hdac_hdmi_pcm *get_hdmi_pcm_from_id(struct hdac_hdmi_priv *hdmi, int pcm_idx) { @@ -411,6 +417,10 @@ static int hdac_hdmi_playback_prepare(struct snd_pcm_substream *substream, dev_dbg(&hdac->hdac.dev, "stream tag from cpu dai %d format in cvt 0x%x\n", dd->stream_tag, dd->format);
+ hdac_hdmi_enable_cvt(hdac, dai_map); + ret = hdac_hdmi_enable_pin(hdac, dai_map); + if (ret < 0) + return ret; mutex_lock(&pin->lock); pin->channels = substream->runtime->channels;
@@ -464,12 +474,7 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream, static int hdac_hdmi_playback_cleanup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct hdac_ext_device *edev = snd_soc_dai_get_drvdata(dai); struct hdac_ext_dma_params *dd; - struct hdac_hdmi_priv *hdmi = edev->private_data; - struct hdac_hdmi_dai_pin_map *dai_map; - - dai_map = &hdmi->dai_map[dai->id];
dd = (struct hdac_ext_dma_params *)snd_soc_dai_get_dma_data(dai, substream);
@@ -622,11 +627,6 @@ static int hdac_hdmi_pcm_open(struct snd_pcm_substream *substream,
dai_map->pin = pin;
- hdac_hdmi_enable_cvt(hdac, dai_map); - ret = hdac_hdmi_enable_pin(hdac, dai_map); - if (ret < 0) - return ret; - ret = hdac_hdmi_eld_limit_formats(substream->runtime, pin->eld.eld_buffer); if (ret < 0) @@ -639,18 +639,15 @@ static int hdac_hdmi_pcm_open(struct snd_pcm_substream *substream, static int hdac_hdmi_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { - struct hdac_hdmi_dai_pin_map *dai_map; - struct hdac_ext_device *hdac = snd_soc_dai_get_drvdata(dai); - struct hdac_hdmi_priv *hdmi = hdac->private_data; - int ret; - - dai_map = &hdmi->dai_map[dai->id]; - if (cmd == SNDRV_PCM_TRIGGER_RESUME) { - ret = hdac_hdmi_enable_pin(hdac, dai_map); - if (ret < 0) - return ret;
+ switch (cmd) { + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_START: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: return hdac_hdmi_playback_prepare(substream, dai); + + default: + return 0; }
return 0;
participants (1)
-
jeeja.kp@intel.com