summaryrefslogtreecommitdiff
path: root/sound/soc/sof
diff options
context:
space:
mode:
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>2023-03-07 17:04:30 +0300
committerMark Brown <broonie@kernel.org>2023-03-07 20:06:24 +0300
commite2d6569aba39f4b98da8e56999a19dc901188e5e (patch)
tree626715292cd424d10df2a0602dc366a445f81669 /sound/soc/sof
parent80afde34e8f9c2459f7cd37ea2d5f71751fedd69 (diff)
downloadlinux-e2d6569aba39f4b98da8e56999a19dc901188e5e.tar.xz
ASoC: SOF: Intel: hda-dai: Add setup_hext_stream/reset_hext_stream DMA ops
Define and use the setup_hext_stream/reset_hext_stream DMA ops during link hw_params and cleanup. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Link: https://lore.kernel.org/r/20230307140435.2808-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof')
-rw-r--r--sound/soc/sof/intel/hda-dai-ops.c13
-rw-r--r--sound/soc/sof/intel/hda-dai.c6
2 files changed, 17 insertions, 2 deletions
diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c
index 9dfcafeab9e4..57db589906db 100644
--- a/sound/soc/sof/intel/hda-dai-ops.c
+++ b/sound/soc/sof/intel/hda-dai-ops.c
@@ -144,10 +144,23 @@ static void hda_release_hext_stream(struct snd_sof_dev *sdev, struct snd_soc_dai
snd_hdac_ext_stream_release(hext_stream, HDAC_EXT_STREAM_TYPE_LINK);
}
+static void hda_setup_hext_stream(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_stream,
+ unsigned int format_val)
+{
+ snd_hdac_ext_stream_setup(hext_stream, format_val);
+}
+
+static void hda_reset_hext_stream(struct snd_sof_dev *sdev, struct hdac_ext_stream *hext_stream)
+{
+ snd_hdac_ext_stream_reset(hext_stream);
+}
+
static const struct hda_dai_widget_dma_ops hda_dma_ops = {
.get_hext_stream = hda_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,
};
#endif
diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c
index 963c40d8a10b..9616cdba79b6 100644
--- a/sound/soc/sof/intel/hda-dai.c
+++ b/sound/soc/sof/intel/hda-dai.c
@@ -135,7 +135,8 @@ static int hda_link_dma_hw_params(struct snd_pcm_substream *substream,
else
link_bps = codec_dai->driver->capture.sig_bits;
- snd_hdac_ext_stream_reset(hext_stream);
+ if (ops->reset_hext_stream)
+ ops->reset_hext_stream(sdev, hext_stream);
format_val = snd_hdac_calc_stream_format(params_rate(params), params_channels(params),
params_format(params), link_bps, 0);
@@ -143,7 +144,8 @@ static int hda_link_dma_hw_params(struct snd_pcm_substream *substream,
dev_dbg(bus->dev, "format_val=%d, rate=%d, ch=%d, format=%d\n",
format_val, params_rate(params), params_channels(params), params_format(params));
- snd_hdac_ext_stream_setup(hext_stream, format_val);
+ if (ops->setup_hext_stream)
+ ops->setup_hext_stream(sdev, hext_stream, format_val);
hext_stream->link_prepared = 1;