diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index b1ca64d2f7ea..80ce7d826db1 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -250,12 +250,15 @@ static int skl_pcm_open(struct snd_pcm_substream *substream, skl_set_suspend_active(substream, dai, true); snd_pcm_set_sync(substream); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream); if (!mconfig) return -EINVAL; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); skl_tplg_d0i3_get(skl, mconfig->d0i3_caps); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); return 0; } @@ -268,8 +271,10 @@ static int skl_pcm_prepare(struct snd_pcm_substream *substream, dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); /* * In case of XRUN recovery or in the case when the application * calls prepare another time, reset the FW pipe to clean state @@ -281,15 +286,20 @@ static int skl_pcm_prepare(struct snd_pcm_substream *substream, ret = skl_reset_pipe(skl, mconfig->pipe); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); if (ret < 0) return ret; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); ret = skl_pcm_host_dma_prepare(dai->dev, mconfig->pipe->p_params); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); if (ret < 0) return ret; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); } + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); return 0; } @@ -304,11 +314,14 @@ static int skl_pcm_hw_params(struct snd_pcm_substream *substream, struct skl_module_cfg *m_cfg; int ret, dma_id; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); ret = skl_substream_alloc_pages(bus, substream, params_buffer_bytes(params)); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); if (ret < 0) return ret; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); dev_dbg(dai->dev, "format_val, rate=%d, ch=%d, format=%d\n", runtime->rate, runtime->channels, runtime->format); @@ -328,10 +341,12 @@ static int skl_pcm_hw_params(struct snd_pcm_substream *substream, p_params.host_bps = dai->driver->capture.sig_bits; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); m_cfg = skl_tplg_fe_get_cpr_module(dai, p_params.stream); if (m_cfg) skl_tplg_update_pipe_params(dai->dev, m_cfg, &p_params); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); return 0; } @@ -366,11 +381,14 @@ static void skl_pcm_close(struct snd_pcm_substream *substream, skl->miscbdcg_disabled = false; } + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream); if (mconfig) skl_tplg_d0i3_put(skl, mconfig->d0i3_caps); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); kfree(dma_params); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); } static int skl_pcm_hw_free(struct snd_pcm_substream *substream, @@ -383,18 +401,23 @@ static int skl_pcm_hw_free(struct snd_pcm_substream *substream, dev_dbg(dai->dev, "%s: %s\n", __func__, dai->name); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); if (mconfig) { + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); ret = skl_reset_pipe(skl, mconfig->pipe); if (ret < 0) dev_err(dai->dev, "%s:Reset failed ret =%d", __func__, ret); } + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); snd_hdac_stream_cleanup(hdac_stream(stream)); hdac_stream(stream)->prepared = 0; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); return 0; } @@ -404,11 +427,13 @@ static int skl_be_hw_params(struct snd_pcm_substream *substream, { struct skl_pipe_params p_params = {0}; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); p_params.s_fmt = snd_pcm_format_width(params_format(params)); p_params.ch = params_channels(params); p_params.s_freq = params_rate(params); p_params.stream = substream->stream; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); return skl_tplg_be_update_params(dai, &p_params); } @@ -468,14 +493,19 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dapm_widget *w; int ret; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); mconfig = skl_tplg_fe_get_cpr_module(dai, substream->stream); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); if (!mconfig) return -EIO; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); w = snd_soc_dai_get_widget(dai, substream->stream); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); switch (cmd) { case SNDRV_PCM_TRIGGER_RESUME: + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); if (!w->ignore_suspend) { /* * enable DMA Resume enable bit for the stream, set the @@ -491,7 +521,9 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd, fallthrough; case SNDRV_PCM_TRIGGER_START: + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); /* * Start HOST DMA and Start FE Pipe.This is to make sure that * there are no underrun/overrun in the case when the FE @@ -504,8 +536,11 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd, return skl_run_pipe(skl, mconfig->pipe); case SNDRV_PCM_TRIGGER_PAUSE_PUSH: + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); case SNDRV_PCM_TRIGGER_SUSPEND: + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); case SNDRV_PCM_TRIGGER_STOP: + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); /* * Stop FE Pipe first and stop DMA. This is to make sure that * there are no underrun/overrun in the case if there is a delay @@ -530,9 +565,11 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd, break; default: + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); return -EINVAL; } + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); return 0; } @@ -549,16 +586,21 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream, struct hdac_ext_link *link; int stream_tag; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); link_dev = snd_hdac_ext_stream_assign(bus, substream, HDAC_EXT_STREAM_TYPE_LINK); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); if (!link_dev) return -EBUSY; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); snd_soc_dai_set_dma_data(dai, substream, (void *)link_dev); link = snd_hdac_ext_bus_get_link(bus, codec_dai->component->name); + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); if (!link) return -EINVAL; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); stream_tag = hdac_stream(link_dev)->stream_tag; @@ -581,6 +623,7 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream, else p_params.link_bps = codec_dai->driver->capture.sig_bits; + pr_err("DEBUG: %s:%d\n", __FILE__, __LINE__); return skl_tplg_be_update_params(dai, &p_params); }