Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions sound/soc/intel/boards/skl_hda_dsp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ skl_hda_get_board_quirk(struct snd_soc_acpi_mach_params *mach_params)
return board_quirk;
}

static int skl_hda_add_dai_link(struct snd_soc_card *card,
struct snd_soc_dai_link *link)
{
struct sof_card_private *ctx = snd_soc_card_get_drvdata(card);

/* Ignore the HDMI PCM link if iDisp is not present */
if (strstr(link->stream_name, "HDMI") && !ctx->hdmi.idisp_codec)
link->ignore = true;

return 0;
}

static int skl_hda_audio_probe(struct platform_device *pdev)
{
struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
Expand All @@ -101,6 +113,7 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
card->owner = THIS_MODULE;
card->fully_routed = true;
card->late_probe = skl_hda_card_late_probe;
card->add_dai_link = skl_hda_add_dai_link;

dev_dbg(&pdev->dev, "board_quirk = %lx\n", board_quirk);

Expand Down
14 changes: 14 additions & 0 deletions sound/soc/intel/boards/sof_sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,19 @@ static int sof_sdw_card_late_probe(struct snd_soc_card *card)
return ret;
}

static int sof_sdw_add_dai_link(struct snd_soc_card *card,
struct snd_soc_dai_link *link)
{
struct asoc_sdw_mc_private *ctx = snd_soc_card_get_drvdata(card);
struct intel_mc_ctx *intel_ctx = (struct intel_mc_ctx *)ctx->private;

/* Ignore the HDMI PCM link if iDisp is not present */
if (strstr(link->stream_name, "HDMI") && !intel_ctx->hdmi.idisp_codec)
link->ignore = true;

return 0;
}

static int mc_probe(struct platform_device *pdev)
{
struct snd_soc_acpi_mach *mach = dev_get_platdata(&pdev->dev);
Expand All @@ -1340,6 +1353,7 @@ static int mc_probe(struct platform_device *pdev)
card->name = "soundwire";
card->owner = THIS_MODULE;
card->late_probe = sof_sdw_card_late_probe;
card->add_dai_link = sof_sdw_add_dai_link;

snd_soc_card_set_drvdata(card, ctx);

Expand Down
3 changes: 3 additions & 0 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,9 @@ static int snd_soc_compensate_channel_connection_map(struct snd_soc_card *card,
void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
struct snd_soc_pcm_runtime *rtd)
{
if (!rtd)
return;

lockdep_assert_held(&client_mutex);

/*
Expand Down
7 changes: 5 additions & 2 deletions sound/soc/soc-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,11 @@ static void soc_tplg_remove_link(struct snd_soc_component *comp,
dobj->unload(comp, dobj);

list_del(&dobj->list);
snd_soc_remove_pcm_runtime(comp->card,
snd_soc_get_pcm_runtime(comp->card, link));

/* Ignored links do not need to be removed, they are not added */
if (!link->ignore)
snd_soc_remove_pcm_runtime(comp->card,
snd_soc_get_pcm_runtime(comp->card, link));
}

/* unload dai link */
Expand Down
Loading