ASoC: SOF: Intel: hda: remove redundant DAI config during hw_free
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Tue, 7 Mar 2023 14:04:35 +0000 (16:04 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 7 Mar 2023 17:06:29 +0000 (17:06 +0000)
The DAI widget is freed during FE DAI hw_free and therefore the DAI
config during BE DAI hw_free is redundant.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-15-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda-dai.c
sound/soc/sof/intel/hda.c

index 4ac6148940ae17504523ff2f97cd9ac154bc9e44..9637f0f44b01cbc0bf809b779abb08ea8f3d211f 100644 (file)
@@ -181,7 +181,7 @@ static int hda_link_dma_prepare(struct snd_pcm_substream *substream, struct snd_
        return hda_link_dma_hw_params(substream, &rtd->dpcm[stream].hw_params, cpu_dai);
 }
 
-static int hda_link_dma_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai)
+static int hda_dai_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai)
 {
        struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(cpu_dai->component);
        const struct hda_dai_widget_dma_ops *ops = hda_dai_get_ops(substream, cpu_dai);
@@ -319,22 +319,6 @@ static int hda_dai_trigger(struct snd_pcm_substream *substream, int cmd, struct
        return 0;
 }
 
-static int hda_dai_hw_free(struct snd_pcm_substream *substream,
-                          struct snd_soc_dai *dai)
-{
-       struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, substream->stream);
-       struct snd_sof_dai_config_data data = { 0 };
-       int ret;
-
-       ret = hda_link_dma_hw_free(substream, dai);
-       if (ret < 0)
-               return ret;
-
-       data.dai_data = DMA_CHAN_INVALID;
-
-       return hda_dai_config(w, SOF_DAI_CONFIG_FLAGS_HW_FREE, &data);
-}
-
 static const struct snd_soc_dai_ops hda_dai_ops = {
        .hw_params = hda_dai_hw_params,
        .hw_free = hda_dai_hw_free,
index 890993b2f14b8048f5d61051f8edad67a7fe7705..65389c7278e2ac5a6148403c2cae9b8101158e23 100644 (file)
@@ -69,24 +69,8 @@ static int sdw_params_stream(struct device *dev,
        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_soc_dapm_widget *w = snd_soc_dai_get_widget(d, free_data->stream);
-       struct snd_sof_dai_config_data data = { 0 };
-
-       data.dai_index = (free_data->link_id << 8) | d->id;
-
-       /* send invalid stream_id */
-       data.dai_data = 0xFFFF;
-
-       return hda_dai_config(w, SOF_DAI_CONFIG_FLAGS_HW_FREE, &data);
-}
-
 struct sdw_intel_ops sdw_callback = {
        .params_stream = sdw_params_stream,
-       .free_stream = sdw_free_stream,
 };
 
 void hda_common_enable_sdw_irq(struct snd_sof_dev *sdev, bool enable)