Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2200217rwd; Fri, 26 May 2023 03:19:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5gg51EuDvpNGk/sbaNtFjoQSoiD663KVmRp0Vsw/xaxpNJwX7O1hWvvHkmnG1PwVVhjKdI X-Received: by 2002:a05:6a00:acb:b0:64f:74d9:eb4a with SMTP id c11-20020a056a000acb00b0064f74d9eb4amr2907871pfl.8.1685096346947; Fri, 26 May 2023 03:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685096346; cv=none; d=google.com; s=arc-20160816; b=g0dsAXeHap1kXya3XLjTMZrac7DSlh47uNqeqdPNshGMy85C8gZOOaPyOGVF5/Bqqz RiDMXs2KBYxl99oe3EfcZJnNh0ITpI1BEUdCC0iwjMbCB7ZxQjwVXxr5KuscXYpRS9Sx FqdYjkt8PUpXnI4dSkDruheocwL1ikvEbkrLjGm4WYzrbRF1rdR+IhCIOeRS2D8Zj9qW hlmDbb5lP/EsTPX2Msc89OUg6HIMCKjQtOCcHEq12jG6IX5dwSvUL76m9Bg7kizvlYzc j7aHJweUocVnruC2l/D5RcOgHBVV8XudfNnC1X+qr0lAKqgyQevcpZyWb2bKsoQLZ3Dm Y4jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=sd5yPw3/wE38i3l3MK8vJlooJQohfmtH9XPZpB48tMw=; b=pS4oEv1/h6Ub0a1Pad5RrxYj3asMaUvZYEiK6XJcxxAHQtEUUaJV4BMpy8dZsuzxnH mumeJaQI40veX3sRdXdKateDO+i5yYtd4bQ00LSz/dOPf3y24Ps4TWt2ZEfyzA7a6tO9 XdDfhrMJwRlptQq+lcTq8Wh903efiPe537dDJv0qllYC8kHzq9OWWUPpdeObTSlAI5O/ B8z6o5uovVkvIfLLaG8cNPVJ6UsCRYzrkqFDoSCtpL0Gg681WtAzbuJBt6Mytr1acMI6 NA4T6v0E03BkAockBeORpIEC9mwXXW1tX0UMIAdsmEwnNc8SKx9/Uf0yt3OcyYZ0t296 LFOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ABJUaI4q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d26-20020aa797ba000000b0064d6c74a8bdsi3876511pfq.52.2023.05.26.03.18.53; Fri, 26 May 2023 03:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=ABJUaI4q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243178AbjEZJcT (ORCPT + 99 others); Fri, 26 May 2023 05:32:19 -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 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; }; +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; -- 2.18.0