summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/intel
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2023-08-07 16:09:52 -0500
committerMark Brown <broonie@kernel.org>2023-08-07 23:09:42 +0100
commitbb0b992c1bb94e44ba40f82ddb2c4e6d5c9fcc9e (patch)
tree7e71d2515a73eebc5afb074c3af492225cb7e43d /sound/soc/sof/intel
parentf8ba62ac863c33fc0d8ac3f1270985c2b77f4377 (diff)
downloadlinux-stable-bb0b992c1bb94e44ba40f82ddb2c4e6d5c9fcc9e.tar.gz
linux-stable-bb0b992c1bb94e44ba40f82ddb2c4e6d5c9fcc9e.tar.bz2
linux-stable-bb0b992c1bb94e44ba40f82ddb2c4e6d5c9fcc9e.zip
ASoC: SOF: Intel: hda-dai-ops: add ops for SoundWire
Same abstraction as SSP/DMIC, with only the get_hlink helper changing. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Link: https://lore.kernel.org/r/20230807210959.506849-14-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.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c
index 9a6d995a8453..4ae211141c40 100644
--- a/sound/soc/sof/intel/hda-dai-ops.c
+++ b/sound/soc/sof/intel/hda-dai-ops.c
@@ -296,6 +296,14 @@ static struct hdac_ext_link *dmic_get_hlink(struct snd_sof_dev *sdev,
return hdac_bus_eml_dmic_get_hlink(bus);
}
+static struct hdac_ext_link *sdw_get_hlink(struct snd_sof_dev *sdev,
+ struct snd_pcm_substream *substream)
+{
+ struct hdac_bus *bus = sof_to_bus(sdev);
+
+ return hdac_bus_eml_sdw_get_hlink(bus);
+}
+
static int hda_ipc4_pre_trigger(struct snd_sof_dev *sdev, struct snd_soc_dai *cpu_dai,
struct snd_pcm_substream *substream, int cmd)
{
@@ -466,6 +474,19 @@ static const struct hda_dai_widget_dma_ops dmic_ipc4_dma_ops = {
.get_hlink = dmic_get_hlink,
};
+static const struct hda_dai_widget_dma_ops sdw_ipc4_dma_ops = {
+ .get_hext_stream = 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,
+ .reset_hext_stream = hda_reset_hext_stream,
+ .pre_trigger = hda_ipc4_pre_trigger,
+ .trigger = hda_trigger,
+ .post_trigger = hda_ipc4_post_trigger,
+ .calc_stream_format = generic_calc_stream_format,
+ .get_hlink = sdw_get_hlink,
+};
+
static const struct hda_dai_widget_dma_ops hda_ipc4_chain_dma_ops = {
.get_hext_stream = hda_get_hext_stream,
.assign_hext_stream = hda_assign_hext_stream,
@@ -591,6 +612,11 @@ hda_select_dai_widget_ops(struct snd_sof_dev *sdev, struct snd_sof_widget *swidg
if (chip->hw_ip_version < SOF_INTEL_ACE_2_0)
return NULL;
return &dmic_ipc4_dma_ops;
+ case SOF_DAI_INTEL_ALH:
+ if (chip->hw_ip_version < SOF_INTEL_ACE_2_0)
+ return NULL;
+ return &sdw_ipc4_dma_ops;
+
default:
break;
}