Skip to content

Commit c786258

Browse files
committed
Revert "soundwire: intel: trap TRIGGER_SUSPEND in .trigger callback"
This reverts commit 048ecd7. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent 87c15c1 commit c786258

1 file changed

Lines changed: 24 additions & 28 deletions

File tree

drivers/soundwire/intel.c

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,29 @@ static void intel_shutdown(struct snd_pcm_substream *substream,
978978
pm_runtime_put_autosuspend(cdns->dev);
979979
}
980980

981+
static int intel_component_dais_suspend(struct snd_soc_component *component)
982+
{
983+
struct sdw_cdns_dma_data *dma;
984+
struct snd_soc_dai *dai;
985+
986+
for_each_component_dais(component, dai) {
987+
/*
988+
* we don't have a .suspend dai_ops, and we don't have access
989+
* to the substream, so let's mark both capture and playback
990+
* DMA contexts as suspended
991+
*/
992+
dma = dai->playback_dma_data;
993+
if (dma)
994+
dma->suspended = true;
995+
996+
dma = dai->capture_dma_data;
997+
if (dma)
998+
dma->suspended = true;
999+
}
1000+
1001+
return 0;
1002+
}
1003+
9811004
static int intel_pcm_set_sdw_stream(struct snd_soc_dai *dai,
9821005
void *stream, int direction)
9831006
{
@@ -1000,46 +1023,19 @@ static void *intel_get_sdw_stream(struct snd_soc_dai *dai,
10001023
return dma->stream;
10011024
}
10021025

1003-
static int intel_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai)
1004-
{
1005-
struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai);
1006-
struct sdw_intel *sdw = cdns_to_intel(cdns);
1007-
struct sdw_cdns_dma_data *dma;
1008-
1009-
/*
1010-
* The .prepare callback is used to deal with xruns and resume operations. In the case
1011-
* of xruns, the DMAs and SHIM registers cannot be touched, but for resume operations the
1012-
* DMAs and SHIM registers need to be initialized.
1013-
* the .trigger callback is used to track the suspend case only.
1014-
*/
1015-
if (cmd != SNDRV_PCM_TRIGGER_SUSPEND)
1016-
return 0;
1017-
1018-
dma = snd_soc_dai_get_dma_data(dai, substream);
1019-
if (!dma) {
1020-
dev_err(dai->dev, "failed to get dma data in %s\n",
1021-
__func__);
1022-
return -EIO;
1023-
}
1024-
1025-
dma->suspended = true;
1026-
1027-
return intel_free_stream(sdw, substream, dai, sdw->instance);
1028-
}
1029-
10301026
static const struct snd_soc_dai_ops intel_pcm_dai_ops = {
10311027
.startup = intel_startup,
10321028
.hw_params = intel_hw_params,
10331029
.prepare = intel_prepare,
10341030
.hw_free = intel_hw_free,
1035-
.trigger = intel_trigger,
10361031
.shutdown = intel_shutdown,
10371032
.set_sdw_stream = intel_pcm_set_sdw_stream,
10381033
.get_sdw_stream = intel_get_sdw_stream,
10391034
};
10401035

10411036
static const struct snd_soc_component_driver dai_component = {
10421037
.name = "soundwire",
1038+
.suspend = intel_component_dais_suspend
10431039
};
10441040

10451041
static int intel_create_dai(struct sdw_cdns *cdns,

0 commit comments

Comments
 (0)