#include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/pinctrl/consumer.h>
+#include <sound/hdmi-codec.h>
 #include <sound/jack.h>
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
 #define RT1015_DEV1_NAME "rt1015.6-0029"
 
 struct mt8183_da7219_max98357_priv {
-       struct snd_soc_jack headset_jack;
+       struct snd_soc_jack headset_jack, hdmi_jack;
 };
 
 static int mt8183_mt6358_i2s_hw_params(struct snd_pcm_substream *substream,
        DAILINK_COMP_ARRAY(COMP_CODEC(NULL, "i2s-hifi")),
        DAILINK_COMP_ARRAY(COMP_EMPTY()));
 
+static int mt8183_da7219_max98357_hdmi_init(struct snd_soc_pcm_runtime *rtd)
+{
+       struct mt8183_da7219_max98357_priv *priv =
+               snd_soc_card_get_drvdata(rtd->card);
+       int ret;
+
+       ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT,
+                                   &priv->hdmi_jack, NULL, 0);
+       if (ret)
+               return ret;
+
+       return hdmi_codec_set_jack_detect(asoc_rtd_to_codec(rtd, 0)->component,
+                                         &priv->hdmi_jack);
+}
+
 static struct snd_soc_dai_link mt8183_da7219_dai_links[] = {
        /* FE */
        {
                .dpcm_playback = 1,
                .ignore_suspend = 1,
                .be_hw_params_fixup = mt8183_i2s_hw_params_fixup,
+               .init = mt8183_da7219_max98357_hdmi_init,
                SND_SOC_DAILINK_REG(tdm),
        },
 };