Commit 309e6e55 authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Mark Brown

ASOC: SOF: Intel: hda-dai: consistent naming for HDA DAI and HDA link DMA

The Intel documentation refers to the concepts of 'HDAudio host
DMA' (system memory <--> DSP) and 'HDaudio link DMA' (DSP <-->
peripherals). We currently use the prefix 'hda_link' to describe DAI
operations, which can be confused for dailink operations.

Since the topology tokens refer unambiguously to the 'HDA' dai, let's
drop the link prefix for dai-related ops/callbacks. Conversely let's
use 'hda_link_dma' for routines related to the DMA management. In a
follow-up patch we will introduce the 'hda_dai_link' prefix for dailink
ops/callbacks.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20220421203201.1550328-4-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 51ec71dc
...@@ -50,8 +50,8 @@ static bool hda_check_fes(struct snd_soc_pcm_runtime *rtd, ...@@ -50,8 +50,8 @@ static bool hda_check_fes(struct snd_soc_pcm_runtime *rtd,
} }
static struct hdac_ext_stream * static struct hdac_ext_stream *
hda_link_stream_assign(struct hdac_bus *bus, hda_link_stream_assign(struct hdac_bus *bus,
struct snd_pcm_substream *substream) struct snd_pcm_substream *substream)
{ {
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct sof_intel_hda_stream *hda_stream; struct sof_intel_hda_stream *hda_stream;
...@@ -162,9 +162,9 @@ static int hda_link_dma_params(struct hdac_ext_stream *hext_stream, ...@@ -162,9 +162,9 @@ static int hda_link_dma_params(struct hdac_ext_stream *hext_stream,
return 0; return 0;
} }
static int hda_link_dai_widget_update(struct sof_intel_hda_stream *hda_stream, static int hda_dai_widget_update(struct sof_intel_hda_stream *hda_stream,
struct snd_soc_dapm_widget *w, struct snd_soc_dapm_widget *w,
int channel, bool widget_setup) int channel, bool widget_setup)
{ {
struct snd_sof_dai_config_data data; struct snd_sof_dai_config_data data;
...@@ -177,9 +177,9 @@ static int hda_link_dai_widget_update(struct sof_intel_hda_stream *hda_stream, ...@@ -177,9 +177,9 @@ static int hda_link_dai_widget_update(struct sof_intel_hda_stream *hda_stream,
return hda_ctrl_dai_widget_free(w, SOF_DAI_CONFIG_FLAGS_NONE, &data); return hda_ctrl_dai_widget_free(w, SOF_DAI_CONFIG_FLAGS_NONE, &data);
} }
static int hda_link_hw_params(struct snd_pcm_substream *substream, static int hda_dai_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct hdac_stream *hstream = substream->runtime->private_data; struct hdac_stream *hstream = substream->runtime->private_data;
struct hdac_bus *bus = hstream->bus; struct hdac_bus *bus = hstream->bus;
...@@ -213,7 +213,7 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream, ...@@ -213,7 +213,7 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream,
w = dai->capture_widget; w = dai->capture_widget;
/* set up the DAI widget and send the DAI_CONFIG with the new tag */ /* set up the DAI widget and send the DAI_CONFIG with the new tag */
ret = hda_link_dai_widget_update(hda_stream, w, stream_tag - 1, true); ret = hda_dai_widget_update(hda_stream, w, stream_tag - 1, true);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -239,8 +239,8 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream, ...@@ -239,8 +239,8 @@ static int hda_link_hw_params(struct snd_pcm_substream *substream,
return hda_link_dma_params(hext_stream, &p_params); return hda_link_dma_params(hext_stream, &p_params);
} }
static int hda_link_pcm_prepare(struct snd_pcm_substream *substream, static int hda_dai_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
struct hdac_ext_stream *hext_stream = struct hdac_ext_stream *hext_stream =
snd_soc_dai_get_dma_data(dai, substream); snd_soc_dai_get_dma_data(dai, substream);
...@@ -254,11 +254,11 @@ static int hda_link_pcm_prepare(struct snd_pcm_substream *substream, ...@@ -254,11 +254,11 @@ static int hda_link_pcm_prepare(struct snd_pcm_substream *substream,
dev_dbg(sdev->dev, "hda: prepare stream dir %d\n", substream->stream); dev_dbg(sdev->dev, "hda: prepare stream dir %d\n", substream->stream);
return hda_link_hw_params(substream, &rtd->dpcm[stream].hw_params, return hda_dai_hw_params(substream, &rtd->dpcm[stream].hw_params,
dai); dai);
} }
static int hda_link_dai_config_pause_push_ipc(struct snd_soc_dapm_widget *w) static int hda_dai_config_pause_push_ipc(struct snd_soc_dapm_widget *w)
{ {
struct snd_sof_widget *swidget = w->dobj.private; struct snd_sof_widget *swidget = w->dobj.private;
struct snd_soc_component *component = swidget->scomp; struct snd_soc_component *component = swidget->scomp;
...@@ -276,8 +276,8 @@ static int hda_link_dai_config_pause_push_ipc(struct snd_soc_dapm_widget *w) ...@@ -276,8 +276,8 @@ static int hda_link_dai_config_pause_push_ipc(struct snd_soc_dapm_widget *w)
return ret; return ret;
} }
static int ipc3_hda_link_pcm_trigger(struct snd_pcm_substream *substream, static int ipc3_hda_dai_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai) int cmd, struct snd_soc_dai *dai)
{ {
struct hdac_ext_stream *hext_stream = struct hdac_ext_stream *hext_stream =
snd_soc_dai_get_dma_data(dai, substream); snd_soc_dai_get_dma_data(dai, substream);
...@@ -316,7 +316,7 @@ static int ipc3_hda_link_pcm_trigger(struct snd_pcm_substream *substream, ...@@ -316,7 +316,7 @@ static int ipc3_hda_link_pcm_trigger(struct snd_pcm_substream *substream,
/* /*
* free DAI widget during stop/suspend to keep widget use_count's balanced. * free DAI widget during stop/suspend to keep widget use_count's balanced.
*/ */
ret = hda_link_dai_widget_update(hda_stream, w, DMA_CHAN_INVALID, false); ret = hda_dai_widget_update(hda_stream, w, DMA_CHAN_INVALID, false);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -330,7 +330,7 @@ static int ipc3_hda_link_pcm_trigger(struct snd_pcm_substream *substream, ...@@ -330,7 +330,7 @@ static int ipc3_hda_link_pcm_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
snd_hdac_ext_link_stream_clear(hext_stream); snd_hdac_ext_link_stream_clear(hext_stream);
ret = hda_link_dai_config_pause_push_ipc(w); ret = hda_dai_config_pause_push_ipc(w);
if (ret < 0) if (ret < 0)
return ret; return ret;
break; break;
...@@ -340,8 +340,8 @@ static int ipc3_hda_link_pcm_trigger(struct snd_pcm_substream *substream, ...@@ -340,8 +340,8 @@ static int ipc3_hda_link_pcm_trigger(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static int hda_link_hw_free(struct snd_pcm_substream *substream, static int hda_dai_hw_free(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai) struct snd_soc_dai *dai)
{ {
unsigned int stream_tag; unsigned int stream_tag;
struct sof_intel_hda_stream *hda_stream; struct sof_intel_hda_stream *hda_stream;
...@@ -372,7 +372,7 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream, ...@@ -372,7 +372,7 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream,
w = dai->capture_widget; w = dai->capture_widget;
/* free the link DMA channel in the FW and the DAI widget */ /* free the link DMA channel in the FW and the DAI widget */
ret = hda_link_dai_widget_update(hda_stream, w, DMA_CHAN_INVALID, false); ret = hda_dai_widget_update(hda_stream, w, DMA_CHAN_INVALID, false);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -395,11 +395,11 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream, ...@@ -395,11 +395,11 @@ static int hda_link_hw_free(struct snd_pcm_substream *substream,
return 0; return 0;
} }
static const struct snd_soc_dai_ops ipc3_hda_link_dai_ops = { static const struct snd_soc_dai_ops ipc3_hda_dai_ops = {
.hw_params = hda_link_hw_params, .hw_params = hda_dai_hw_params,
.hw_free = hda_link_hw_free, .hw_free = hda_dai_hw_free,
.trigger = ipc3_hda_link_pcm_trigger, .trigger = ipc3_hda_dai_trigger,
.prepare = hda_link_pcm_prepare, .prepare = hda_dai_prepare,
}; };
#endif #endif
...@@ -531,7 +531,7 @@ void hda_set_dai_drv_ops(struct snd_sof_dev *sdev, struct snd_sof_dsp_ops *ops) ...@@ -531,7 +531,7 @@ void hda_set_dai_drv_ops(struct snd_sof_dev *sdev, struct snd_sof_dsp_ops *ops)
if (strstr(ops->drv[i].name, "iDisp") || if (strstr(ops->drv[i].name, "iDisp") ||
strstr(ops->drv[i].name, "Analog") || strstr(ops->drv[i].name, "Analog") ||
strstr(ops->drv[i].name, "Digital")) strstr(ops->drv[i].name, "Digital"))
ops->drv[i].ops = &ipc3_hda_link_dai_ops; ops->drv[i].ops = &ipc3_hda_dai_ops;
#endif #endif
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment