From patchwork Wed Nov 15 09:09:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Zhou X-Patchwork-Id: 13456408 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD5DDC47072 for ; Wed, 15 Nov 2023 09:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lnUk2lN233lJF/YyaHvDp2l8ZWBM31IpiG9Lcizf72Y=; b=QSlIgMJKBJO5SZldl53dOXbaDy 7rxNggDUVkSIxClihF1UUy2hw5GUNuW87ih/h4cOJcF9eEWrHbXNCDPHyC4W6tWmVYxeYhu5I+LPu Nw9NB9HHrZKh0BUjHyNDTD56FEy7hKmiNCgS8sWyqXTxa8fR9FS24bjKQHWyK83KCQpOjBc/QKIW7 vDZCLOAyS0o3SNMTKhUioANdxRT4zULGLCX41M0hSQT1J9pnaX+h/z5bYe+nw9L+IYZSTpaoFiJok CQMqUMDu3WkIM9u1/E8GGThbnt8YBeE/iRNSYpo37M5kWflaspgokBt92IGdgzXb4Yrk5tWz6vir1 bxwuSFxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3Btf-000Iry-2H; Wed, 15 Nov 2023 09:09:19 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3Btd-000Iqr-0v for linux-mediatek@lists.infradead.org; Wed, 15 Nov 2023 09:09:18 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1cc1ee2d8dfso58607475ad.3 for ; Wed, 15 Nov 2023 01:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1700039355; x=1700644155; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lnUk2lN233lJF/YyaHvDp2l8ZWBM31IpiG9Lcizf72Y=; b=SG4zI+I3a93pOxs9lysIA9BI880/zLLAG7vsw1z22ThhjghD+qkJF5F53gcRASPbXi KLJls12P0FChhKOGPO2VcEBydh4kYZfZ50AVo3W7ZHl4NnLWSSjVn0KMyAPSehsDOHam iDSomrn8KvPIPMcTs3U6x7faZhFgal1+6oex+KGMRH80ETIfr06Lx4jydT/tgOe4CmLD L0XqrzAD2TD0cNWDPEHJmxuh3TqlsjquGY626n69k5e48F/BfMh30lgMOT1o9GGZ4nAj oq6VQg0K7bBa4IvhUr1x1LRwtlSEwC+sriAPy9I3gdrSfnihVKPaGuvPwQ2aFsJ7i2pA Ls+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700039355; x=1700644155; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lnUk2lN233lJF/YyaHvDp2l8ZWBM31IpiG9Lcizf72Y=; b=il7hcLKGaICwz6wEi5wAUE3a+UT/8IThsTWjP4Fl5lkt0u4G6TS2rxk6z5bMGyqXGq PNgGPQUegWOVjgPQoRQOoTcu5fRezTaRonWo0io15b46Iw/h2SgLJUFysidjF07RkxZw OWui+eokHAskTBYNX0lkgMNTi188BB1Zlnq4zLLdND0PYf8/d9hhw0hZp0PqN4BAXZYD MhCLm2slYNNT4OiKW4/vUOiu5tJHzwNsIePGmOPSwvQIn6K/kXgpsH+7byj2K7Z1KsZK j6NnbFmH21bejXdmrpZgvCEGRCbIYtrtokdGkAqJQldiqbVfEuiUoPMtMr3zH51M3KNr CanQ== X-Gm-Message-State: AOJu0YxfWgaEZf1LN+Df/VexQq0hEXZiTWAQdREHeJtaszoNmVJtoe/C FmAB0ll+8arqF+j2hc1cXPaI1A== X-Google-Smtp-Source: AGHT+IFZGtkuQq2qNZd57OHbCc82PovBWMCZhR6ivresQJ7DFFd26gEjRZV2yi/phMtadOQMcm0ssw== X-Received: by 2002:a17:902:c943:b0:1cc:5cbf:50d2 with SMTP id i3-20020a170902c94300b001cc5cbf50d2mr5005941pla.59.1700039355082; Wed, 15 Nov 2023 01:09:15 -0800 (PST) Received: from localhost.localdomain ([101.78.151.194]) by smtp.gmail.com with ESMTPSA id l18-20020a170903245200b001b9be3b94d3sm6977377pls.140.2023.11.15.01.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 01:09:14 -0800 (PST) From: Rui Zhou To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, angelogioacchino.delregno@collabora.com, perex@perex.cz, allen-kh.cheng@mediatek.com, kuninori.morimoto.gx@renesas.com Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, Rui Zhou Subject: [PATCH v5 1/3] ASoC: dt-bindings: mt8188-mt6359: add es8326 support Date: Wed, 15 Nov 2023 17:09:01 +0800 Message-Id: <20231115090903.578438-2-zhourui@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231115090903.578438-1-zhourui@huaqin.corp-partner.google.com> References: <20231115090903.578438-1-zhourui@huaqin.corp-partner.google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_010917_325084_DBB5CE09 X-CRM114-Status: UNSURE ( 7.58 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Add compatible string "mediatek,mt8188-es8326" to support new board with es8326 codec. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Rui Zhou Acked-by: Conor Dooley --- .../devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml index 4c8c95057ef7..f94ad0715e32 100644 --- a/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml +++ b/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml @@ -15,6 +15,7 @@ allOf: properties: compatible: enum: + - mediatek,mt8188-es8326 - mediatek,mt8188-mt6359-evb - mediatek,mt8188-nau8825 - mediatek,mt8188-rt5682s From patchwork Wed Nov 15 09:09:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Zhou X-Patchwork-Id: 13456410 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 17765C47074 for ; Wed, 15 Nov 2023 09:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lEWs8dTuekK+7MyFRCYOxycW4lW/lKEnCrSndw6TLsE=; b=2+Deb+B7d6+KV28R2rwIJXNcV4 3enogWcGaRPy60rOd3kTkgVx+F7BgvKoB7OqwJzN0g6ESbwgTYXVxS/IQ4A0JxLYA3qncbN8Tg7mu G/4LeVzH+zBxHBLCExMj7gj9u1RuVq5v1YnPmSOA/P6N35HtCpbFZX3hXu19eIsD/CyIW8LVoWXWS wvrpKYe6Sp/KF4V6F1T1AEL6lYNaMO77IvaDdYfLjD64u5MlEaEzfb27mcD4bhX3CAs6z0cRWiH3g REWjbCIddLPyojQoiGvsWyuBKVHYQJPWdryRKQkm8tFZp1VLMMxraE/b0SLkpLWJ460LHd517dP7p Z0Jdh00Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3Btn-000IvO-34; Wed, 15 Nov 2023 09:09:27 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3Btk-000Irs-09 for linux-mediatek@lists.infradead.org; Wed, 15 Nov 2023 09:09:25 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1cc30bf9e22so5069635ad.1 for ; Wed, 15 Nov 2023 01:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1700039359; x=1700644159; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lEWs8dTuekK+7MyFRCYOxycW4lW/lKEnCrSndw6TLsE=; b=pRgUk1YVmmN1Z98bHFKzUEXW0cVRlrQu7dVesvkwCiyWstmsJhHmZjN7rAiP2Ycj70 98dSu2UAw4XRJC9TYM1EbYY61rxtDkxit6ihlPtdBl8i8vX0i2BSlYmku1Rv1ozUgcUU DLDVJ8uGM1rD8KsBVoyj2NVakjBIMnZ1gSAfkuLKHPS+XHBR8O/HpEiX87yS5x3i5wZ1 v+Kr7B/e6CIfqNHhiDPhec27QjTuK7RhfN4zAIV5BTdDuyKhD1ZhgvUELD67H5Fkc8Vs 9Bve0YJOmcToLzuUHtj7hAdMCymDUPTdK2VDGq4wSgXQJtyITRd7clc3OnL/bZSTeVQX AQUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700039359; x=1700644159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lEWs8dTuekK+7MyFRCYOxycW4lW/lKEnCrSndw6TLsE=; b=wvy7kUmrGN8QU63oiduB7hRaTNFP8TVxepn1KGysbqTgI567hxPJ5ZaMnkFHywelAb eaT0Oo5/+sVOzsA/cwS7rk7a33XqTSa0gK+ZQa7s6HgGTN/JbP0JlLTbqAPP3AVcNlzf 92/avUms/MnrrCdho3PITmv1tUsBQdR+YO3NxttXXhtAxB/WvGM+CisRP2qKp+E3ZmWe taznm7KOG8sktlNC4CQz1gHPbIF64/Yi9/+rK+apdJGQvNA8GxibKmgt7mcHv3i6syo0 o+/Xme6R0j07KU+LLQUd3LVUU/tpAXnTCFD77qOHbIgV/LOdPTPsSHP4+yAx08+ZlSYj M2gg== X-Gm-Message-State: AOJu0YyXeNrtwMWOLnVBD8R7VBBsicbmv/x7wc9FbY+BsVwdlnky70DM 5lcqcIgnKbp6cMOmjpQQCfV9kA== X-Google-Smtp-Source: AGHT+IF7r3EZhpY1qgauRLqCyM+Q3IYmP7qDoibSjhnGLRr/pxHHc8fdh/fXPEpARA/iEdGfIMHyHQ== X-Received: by 2002:a17:902:e547:b0:1cc:5c49:6af8 with SMTP id n7-20020a170902e54700b001cc5c496af8mr7036753plf.25.1700039359117; Wed, 15 Nov 2023 01:09:19 -0800 (PST) Received: from localhost.localdomain ([101.78.151.194]) by smtp.gmail.com with ESMTPSA id l18-20020a170903245200b001b9be3b94d3sm6977377pls.140.2023.11.15.01.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 01:09:18 -0800 (PST) From: Rui Zhou To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, angelogioacchino.delregno@collabora.com, perex@perex.cz, allen-kh.cheng@mediatek.com, kuninori.morimoto.gx@renesas.com Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, Rui Zhou Subject: [PATCH v5 2/3] ASoC: mediatek: mt8188-mt6359: add es8326 support Date: Wed, 15 Nov 2023 17:09:02 +0800 Message-Id: <20231115090903.578438-3-zhourui@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231115090903.578438-1-zhourui@huaqin.corp-partner.google.com> References: <20231115090903.578438-1-zhourui@huaqin.corp-partner.google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_010924_084561_70BF7A78 X-CRM114-Status: GOOD ( 21.07 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org To use ES8326 as the codec, add a new sound card named mt8186_es8326. Signed-off-by: Rui Zhou --- sound/soc/mediatek/Kconfig | 1 + sound/soc/mediatek/mt8188/mt8188-mt6359.c | 100 +++++++++++++++++++++- 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index b93d455744ab..296b434caf81 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -252,6 +252,7 @@ config SND_SOC_MT8188_MT6359 select SND_SOC_NAU8315 select SND_SOC_NAU8825 select SND_SOC_RT5682S + select SND_SOC_ES8326 help This adds support for ASoC machine driver for MediaTek MT8188 boards with the MT6359 and other I2S audio codecs. diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c index 33d477cc2e54..0421debe3ce4 100644 --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c @@ -34,6 +34,8 @@ #define NAU8825_HS_PRESENT BIT(0) #define RT5682S_HS_PRESENT BIT(1) +#define ES8326_HS_PRESENT BIT(2) +#define MAX98390_TWO_AMP BIT(3) /* * Maxim MAX98390 */ @@ -48,6 +50,11 @@ */ #define NAU8825_CODEC_DAI "nau8825-hifi" +/* + * ES8326 + */ +#define ES8326_CODEC_DAI "es8326-hifi" + #define SOF_DMA_DL2 "SOF_DMA_DL2" #define SOF_DMA_DL3 "SOF_DMA_DL3" #define SOF_DMA_UL4 "SOF_DMA_UL4" @@ -261,6 +268,17 @@ static struct snd_soc_jack_pin nau8825_jack_pins[] = { }, }; +static struct snd_soc_jack_pin es8326_jack_pins[] = { + { + .pin = "Headphone", + .mask = SND_JACK_HEADPHONE, + }, + { + .pin = "Headset Mic", + .mask = SND_JACK_MICROPHONE, + }, +}; + struct mt8188_card_data { const char *name; unsigned long quirk; @@ -943,6 +961,71 @@ static const struct snd_soc_ops mt8188_sof_be_ops = { .hw_params = mt8188_sof_be_hw_params, }; +static int mt8188_es8326_codec_init(struct snd_soc_pcm_runtime *rtd) +{ + struct mtk_soc_card_data *soc_card_data = snd_soc_card_get_drvdata(rtd->card); + struct mt8188_mt6359_priv *priv = soc_card_data->mach_priv; + struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; + struct snd_soc_jack *jack = &priv->headset_jack; + int ret; + + ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", + SND_JACK_HEADSET | SND_JACK_BTN_0 | + SND_JACK_BTN_1 | SND_JACK_BTN_2 | + SND_JACK_BTN_3, + jack, + es8326_jack_pins, + ARRAY_SIZE(es8326_jack_pins)); + if (ret) { + dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); + return ret; + } + + snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); + snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); + snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); + snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); + ret = snd_soc_component_set_jack(component, jack, NULL); + + if (ret) { + dev_err(rtd->dev, "Headset Jack call-back failed: %d\n", ret); + return ret; + } + + return ret; +}; + +static void mt8188_es8326_codec_exit(struct snd_soc_pcm_runtime *rtd) +{ + struct snd_soc_component *component = snd_soc_rtd_to_codec(rtd, 0)->component; + + snd_soc_component_set_jack(component, NULL, NULL); +} + +static int mt8188_es8326_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); + struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); + struct snd_soc_dai *codec_dai = snd_soc_rtd_to_codec(rtd, 0); + unsigned int rate = params_rate(params); + int ret; + + /* Configure MCLK for codec */ + ret = snd_soc_dai_set_sysclk(codec_dai, 0, rate * 256, SND_SOC_CLOCK_IN); + if (ret < 0) { + dev_err(codec_dai->dev, "can't set MCLK %d\n", ret); + return ret; + } + + /* Configure MCLK for cpu */ + return snd_soc_dai_set_sysclk(cpu_dai, 0, rate * 256, SND_SOC_CLOCK_OUT); +} + +static const struct snd_soc_ops mt8188_es8326_ops = { + .hw_params = mt8188_es8326_hw_params, +}; + static struct snd_soc_dai_link mt8188_mt6359_dai_links[] = { /* FE */ [DAI_LINK_DL2_FE] = { @@ -1293,6 +1376,7 @@ static int mt8188_mt6359_dev_probe(struct platform_device *pdev) struct mt8188_card_data *card_data; struct snd_soc_dai_link *dai_link; bool init_mt6359 = false; + bool init_es8326 = false; bool init_nau8825 = false; bool init_rt5682s = false; bool init_max98390 = false; @@ -1399,7 +1483,9 @@ static int mt8188_mt6359_dev_probe(struct platform_device *pdev) strcmp(dai_link->name, "ETDM1_IN_BE") == 0 || strcmp(dai_link->name, "ETDM2_IN_BE") == 0) { if (!strcmp(dai_link->codecs->dai_name, MAX98390_CODEC_DAI)) { - dai_link->ops = &mt8188_max98390_ops; + if (!(card_data->quirk & MAX98390_TWO_AMP)) { + dai_link->ops = &mt8188_max98390_ops; + } if (!init_max98390) { dai_link->init = mt8188_max98390_codec_init; init_max98390 = true; @@ -1417,6 +1503,12 @@ static int mt8188_mt6359_dev_probe(struct platform_device *pdev) dai_link->init = mt8188_rt5682s_codec_init; dai_link->exit = mt8188_rt5682s_codec_exit; init_rt5682s = true; + } else if (!strcmp(dai_link->codecs->dai_name, ES8326_CODEC_DAI)) { + dai_link->ops = &mt8188_es8326_ops; + if (!init_es8326) { + dai_link->init = mt8188_es8326_codec_init; + dai_link->exit = mt8188_es8326_codec_exit; + init_es8326 = true; } } else { if (strcmp(dai_link->codecs->dai_name, "snd-soc-dummy-dai")) { @@ -1460,10 +1552,16 @@ static struct mt8188_card_data mt8188_rt5682s_card = { .quirk = RT5682S_HS_PRESENT, }; +static struct mt8188_card_data mt8188_es8326_card = { + .name = "mt8188_es8326", + .quirk = ES8326_HS_PRESENT | MAX98390_TWO_AMP, +}; + static const struct of_device_id mt8188_mt6359_dt_match[] = { { .compatible = "mediatek,mt8188-mt6359-evb", .data = &mt8188_evb_card, }, { .compatible = "mediatek,mt8188-nau8825", .data = &mt8188_nau8825_card, }, { .compatible = "mediatek,mt8188-rt5682s", .data = &mt8188_rt5682s_card, }, + { .compatible = "mediatek,mt8188-es8326", .data = &mt8188_es8326_card, }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, mt8188_mt6359_dt_match); From patchwork Wed Nov 15 09:09:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Zhou X-Patchwork-Id: 13456409 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 94AEAC07548 for ; Wed, 15 Nov 2023 09:09:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4L85s7UtI9/rwjFAICPTAzeK+cD+vURn1l7JYvAOpMU=; b=n48SZ05OcXdFEd6ijBsJA/73Pi UqkFcX4MxdBrRVkr4qbtIUJR8QPgpoxupGbZH38CB/Ur5wg3P9s2Wy32gknbRHBAgJ7MiwQ6BSUU5 pDoc0fPtRTS8nbJxaZltnFssQQEzpTyrrVIgeFnr/Tt9e1AMqr7V7Kh03dkCP/q4tUIZfXz+FFyk4 PnWH1hPvSpxAb4pqlRqtmGvMy23fJdJaVu4ISlGr5oLPupi0E7wrJdI7CM6Rk+wzJ/aqMOsC02a7j eq0avJuAPTKJcdVMxJyFwGvUJ8/VQvHZd9kZ5CrMLHd40FO+9VP1bt8wPWK+P5+eF5clid1ItyUaP +8+k50kA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3Btl-000IuN-1i; Wed, 15 Nov 2023 09:09:25 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r3Btj-000ItC-0E for linux-mediatek@lists.infradead.org; Wed, 15 Nov 2023 09:09:24 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1cc30bf9e22so5069875ad.1 for ; Wed, 15 Nov 2023 01:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1700039362; x=1700644162; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4L85s7UtI9/rwjFAICPTAzeK+cD+vURn1l7JYvAOpMU=; b=L7OTiQWPT13pgu69X3/vlZmjEf7EsCsgmG+Lq7QgrgKU9VpQ+8uF1EahEC5jOVld1q CttbonCKKpVdmp/ryNuGnNTjeV0u7hjGK5S0hbQ4oIfRyTDs388Hc12/SqZ5hM+8RDfZ p1TyRUVJl5sGxxxHPAHYZ+jmg/w7O62xGCbfMGXwtSNI5kC6mXKttfMgtO0ZA9gDVsPa PoG3D5s9sjdeqwwIS6i/RW1nOXo/HDNtqnhkcMbFA8m88KjJtNJ6Z/X6n+2rAUyACdoR HREPOIuRPVz/hPOo8hwtfdq5pc/YBulC0sFSIhyc7B0IylaX1Wo1uUz8GHqjUz/SAqxP CwnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700039362; x=1700644162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4L85s7UtI9/rwjFAICPTAzeK+cD+vURn1l7JYvAOpMU=; b=W2y8+0Rz4Cn+m1m0eS3Oj4PeYzDMyAnm5dx+6rEKsFVGJSsY74alitDzj8iwxlSG0Z eskyymBUb7b9XErPGRACPR7e4pweILS/xg2ZPzNQjJEuQRqtDWGOw6FtIbfO99WB9dCo bKXwEpEqTvbXmJ70bGwiyAtdcnWVKZxL5QgzuHnzb3r4QyJC1894+CD1ZoQP+ZHOdQP0 HsEMASfS5ZWaxYQiY4pKOY2lCua+Vh0GgAMdEpcriWtyB9z7UxctVI+1UIa5n3TNdUj1 9OsgRtBynAJitoy8gbkas4zQu+WZxCyBp1bicPzBMKLIYRKzqX9nnC0jAI4CSRlpdEi8 mKJA== X-Gm-Message-State: AOJu0YwF2miKoruK3cUIzzaib0lWFpLZNmr2D9DQ7GBPPTa5j3lA/t9g U/vc9xta8ZZivNFfdwbR8Nz7Jw== X-Google-Smtp-Source: AGHT+IFFjkEZiu2MV7icTcaPiuZU6HRVm+eOmOnwwuwhN6hUyY5N6oU4SdeAXfp0HWTUon5oDRt5AQ== X-Received: by 2002:a17:902:8216:b0:1ce:1b7b:8396 with SMTP id x22-20020a170902821600b001ce1b7b8396mr5562990pln.29.1700039362526; Wed, 15 Nov 2023 01:09:22 -0800 (PST) Received: from localhost.localdomain ([101.78.151.194]) by smtp.gmail.com with ESMTPSA id l18-20020a170903245200b001b9be3b94d3sm6977377pls.140.2023.11.15.01.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 01:09:22 -0800 (PST) From: Rui Zhou To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, angelogioacchino.delregno@collabora.com, perex@perex.cz, allen-kh.cheng@mediatek.com, kuninori.morimoto.gx@renesas.com Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, Rui Zhou Subject: [PATCH v5 3/3] ASoC: mediatek: mt8188-mt6359: Enable dual amp for mt8188-rt5682s Date: Wed, 15 Nov 2023 17:09:03 +0800 Message-Id: <20231115090903.578438-4-zhourui@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231115090903.578438-1-zhourui@huaqin.corp-partner.google.com> References: <20231115090903.578438-1-zhourui@huaqin.corp-partner.google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_010923_110415_C7EA4968 X-CRM114-Status: GOOD ( 11.51 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Enable support for dual MAX98390 amplifiers on the mt8188-rt5682s board. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Rui Zhou --- sound/soc/mediatek/mt8188/mt8188-mt6359.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c index 0421debe3ce4..bd07ea5cd48f 100644 --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c @@ -1549,7 +1549,7 @@ static struct mt8188_card_data mt8188_nau8825_card = { static struct mt8188_card_data mt8188_rt5682s_card = { .name = "mt8188_rt5682s", - .quirk = RT5682S_HS_PRESENT, + .quirk = RT5682S_HS_PRESENT | MAX98390_TWO_AMP, }; static struct mt8188_card_data mt8188_es8326_card = {