From nobody Wed Oct 30 19:55:57 2024 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5013C7EE2D for ; Fri, 26 May 2023 09:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243184AbjEZJcV (ORCPT ); Fri, 26 May 2023 05:32:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242796AbjEZJcG (ORCPT ); Fri, 26 May 2023 05:32:06 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 310D9DF; Fri, 26 May 2023 02:32:01 -0700 (PDT) X-UUID: 2644b2e0fba811ed9cb5633481061a41-20230526 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=sd5yPw3/wE38i3l3MK8vJlooJQohfmtH9XPZpB48tMw=; b=ABJUaI4qzJl0b87wmJTU6NF1iZZ7J/oQobwyI+E6J0FZqE/UY2kstPqN3r7wzyFq1Z2sFowgI3Qr7LRf9zx4lxQyUohDKMEjxmlOGMdfzzowNR22zOwZqaOJaPYy+506h++FATDBdlMj9/TCbBMJcZ9H0OP3nuKxud3NtCeUuOQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.25,REQID:28a101e1-afb8-4fa1-9515-8057995b0a60,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:d5b0ae3,CLOUDID:fb0a753c-de1e-4348-bc35-c96f92f1dcbb,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-UUID: 2644b2e0fba811ed9cb5633481061a41-20230526 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1812540403; Fri, 26 May 2023 17:31:53 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 26 May 2023 17:31:52 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 26 May 2023 17:31:52 +0800 From: Trevor Wu To: , , , , , , , , CC: , , , , , , Subject: [PATCH v3 3/7] ASoC: mediatek: mt8188-mt6359: register hdmi/dp jack pins Date: Fri, 26 May 2023 17:31:46 +0800 Message-ID: <20230526093150.22923-4-trevor.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230526093150.22923-1-trevor.wu@mediatek.com> References: <20230526093150.22923-1-trevor.wu@mediatek.com> MIME-Version: 1.0 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some userspace applications need jack control events, so register hdmi and dp jack pins to activate jack control events. Signed-off-by: Trevor Wu Reviewed-by: Alexandre Mergnat --- sound/soc/mediatek/mt8188/mt8188-mt6359.c | 27 +++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek= /mt8188/mt8188-mt6359.c index 833bc362dad2..6c3f36e2fffd 100644 --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c @@ -151,6 +151,20 @@ struct mt8188_mt6359_priv { struct snd_soc_jack hdmi_jack; }; =20 +static struct snd_soc_jack_pin mt8188_hdmi_jack_pins[] =3D { + { + .pin =3D "HDMI", + .mask =3D SND_JACK_LINEOUT, + }, +}; + +static struct snd_soc_jack_pin mt8188_dp_jack_pins[] =3D { + { + .pin =3D "DP", + .mask =3D 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[] =3D { SND_SOC_DAPM_HP("Headphone", NULL), SND_SOC_DAPM_MIC("Headset Mic", NULL), + SND_SOC_DAPM_SINK("HDMI"), + SND_SOC_DAPM_SINK("DP"), }; =20 static const struct snd_kcontrol_new mt8188_mt6359_controls[] =3D { @@ -396,8 +412,10 @@ static int mt8188_hdmi_codec_init(struct snd_soc_pcm_r= untime *rtd) struct snd_soc_component *component =3D asoc_rtd_to_codec(rtd, 0)->compon= ent; int ret =3D 0; =20 - ret =3D snd_soc_card_jack_new(rtd->card, "HDMI Jack", SND_JACK_LINEOUT, - &priv->hdmi_jack); + ret =3D 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_ru= ntime *rtd) struct snd_soc_component *component =3D asoc_rtd_to_codec(rtd, 0)->compon= ent; int ret =3D 0; =20 - ret =3D snd_soc_card_jack_new(rtd->card, "DP Jack", SND_JACK_LINEOUT, - &priv->dp_jack); + ret =3D 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; --=20 2.18.0