@@ -20,6 +20,7 @@
#include "../skylake/skl.h"
#include "../../codecs/rt5682.h"
#include "../../codecs/hdac_hdmi.h"
+#include "hdac_hdmi_common.h"
/* The platform clock outputs 19.2Mhz clock to codec as I2S MCLK */
#define GLK_PLAT_CLK_FREQ 19200000
@@ -42,6 +43,7 @@ struct glk_hdmi_pcm {
struct glk_card_private {
struct snd_soc_jack geminilake_headset;
struct list_head hdmi_pcm_list;
+ struct device_link *link;
};
enum {
@@ -218,7 +220,8 @@ static int geminilake_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 geminilake_rt5682_fe_init(struct snd_soc_pcm_runtime *rtd)
@@ -607,8 +610,17 @@ static const struct platform_device_id glk_board_ids[] = {
{ }
};
+static int geminilake_audio_remove(struct platform_device *pdev)
+{
+ struct snd_soc_card *card = platform_get_drvdata(pdev);
+ struct glk_card_private *ctx = snd_soc_card_get_drvdata(card);
+
+ return hdac_hdmi_del_device_link(&ctx->link);
+}
+
static struct platform_driver geminilake_audio = {
.probe = geminilake_audio_probe,
+ .remove = geminilake_audio_remove,
.driver = {
.name = "glk_rt5682_max98357a",
.pm = &snd_soc_pm_ops,