Skip to content

Commit ec3938c

Browse files
ranj063gregkh
authored andcommitted
soundwire: intel_ace2x: Send PDI stream number during prepare
commit c78f1e1 upstream. In the case of a prepare callback after an xrun or when the PCM is restarted after a call to snd_pcm_drain/snd_pcm_drop, avoid reprogramming the SHIM registers but send the PDI stream number so that the link DMA data can be set. This is needed for the case that the DMA data is cleared when the PCM is stopped and restarted without being closed. Link: https://github.com/thesofproject/sof/issues/9502 Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Acked-by: Vinod Koul <vkoul@kernel.org> All: stable@vger.kernel.org # 6.10.x 6.11.x Link: https://patch.msgid.link/20241016032910.14601-4-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4c67666 commit ec3938c

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

drivers/soundwire/intel_ace2x.c

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -376,11 +376,12 @@ static int intel_hw_params(struct snd_pcm_substream *substream,
376376
static int intel_prepare(struct snd_pcm_substream *substream,
377377
struct snd_soc_dai *dai)
378378
{
379+
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
379380
struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai);
380381
struct sdw_intel *sdw = cdns_to_intel(cdns);
381382
struct sdw_cdns_dai_runtime *dai_runtime;
383+
struct snd_pcm_hw_params *hw_params;
382384
int ch, dir;
383-
int ret = 0;
384385

385386
dai_runtime = cdns->dai_runtime_array[dai->id];
386387
if (!dai_runtime) {
@@ -389,12 +390,8 @@ static int intel_prepare(struct snd_pcm_substream *substream,
389390
return -EIO;
390391
}
391392

393+
hw_params = &rtd->dpcm[substream->stream].hw_params;
392394
if (dai_runtime->suspended) {
393-
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
394-
struct snd_pcm_hw_params *hw_params;
395-
396-
hw_params = &rtd->dpcm[substream->stream].hw_params;
397-
398395
dai_runtime->suspended = false;
399396

400397
/*
@@ -415,15 +412,11 @@ static int intel_prepare(struct snd_pcm_substream *substream,
415412
/* the SHIM will be configured in the callback functions */
416413

417414
sdw_cdns_config_stream(cdns, ch, dir, dai_runtime->pdi);
418-
419-
/* Inform DSP about PDI stream number */
420-
ret = intel_params_stream(sdw, substream, dai,
421-
hw_params,
422-
sdw->instance,
423-
dai_runtime->pdi->intel_alh_id);
424415
}
425416

426-
return ret;
417+
/* Inform DSP about PDI stream number */
418+
return intel_params_stream(sdw, substream, dai, hw_params, sdw->instance,
419+
dai_runtime->pdi->intel_alh_id);
427420
}
428421

429422
static int

0 commit comments

Comments
 (0)