summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards/sof_sdw_hdmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/boards/sof_sdw_hdmi.c')
-rw-r--r--sound/soc/intel/boards/sof_sdw_hdmi.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/sound/soc/intel/boards/sof_sdw_hdmi.c b/sound/soc/intel/boards/sof_sdw_hdmi.c
index d47d8bf528..f34fabdf9d 100644
--- a/sound/soc/intel/boards/sof_sdw_hdmi.c
+++ b/sound/soc/intel/boards/sof_sdw_hdmi.c
@@ -15,47 +15,25 @@
#include "sof_sdw_common.h"
#include "hda_dsp_common.h"
-struct hdmi_pcm {
- struct list_head head;
- struct snd_soc_dai *codec_dai;
- int device;
-};
-
int sof_sdw_hdmi_init(struct snd_soc_pcm_runtime *rtd)
{
struct mc_private *ctx = snd_soc_card_get_drvdata(rtd->card);
- struct snd_soc_dai *dai = asoc_rtd_to_codec(rtd, 0);
- struct hdmi_pcm *pcm;
-
- pcm = devm_kzalloc(rtd->card->dev, sizeof(*pcm), GFP_KERNEL);
- if (!pcm)
- return -ENOMEM;
+ struct snd_soc_dai *dai = snd_soc_rtd_to_codec(rtd, 0);
- /* dai_link id is 1:1 mapped to the PCM device */
- pcm->device = rtd->dai_link->id;
- pcm->codec_dai = dai;
-
- list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
+ ctx->hdmi.hdmi_comp = dai->component;
return 0;
}
-#define NAME_SIZE 32
int sof_sdw_hdmi_card_late_probe(struct snd_soc_card *card)
{
struct mc_private *ctx = snd_soc_card_get_drvdata(card);
- struct hdmi_pcm *pcm;
- struct snd_soc_component *component = NULL;
- if (!ctx->idisp_codec)
+ if (!ctx->hdmi.idisp_codec)
return 0;
- if (list_empty(&ctx->hdmi_pcm_list))
+ if (!ctx->hdmi.hdmi_comp)
return -EINVAL;
- pcm = list_first_entry(&ctx->hdmi_pcm_list, struct hdmi_pcm,
- head);
- component = pcm->codec_dai->component;
-
- return hda_dsp_hdmi_build_controls(card, component);
+ return hda_dsp_hdmi_build_controls(card, ctx->hdmi.hdmi_comp);
}