diff options
author | Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> | 2023-08-07 16:09:57 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-08-07 23:09:47 +0100 |
commit | 699e146d9ebf42ee2a5d4e4e28f7a49c4aef0105 (patch) | |
tree | 98a59f32fa9933f1c99703f3c5de484930f8b61e /sound/soc/sof/intel | |
parent | 34e38f03d7e77141ef6879c69ca55fc2a44b9f2e (diff) |
ASoC: SOF: Intel: hda-dai-ops: reset device count for SoundWire DAIs
The solution used before LunarLake relies on a 'Multi-gateway'
firmware configuration. This is no longer needed with the DMA hardware
handling multiple links directly. To avoid adding a platform-specific
quirk in the generic IPC4 code, this patch resets the device count
when fetching the stream context.
Suggested-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20230807210959.506849-19-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel')
-rw-r--r-- | sound/soc/sof/intel/hda-dai-ops.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c index 4ae211141c40..ae4a5aa73bfc 100644 --- a/sound/soc/sof/intel/hda-dai-ops.c +++ b/sound/soc/sof/intel/hda-dai-ops.c @@ -434,6 +434,28 @@ out: return ret; } +static struct hdac_ext_stream *sdw_hda_ipc4_get_hext_stream(struct snd_sof_dev *sdev, + struct snd_soc_dai *cpu_dai, + struct snd_pcm_substream *substream) +{ + struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(cpu_dai, substream->stream); + struct snd_sof_widget *swidget = w->dobj.private; + struct snd_sof_dai *dai = swidget->private; + struct sof_ipc4_copier *ipc4_copier = dai->private; + struct sof_ipc4_alh_configuration_blob *blob; + + blob = (struct sof_ipc4_alh_configuration_blob *)ipc4_copier->copier_config; + + /* + * Starting with ACE_2_0, re-setting the device_count is mandatory to avoid using + * the multi-gateway firmware configuration. The DMA hardware can take care of + * multiple links without needing any firmware assistance + */ + blob->alh_cfg.device_count = 1; + + return hda_ipc4_get_hext_stream(sdev, cpu_dai, substream); +} + static const struct hda_dai_widget_dma_ops hda_ipc4_dma_ops = { .get_hext_stream = hda_ipc4_get_hext_stream, .assign_hext_stream = hda_assign_hext_stream, @@ -475,7 +497,7 @@ static const struct hda_dai_widget_dma_ops dmic_ipc4_dma_ops = { }; static const struct hda_dai_widget_dma_ops sdw_ipc4_dma_ops = { - .get_hext_stream = hda_ipc4_get_hext_stream, + .get_hext_stream = sdw_hda_ipc4_get_hext_stream, .assign_hext_stream = hda_assign_hext_stream, .release_hext_stream = hda_release_hext_stream, .setup_hext_stream = hda_setup_hext_stream, |