Unverified Commit 8c29e78b authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown
Browse files

ASoC: SOF: Intel: hda: remove redundant DAI config during hw_free



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: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20230307140435.2808-15-peter.ujfalusi@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a492da0c
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line
@@ -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,
+0 −16
Original line number Diff line number Diff line
@@ -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)