@@ -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,
@@ -626,8 +629,17 @@ static const struct platform_device_id bxt_board_ids[] = {
{}
};
+static int broxton_audio_remove(struct platform_device *pdev)
+{
+ struct snd_soc_card *card = platform_get_drvdata(pdev);
+ struct bxt_rt286_private *ctx = snd_soc_card_get_drvdata(card);
+
+ return hdac_hdmi_del_device_link(&ctx->link);
+}
+
static struct platform_driver broxton_audio = {
.probe = broxton_audio_probe,
+ .remove = broxton_audio_remove,
.driver = {
.name = "bxt_alc298s_i2s",
.pm = &snd_soc_pm_ops,