Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soundwire: intel_ace2x: Send PDI stream number during prepare

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>

authored by

Ranjani Sridharan and committed by
Mark Brown
c78f1e15 6e38a7e0

+6 -13
+6 -13
drivers/soundwire/intel_ace2x.c
··· 376 376 static int intel_prepare(struct snd_pcm_substream *substream, 377 377 struct snd_soc_dai *dai) 378 378 { 379 + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 379 380 struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai); 380 381 struct sdw_intel *sdw = cdns_to_intel(cdns); 381 382 struct sdw_cdns_dai_runtime *dai_runtime; 383 + struct snd_pcm_hw_params *hw_params; 382 384 int ch, dir; 383 - int ret = 0; 384 385 385 386 dai_runtime = cdns->dai_runtime_array[dai->id]; 386 387 if (!dai_runtime) { ··· 390 389 return -EIO; 391 390 } 392 391 392 + hw_params = &rtd->dpcm[substream->stream].hw_params; 393 393 if (dai_runtime->suspended) { 394 - struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); 395 - struct snd_pcm_hw_params *hw_params; 396 - 397 - hw_params = &rtd->dpcm[substream->stream].hw_params; 398 - 399 394 dai_runtime->suspended = false; 400 395 401 396 /* ··· 412 415 /* the SHIM will be configured in the callback functions */ 413 416 414 417 sdw_cdns_config_stream(cdns, ch, dir, dai_runtime->pdi); 415 - 416 - /* Inform DSP about PDI stream number */ 417 - ret = intel_params_stream(sdw, substream, dai, 418 - hw_params, 419 - sdw->instance, 420 - dai_runtime->pdi->intel_alh_id); 421 418 } 422 419 423 - return ret; 420 + /* Inform DSP about PDI stream number */ 421 + return intel_params_stream(sdw, substream, dai, hw_params, sdw->instance, 422 + dai_runtime->pdi->intel_alh_id); 424 423 } 425 424 426 425 static int