Commit 73cf2b3f authored by Trevor Wu's avatar Trevor Wu Committed by Mark Brown

ASoC: mediatek: mt8188-mt6359: register hdmi/dp jack pins

Some userspace applications need jack control events, so register hdmi
and dp jack pins to activate jack control events.
Signed-off-by: default avatarTrevor Wu <trevor.wu@mediatek.com>
Reviewed-by: default avatarAlexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230526093150.22923-4-trevor.wu@mediatek.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 9fba0d3e
......@@ -151,6 +151,20 @@ struct mt8188_mt6359_priv {
struct snd_soc_jack hdmi_jack;
};
static struct snd_soc_jack_pin mt8188_hdmi_jack_pins[] = {
{
.pin = "HDMI",
.mask = SND_JACK_LINEOUT,
},
};
static struct snd_soc_jack_pin mt8188_dp_jack_pins[] = {
{
.pin = "DP",
.mask = SND_JACK_LINEOUT,
},
};
struct mt8188_card_data {
const char *name;
unsigned long quirk;
......@@ -159,6 +173,8 @@ struct mt8188_card_data {
static const struct snd_soc_dapm_widget mt8188_mt6359_widgets[] = {
SND_SOC_DAPM_HP("Headphone", NULL),
SND_SOC_DAPM_MIC("Headset Mic", NULL),
SND_SOC_DAPM_SINK("HDMI"),
SND_SOC_DAPM_SINK("DP"),
};
static const struct snd_kcontrol_new mt8188_mt6359_controls[] = {
......@@ -396,8 +412,10 @@ static int mt8188_hdmi_codec_init(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
int ret = 0;
ret = snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT,
&priv->hdmi_jack);
ret = snd_soc_card_jack_new_pins(rtd->card, "HDMI Jack",
SND_JACK_LINEOUT, &priv->hdmi_jack,
mt8188_hdmi_jack_pins,
ARRAY_SIZE(mt8188_hdmi_jack_pins));
if (ret) {
dev_info(rtd->dev, "%s, new jack failed: %d\n", __func__, ret);
return ret;
......@@ -417,8 +435,9 @@ static int mt8188_dptx_codec_init(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
int ret = 0;
ret = snd_soc_card_jack_new(rtd->card, "DP Jack", SND_JACK_LINEOUT,
&priv->dp_jack);
ret = snd_soc_card_jack_new_pins(rtd->card, "DP Jack", SND_JACK_LINEOUT,
&priv->dp_jack, mt8188_dp_jack_pins,
ARRAY_SIZE(mt8188_dp_jack_pins));
if (ret) {
dev_info(rtd->dev, "%s, new jack failed: %d\n", __func__, ret);
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment