From patchwork Tue Nov 7 03:14:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Zhou X-Patchwork-Id: 13447851 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 AA9BEC4332F for ; Tue, 7 Nov 2023 03:15: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=VjGaQ8sVwrPooKgFfF0wW26z1K35zhfD1sFsbJjKhvk=; b=2W+dzurod6SkOeXTE5NP/FriA1 j3cZ2qi/KCLxjftwz/o2W9UsHr/iHEqueHWhCIOiJx0r6aFgKCfn5Ir3nMuGLqO38gtIivUcfP9NU KipXaqlaOG1fBWp+/Jn11cjacHgFRn5cYe7GKDBZUqXad4EPang1GIgq0Bm/r9R+L5HPdprr5frMC vTI5X3k6Kaw1ikUAFYJYbGL9p5pJ/Es+XrWU7Qz8/vL5zyzhQHou0YniSKuoai9VjX/7hdwwKJfav Cx2kDgtVelxFyP6jRBk5Dmc+2Sd2RA20nWZ9GS5HfPwKTGf6rhYP2vVtwsHniqBbHaxGq9LAvOs2N m6Q1EfkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0CYh-000PDa-2T; Tue, 07 Nov 2023 03:15:19 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0CYe-000PDA-2o for linux-mediatek@lists.infradead.org; Tue, 07 Nov 2023 03:15:18 +0000 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5b97ca78da8so3509622a12.3 for ; Mon, 06 Nov 2023 19:15:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1699326916; x=1699931716; 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=VjGaQ8sVwrPooKgFfF0wW26z1K35zhfD1sFsbJjKhvk=; b=wu9KfEavPn0kvEelbGyPqbRLSLY1x433uPHM2bQEYa5juUndvO6BC1nQ7h+D75K/hW p5/BzjwrKPlfPfKlptBPnt7pBZ4WP7Y22KEehSsLiEIqYNuObHIK4Zvm7YdTLzLmKe6v 0xLA3ULJNFvrafIMVFF7oyD97VyVQ0jIGVIytFDWjEW3ZHF8W8Tb5HN091khMGiWoMcg 31UAEtpqqc+7HBlCS/teS1AV/f/txLr9XuBTjkdyAA9hwLC2k6gvLEutawa7hrGAd2A/ 1hEqdx1qCJ2pB2aY6T5wndebLNaIMgoN3ADD1bMAyukE3qscq7Nzb+IPh2y1c7HT/HD2 O2SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699326916; x=1699931716; 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=VjGaQ8sVwrPooKgFfF0wW26z1K35zhfD1sFsbJjKhvk=; b=fGluUAGTdCVYOPvi+5sy8CthWACXv5eFOZYuU9UDXkUYjWnnOjSPfWrBORe3NPPLzg cwdsCZeojglZFS63JE7RwnbSVH1Dd4r2r8pw13wK8DjC8ClXuscH3u3q+XfS5hmUi9Gf WfuondmtDh4pGvPVzdBtwgrG52QqHwGYhxRIhCNTh2LGTtyiemGMhq8cPZiBorQFaonE Jq01XyejaCcYkpZUiC/ZTozECNGb9mGFusA8g9lmZkTaMyxJkRJpV+CSVoWEnY3Q5htn lfaTorT/YKxOBUX8qD8XmHDCY9DJopRBglY5o6lpVRiJasDzxPaU7SK/RokeGkMZ45Nh qcgg== X-Gm-Message-State: AOJu0Yz6Ag/uPfjyuppwqw5Jz7pCFumDoMS9DTFgPOB2PrywHbFn5jIf nOdHtTRxcCmVoyBF3YCxwFjApg== X-Google-Smtp-Source: AGHT+IER3Y/ulUbkkvWfobAZ7dP9+KSyR1UZ3V1zIalrwlFW1aaC8Y5VcpoJDtAEzLSG1Ccp5wRDfg== X-Received: by 2002:a05:6a20:7345:b0:17b:2df4:87ed with SMTP id v5-20020a056a20734500b0017b2df487edmr28840082pzc.17.1699326915968; Mon, 06 Nov 2023 19:15:15 -0800 (PST) Received: from localhost.localdomain ([101.78.151.194]) by smtp.gmail.com with ESMTPSA id jk4-20020a170903330400b001c9bc811d4dsm6552282plb.295.2023.11.06.19.15.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 19:15:15 -0800 (PST) From: Rui Zhou To: 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-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Rui Zhou Subject: [v1 1/3] ASoC: dt-bindings: mt8188-mt6359: add es8326 support Date: Tue, 7 Nov 2023 11:14:40 +0800 Message-Id: <20231107031442.2768765-2-zhourui@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231107031442.2768765-1-zhourui@huaqin.corp-partner.google.com> References: <20231107031442.2768765-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-20231106_191516_911432_70690D6E X-CRM114-Status: UNSURE ( 7.96 ) 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. Signed-off-by: Rui Zhou Reviewed-by: AngeloGioacchino Del Regno --- .../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..9df5e44176d0 100644 --- a/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml +++ b/Documentation/devicetree/bindings/sound/mediatek,mt8188-mt6359.yaml @@ -18,6 +18,7 @@ properties: - mediatek,mt8188-mt6359-evb - mediatek,mt8188-nau8825 - mediatek,mt8188-rt5682s + - mediatek,mt8188-es8326 audio-routing: description: From patchwork Tue Nov 7 03:14:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Zhou X-Patchwork-Id: 13447852 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 698A1C4332F for ; Tue, 7 Nov 2023 03:15:25 +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=CKgGKtJhLmXRufltux14fJMclaoxn7oMZiicA565Zb0=; b=iIXE6nwdOZmtM1pgOg2b7n8Vd3 09R4y158lHF6/OZ6/GcRDbN25IcHO2wS90QAkcqt3vQJHSTKAzAmyKmLjT/nAo20wpCX8HulASwPk dpXeb8NEpuvvpFzOziShIBf/t3Udn5m1wtVv3glg85pV8WrhgMs24JGSsnFXTiuWfsOiZJGwFTgMS g1SnSqiTY2vGx15QgjIiGKhQEIPlUD3Fi0GMckT8pjJ1yBPeIVeBvnLeHkIffIDdEkxvB7cjqsZfa BXWYmwgRygCVAFSG83KGOfS4H6ZziCF/8eUaM53PFl/trtXcAZ/7489SttcQxIDdcB9jkMlR9J33c ZuBK3k0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0CYm-000PEY-0i; Tue, 07 Nov 2023 03:15:24 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0CYj-000PDr-1R for linux-mediatek@lists.infradead.org; Tue, 07 Nov 2023 03:15:23 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-692c02adeefso4474033b3a.3 for ; Mon, 06 Nov 2023 19:15:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1699326920; x=1699931720; 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=CKgGKtJhLmXRufltux14fJMclaoxn7oMZiicA565Zb0=; b=bZNgUnTb1Z+vZ/9nFM+JJKfgeiFZd0eaxRYYddBFZrANH8mB3CIuLnlWYBnB1oa6/l Mz/GS0VdgKi5ZDzPCtC4ORytmrue9MyvmGgeP8enewBX+f/KPdz3MlyKUQmG7LYIT2Wn tP1VvZ8MlL8rb4U1ylOBKswkPctiMicikru8LLu8ul3mNsQMiEIfqUSBWvKX78zCS8FS OyroFTn2LBGttTbzri5w7tPQxchvVAryPNhjboC/cIsMYUHUawVrxeYvDRZfskd+cgZ1 3gd2sosvoGCSZ8cBWAd2KuECaSIg0HIoGOzreNCtmUCC8w3ktlQtdYFu01sm3W1sXfh+ yVIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699326920; x=1699931720; 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=CKgGKtJhLmXRufltux14fJMclaoxn7oMZiicA565Zb0=; b=kjUuzhOCuAhAZ7LLHGrZIU6wJgsY+41A+yzniC1/KHsVS79x59raTqJP+dJgHaDik1 XdAJrayERkKHA0NJB/ba+r7+JP+42d1DgeyM7JYRL5+t5Pw3F/5ObCH7EvVplqk3AQ6q XHWBrfBN8wgj2IV5rbZon/i16p4KNQTC6Uo/PUDmStm8jfxeLC1D4x+/r7usqDoPYpZ4 oLdszpjBo25vvdPMb0K40WPQNuf2eE6FQZnhPeqqxat6L7m5Cgh+qDwYdLgZ3vUhKVUS h9KZlo4/7n6orA4NCvSocrBDkxXZWfuTuOEAaKTR7EG5qhYkemTA1Lhj0t+w3ZBC8e5l TFXA== X-Gm-Message-State: AOJu0Yx4RrWCxrF8ZIoiQufS5N3cvB710BA8b94l1hzntPKHqAm0F+ih Z/Stsh2q8gxdlY8/Ggxu62P2lA== X-Google-Smtp-Source: AGHT+IEjXxcuT01LDgZbmqfyZct3U9rURvu9oNq8H2ax1jbySu81HW/9FDO03NYNtGMEpM17/qqqgA== X-Received: by 2002:a05:6a20:431c:b0:181:99d4:8fe9 with SMTP id h28-20020a056a20431c00b0018199d48fe9mr13470568pzk.58.1699326920489; Mon, 06 Nov 2023 19:15:20 -0800 (PST) Received: from localhost.localdomain ([101.78.151.194]) by smtp.gmail.com with ESMTPSA id jk4-20020a170903330400b001c9bc811d4dsm6552282plb.295.2023.11.06.19.15.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 19:15:20 -0800 (PST) From: Rui Zhou To: 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-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Rui Zhou Subject: [v1 2/3] ASoC: mediatek: mt8188-mt6359: add es8326 support Date: Tue, 7 Nov 2023 11:14:41 +0800 Message-Id: <20231107031442.2768765-3-zhourui@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231107031442.2768765-1-zhourui@huaqin.corp-partner.google.com> References: <20231107031442.2768765-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-20231106_191521_490279_BF285126 X-CRM114-Status: GOOD ( 21.26 ) 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 Reviewed-by: AngeloGioacchino Del Regno --- 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..e994faa3556b 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 = asoc_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 = asoc_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 = asoc_substream_to_rtd(substream); + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); + struct snd_soc_dai *codec_dai = asoc_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 Tue Nov 7 03:14:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Zhou X-Patchwork-Id: 13447853 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 70004C4332F for ; Tue, 7 Nov 2023 03:16:01 +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=aXgqzLiXrvIaHuM1rt9FyNKWnryjml/ID0Eul+9i+Wo=; b=1Gzo9cTkfHlykoAn+AqyWqXc4q LiIcS/rDmpuT6OqSIftsG1x2NMbTCrmsrpZ1EDSFl+ZMLeYEreBvbjcM2AoEci1crYeZ1MzUcljHj ldF3LtY2DZyAHc5GLWP0F43LRqfIl5RqogWO0QeTz3YPpSrIT12jM7UrgwNVJ699aSSiihbLepq4L WrQc3NmxR0leUrTn+elluzzBxNaeYSyQaNVWtP8X4it3FIbOJ25VABkxRY2l3qkHmfA3htw3Bh7/c NbCYY8XS7T1N5jCzL5XtPSwUpZbBERxfVWiI37KQfxkMz2bEjR3XqoP1C81DxTxz+V67zbU84pD+C OljyeR7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0CZM-000PId-1W; Tue, 07 Nov 2023 03:16:00 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0CZJ-000PIG-2J for linux-mediatek@lists.infradead.org; Tue, 07 Nov 2023 03:15:58 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6b5cac99cfdso4270711b3a.2 for ; Mon, 06 Nov 2023 19:15:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1699326957; x=1699931757; 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=aXgqzLiXrvIaHuM1rt9FyNKWnryjml/ID0Eul+9i+Wo=; b=2/92X6ogOjE+YSWKTtl2h513ISysgrWmMM87jsci791DLbZytegTa5DDLU2ltW+4G6 VVaQJiX5eQSqH8VSUbWNjdZX8OjwKIQdH8845nN3kSZEgkgZ4DZAgDrB3YIZIj8ntSKO 6z0sl59mIIx+EgXohnB1rd3cshj0lQ/9h1bTEI2zsnFd/IdLn4jpKOvrs7HALJ7xUBJ6 YwSTtHGDDBJ8wdmBrMd0irLuV0pmBlpUwub5DOQeDCnNvQJOwTjOHt2I0IdXV7S0TpOl u0ihIClNoZJbGAouy6XgjM4Xww9m2wHukbGyGvYzEn6MLOxMoXJn+SM63fc510D6I3r4 aVMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699326957; x=1699931757; 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=aXgqzLiXrvIaHuM1rt9FyNKWnryjml/ID0Eul+9i+Wo=; b=JiI1MBIZNuxSdsGv4v5tyJfXtjZzxAhGW6Mplvkdrb5tM6Kav+Tu3QBD60PvR0JBMo oKl1ONatlBflLIumjV+RdkrBHmVJ/HP4XX+Q9Px67a6A/oAuKqxBNmqfC35/Xvi3Xh6k qO9VMq20YPtSkieo3kNQutniF5I3KI6tbVzGVvtTJv41NHUQ+VOLwi32DBc6/nN6znGu DfOCr77TxqN2bwyaX+MBk6vu0CZwILM0rn70+sT7Q5Ztp4TEHw0H18VqGhuYr2FXde9R fZXPVjPrca6hGj7gr9xB5FoxUt9eEp9IBBm8yhYWzDHLtLmmSue9dFK7VhJVNilRQc9+ HU1g== X-Gm-Message-State: AOJu0YyJ4l4Y3r9dd+5Vo1V7GCN1Dvj7VtSOebLAQYdvxEOKrXmhBFtW 2ly1sKh+YXJJHKDle6F+DYVVJw== X-Google-Smtp-Source: AGHT+IEo7nU/DVUDeg9e9x0ikbysieK8MO7gaPBW/inkvx+TVX6zgih1HIifyR3sMMvxN1sEzi6JWg== X-Received: by 2002:a05:6a20:a103:b0:16b:b900:2d6d with SMTP id q3-20020a056a20a10300b0016bb9002d6dmr28811185pzk.60.1699326956801; Mon, 06 Nov 2023 19:15:56 -0800 (PST) Received: from localhost.localdomain ([101.78.151.194]) by smtp.gmail.com with ESMTPSA id jk4-20020a170903330400b001c9bc811d4dsm6552282plb.295.2023.11.06.19.15.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 19:15:56 -0800 (PST) From: Rui Zhou To: 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-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, Rui Zhou Subject: [v1 3/3] ASoC: mediatek: mt8188-mt6359: add two amps support Date: Tue, 7 Nov 2023 11:14:42 +0800 Message-Id: <20231107031442.2768765-4-zhourui@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231107031442.2768765-1-zhourui@huaqin.corp-partner.google.com> References: <20231107031442.2768765-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-20231106_191557_778941_0E9F3D41 X-CRM114-Status: GOOD ( 11.33 ) 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 Support codec rt5682 using two amps. Signed-off-by: Rui Zhou Reviewed-by: AngeloGioacchino Del Regno --- 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 e994faa3556b..917640939621 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 = {