[v3,04/12] ASoC: intel: bxt_rt298: add device_link to HDMI audio
diff mbox series

Message ID 1554992400-28777-5-git-send-email-libin.yang@intel.com
State New
Headers show
  • ASoC: intel: add device_link to HDMI audio
Related show

Commit Message

Yang, Libin April 11, 2019, 2:19 p.m. UTC
From: Libin Yang <libin.yang@intel.com>

In resume from S3, HDAC HDMI codec driver dapm event callback may be
operated before HDMI codec driver turns on the display audio power
domain because of the contest between display driver and hdmi codec driver.

This patch adds the device_link between bxt_rt298 machine device
(consumer) and hdmi codec device (supplier) to make sure the sequence is
always correct.

Signed-off-by: Libin Yang <libin.yang@intel.com>
 sound/soc/intel/boards/bxt_rt298.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff mbox series

diff --git a/sound/soc/intel/boards/bxt_rt298.c b/sound/soc/intel/boards/bxt_rt298.c
index e91057f..67794c0 100644
--- a/sound/soc/intel/boards/bxt_rt298.c
+++ b/sound/soc/intel/boards/bxt_rt298.c
@@ -26,6 +26,7 @@ 
 #include <sound/pcm_params.h>
 #include "../../codecs/hdac_hdmi.h"
 #include "../../codecs/rt298.h"
+#include "hdac_hdmi_common.h"
 /* Headset jack detection DAPM pins */
 static struct snd_soc_jack broxton_headset;
@@ -39,6 +40,7 @@  struct bxt_hdmi_pcm {
 struct bxt_rt286_private {
 	struct list_head hdmi_pcm_list;
+	struct device_link *link;
 enum {
@@ -204,7 +206,8 @@  static int broxton_hdmi_init(struct snd_soc_pcm_runtime *rtd)
 	list_add_tail(&pcm->head, &ctx->hdmi_pcm_list);
-	return 0;
+	/* Setup a device_link between machine device and HDMI codec device. */
+	return hdac_hdmi_add_device_link(rtd->card->dev, dai->dev, &ctx->link);
 static int broxton_ssp5_fixup(struct snd_soc_pcm_runtime *rtd,