linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@google.com>
To: broonie@kernel.org, airlied@linux.ie, daniel@ffwll.ch
Cc: alsa-devel@alsa-project.org, cychiang@google.com,
	tzungbi@google.com, dri-devel@lists.freedesktop.org,
	ck.hu@mediatek.com, linux-mediatek@lists.infradead.org,
	p.zabel@pengutronix.de, matthias.bgg@gmail.com,
	dgreid@google.com, linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/3] ASoC: mediatek: mt8173-rt5650: support HDMI jack reporting
Date: Thu,  6 Feb 2020 11:17:52 +0800	[thread overview]
Message-ID: <20200206102509.3.I253f51edff62df1d88005de12ba601aa029b1e99@changeid> (raw)
In-Reply-To: <20200206031752.193298-1-tzungbi@google.com>

Uses hdmi-codec to support HDMI jack reporting.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
---
 sound/soc/mediatek/mt8173/mt8173-rt5650.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/sound/soc/mediatek/mt8173/mt8173-rt5650.c b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
index ef6f23675286..849b050a54d1 100644
--- a/sound/soc/mediatek/mt8173/mt8173-rt5650.c
+++ b/sound/soc/mediatek/mt8173/mt8173-rt5650.c
@@ -11,6 +11,7 @@
 #include <linux/of_gpio.h>
 #include <sound/soc.h>
 #include <sound/jack.h>
+#include <sound/hdmi-codec.h>
 #include "../../codecs/rt5645.h"
 
 #define MCLK_FOR_CODECS		12288000
@@ -98,7 +99,7 @@ static const struct snd_soc_ops mt8173_rt5650_ops = {
 	.hw_params = mt8173_rt5650_hw_params,
 };
 
-static struct snd_soc_jack mt8173_rt5650_jack;
+static struct snd_soc_jack mt8173_rt5650_jack, mt8173_rt5650_hdmi_jack;
 
 static int mt8173_rt5650_init(struct snd_soc_pcm_runtime *runtime)
 {
@@ -144,6 +145,19 @@ static int mt8173_rt5650_init(struct snd_soc_pcm_runtime *runtime)
 				      &mt8173_rt5650_jack);
 }
 
+static int mt8173_rt5650_hdmi_init(struct snd_soc_pcm_runtime *rtd)
+{
+	int ret;
+
+	ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT,
+				    &mt8173_rt5650_hdmi_jack, NULL, 0);
+	if (ret)
+		return ret;
+
+	return hdmi_codec_set_jack_detect(rtd->codec_dai->component,
+					  &mt8173_rt5650_hdmi_jack);
+}
+
 enum {
 	DAI_LINK_PLAYBACK,
 	DAI_LINK_CAPTURE,
@@ -222,6 +236,7 @@ static struct snd_soc_dai_link mt8173_rt5650_dais[] = {
 		.name = "HDMI BE",
 		.no_pcm = 1,
 		.dpcm_playback = 1,
+		.init = mt8173_rt5650_hdmi_init,
 		SND_SOC_DAILINK_REG(hdmi_be),
 	},
 };
-- 
2.25.0.341.g760bfbb309-goog


_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

  parent reply	other threads:[~2020-02-06  3:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06  3:17 [PATCH v2 0/3] ASoC: mediatek: mt8173-rt5650: HDMI jack reporting Tzung-Bi Shih
2020-02-06  3:17 ` [PATCH v2 1/3] drm/mediatek: exit earlier if failed to register audio driver Tzung-Bi Shih
2020-02-07  9:34   ` CK Hu
2020-02-11 15:48   ` Applied "drm/mediatek: exit earlier if failed to register audio driver" to the asoc tree Mark Brown
2020-02-06  3:17 ` [PATCH v2 2/3] drm/mediatek: support HDMI jack status reporting Tzung-Bi Shih
2020-02-11 15:48   ` Applied "drm/mediatek: support HDMI jack status reporting" to the asoc tree Mark Brown
2020-02-12  8:19   ` [PATCH v2 2/3] drm/mediatek: support HDMI jack status reporting CK Hu
2020-02-12 11:31     ` Tzung-Bi Shih
2020-02-13  1:57       ` CK Hu
2020-02-13  8:02         ` Tzung-Bi Shih
2020-02-06  3:17 ` Tzung-Bi Shih [this message]
2020-02-11 15:49   ` Applied "ASoC: mediatek: mt8173-rt5650: support HDMI jack reporting" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200206102509.3.I253f51edff62df1d88005de12ba601aa029b1e99@changeid \
    --to=tzungbi@google.com \
    --cc=airlied@linux.ie \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=ck.hu@mediatek.com \
    --cc=cychiang@google.com \
    --cc=daniel@ffwll.ch \
    --cc=dgreid@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).