Skip to content

Commit 2a9c6ff

Browse files
ranj063vinodkoul
authored andcommitted
soundwire: intel: add intel_free_stream() back
Add the intel_free_stream() callback to deal with the change in IPC that requires additional steps to be done to clear the gateway node_id. Signed-off-by: Ranjani Sridharan <[email protected]> Reviewed-by: Rander Wang <[email protected]> Reviewed-by: Péter Ujfalusi <[email protected]> Reviewed-by: Pierre-Louis Bossart <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent fe12bec commit 2a9c6ff

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/soundwire/intel.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,24 @@ static int intel_params_stream(struct sdw_intel *sdw,
668668
* DAI routines
669669
*/
670670

671+
static int intel_free_stream(struct sdw_intel *sdw,
672+
struct snd_pcm_substream *substream,
673+
struct snd_soc_dai *dai,
674+
int link_id)
675+
{
676+
struct sdw_intel_link_res *res = sdw->link_res;
677+
struct sdw_intel_stream_free_data free_data;
678+
679+
free_data.substream = substream;
680+
free_data.dai = dai;
681+
free_data.link_id = link_id;
682+
683+
if (res->ops && res->ops->free_stream && res->dev)
684+
return res->ops->free_stream(res->dev, &free_data);
685+
686+
return 0;
687+
}
688+
671689
static int intel_hw_params(struct snd_pcm_substream *substream,
672690
struct snd_pcm_hw_params *params,
673691
struct snd_soc_dai *dai)
@@ -799,6 +817,7 @@ static int
799817
intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
800818
{
801819
struct sdw_cdns *cdns = snd_soc_dai_get_drvdata(dai);
820+
struct sdw_intel *sdw = cdns_to_intel(cdns);
802821
struct sdw_cdns_dai_runtime *dai_runtime;
803822
int ret;
804823

@@ -819,6 +838,12 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
819838
return ret;
820839
}
821840

841+
ret = intel_free_stream(sdw, substream, dai, sdw->instance);
842+
if (ret < 0) {
843+
dev_err(dai->dev, "intel_free_stream: failed %d\n", ret);
844+
return ret;
845+
}
846+
822847
dai_runtime->pdi = NULL;
823848

824849
return 0;

0 commit comments

Comments
 (0)