summaryrefslogtreecommitdiff
path: root/sound/soc/sof/intel/hda.c
diff options
context:
space:
mode:
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>2023-03-07 17:04:34 +0300
committerMark Brown <broonie@kernel.org>2023-03-07 20:06:28 +0300
commita492da0ce6450d6fdea49ec89006d7692c0c1382 (patch)
tree58cafd9d3285a14e234134808f3aac1bddc3c95c /sound/soc/sof/intel/hda.c
parent2b009fa0823c1510700fd17a0780ddd06a460fb4 (diff)
downloadlinux-a492da0ce6450d6fdea49ec89006d7692c0c1382.tar.xz
ASoC: SOF: Intel: hda: Remove hda_ctrl_dai_widget_setup/free()
Remove these functions and reuse hda_dai_config(). 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-14-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/intel/hda.c')
-rw-r--r--sound/soc/sof/intel/hda.c78
1 files changed, 6 insertions, 72 deletions
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 81c697e20108..890993b2f14b 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -44,70 +44,6 @@
#define EXCEPT_MAX_HDR_SIZE 0x400
#define HDA_EXT_ROM_STATUS_SIZE 8
-int hda_ctrl_dai_widget_setup(struct snd_soc_dapm_widget *w, unsigned int quirk_flags,
- struct snd_sof_dai_config_data *data)
-{
- struct snd_sof_widget *swidget = w->dobj.private;
- struct snd_soc_component *component = swidget->scomp;
- struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component);
- const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
- struct snd_sof_dai *sof_dai = swidget->private;
- int ret;
-
- if (!sof_dai) {
- dev_err(sdev->dev, "%s: No DAI for DAI widget %s\n", __func__, w->name);
- return -EINVAL;
- }
-
- if (tplg_ops->dai_config) {
- unsigned int flags;
-
- /* set HW_PARAMS flag along with quirks */
- flags = SOF_DAI_CONFIG_FLAGS_HW_PARAMS |
- quirk_flags << SOF_DAI_CONFIG_FLAGS_QUIRK_SHIFT;
-
- ret = tplg_ops->dai_config(sdev, swidget, flags, data);
- if (ret < 0) {
- dev_err(sdev->dev, "%s: DAI config failed for widget %s\n", __func__,
- w->name);
- return ret;
- }
- }
-
- return 0;
-}
-
-int hda_ctrl_dai_widget_free(struct snd_soc_dapm_widget *w, unsigned int quirk_flags,
- struct snd_sof_dai_config_data *data)
-{
- struct snd_sof_widget *swidget = w->dobj.private;
- struct snd_soc_component *component = swidget->scomp;
- struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(component);
- const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg;
- struct snd_sof_dai *sof_dai = swidget->private;
-
- if (!sof_dai) {
- dev_err(sdev->dev, "%s: No DAI for BE DAI widget %s\n", __func__, w->name);
- return -EINVAL;
- }
-
- if (tplg_ops->dai_config) {
- unsigned int flags;
- int ret;
-
- /* set HW_FREE flag along with any quirks */
- flags = SOF_DAI_CONFIG_FLAGS_HW_FREE |
- quirk_flags << SOF_DAI_CONFIG_FLAGS_QUIRK_SHIFT;
-
- ret = tplg_ops->dai_config(sdev, swidget, flags, data);
- if (ret < 0)
- dev_err(sdev->dev, "%s: DAI config failed for widget '%s'\n", __func__,
- w->name);
- }
-
- return 0;
-}
-
#if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE)
/*
@@ -124,30 +60,28 @@ static int sdw_params_stream(struct device *dev,
struct sdw_intel_stream_params_data *params_data)
{
struct snd_soc_dai *d = params_data->dai;
- struct snd_sof_dai_config_data data;
- struct snd_soc_dapm_widget *w;
+ struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(d, params_data->stream);
+ struct snd_sof_dai_config_data data = { 0 };
- w = snd_soc_dai_get_widget(d, params_data->stream);
data.dai_index = (params_data->link_id << 8) | d->id;
data.dai_data = params_data->alh_stream_id;
- return hda_ctrl_dai_widget_setup(w, SOF_DAI_CONFIG_FLAGS_NONE, &data);
+ return hda_dai_config(w, SOF_DAI_CONFIG_FLAGS_HW_PARAMS, &data);
}
static int sdw_free_stream(struct device *dev,
struct sdw_intel_stream_free_data *free_data)
{
struct snd_soc_dai *d = free_data->dai;
- struct snd_sof_dai_config_data data;
- struct snd_soc_dapm_widget *w;
+ struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(d, free_data->stream);
+ struct snd_sof_dai_config_data data = { 0 };
- w = snd_soc_dai_get_widget(d, free_data->stream);
data.dai_index = (free_data->link_id << 8) | d->id;
/* send invalid stream_id */
data.dai_data = 0xFFFF;
- return hda_ctrl_dai_widget_free(w, SOF_DAI_CONFIG_FLAGS_NONE, &data);
+ return hda_dai_config(w, SOF_DAI_CONFIG_FLAGS_HW_FREE, &data);
}
struct sdw_intel_ops sdw_callback = {