@@ -30,6 +30,7 @@
#include "../../codecs/rt5514.h"
#include "../../codecs/rt5663.h"
#include "../../codecs/hdac_hdmi.h"
+#include "hdac_hdmi_common.h"
#define KBL_REALTEK_CODEC_DAI "rt5663-aif"
#define KBL_REALTEK_DMIC_CODEC_DAI "rt5514-aif1"
@@ -58,6 +59,7 @@ struct kbl_codec_private {
struct snd_soc_jack kabylake_headset;
struct list_head hdmi_pcm_list;
struct snd_soc_jack kabylake_hdmi[2];
+ struct device_link *link;
};
enum {
@@ -224,7 +226,8 @@ static int kabylake_hdmi_init(struct snd_soc_pcm_runtime *rtd, int device)
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 kabylake_hdmi1_init(struct snd_soc_pcm_runtime *rtd)
@@ -672,8 +675,17 @@ static const struct platform_device_id kbl_board_ids[] = {
{ }
};
+static int kabylake_audio_remove(struct platform_device *pdev)
+{
+ struct snd_soc_card *card = platform_get_drvdata(pdev);
+ struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(card);
+
+ return hdac_hdmi_del_device_link(&ctx->link);
+}
+
static struct platform_driver kabylake_audio = {
.probe = kabylake_audio_probe,
+ .remove = kabylake_audio_remove,
.driver = {
.name = "kbl_r5514_5663_max",
.pm = &snd_soc_pm_ops,