From patchwork Tue Mar 1 07:29:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxin Yu X-Patchwork-Id: 12764258 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 E3CF4C433EF for ; Tue, 1 Mar 2022 07:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j+KOIgrAq2VlOtZoCZp3aW/weASnaLg7up3aZsX0J3w=; b=kIw9ew4i1fB7IE djFtkEsotKDWP0PDUmx25ON0q4/aDIQT6KQtvWuOlyxT+HVvUIVSWwh7T+MgJwGhTKOnatxVEOVxc SSbUHrSHNHruDgngi/+e3pz0wFqVmMYq2xQxFdTkkY2f/aCBG5UZdImypKy/5flVw5WnMpcXjIG+U u4RSCuPwaxmvzOqjlC2GAS0nHhefEeiU6CeePs/Nyydj6fRkJpMC1w+qtSYYSSWoLREOtdsd8VT3W UqS8sunwJNbCvsL4X0UHTz0L4tqnA+LP91+DoruFgb5C09/8Li7qYyFj8iBzQ4ibcLHtYQaUr1Idj NKK5R3cEOZ94r6dwGDrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOx6u-00FMBw-Vx; Tue, 01 Mar 2022 07:39:53 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOx6h-00FM8W-Kj; Tue, 01 Mar 2022 07:39:40 +0000 X-UUID: 4b5b115b3b36484c9c37662115a50790-20220301 X-UUID: 4b5b115b3b36484c9c37662115a50790-20220301 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 232815280; Tue, 01 Mar 2022 00:39:32 -0700 Received: from mtkmbs10n1.mediatek.inc (172.21.101.34) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Feb 2022 23:29:30 -0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Tue, 1 Mar 2022 15:29:29 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 1 Mar 2022 15:29:28 +0800 From: Jiaxin Yu To: CC: , , , , , , , , , , Jiaxin Yu , Jiaxin Yu Subject: [PATCH 1/2] ASoC: dt-bindings: mt8192-mt6359: add new compatible for using rt1015p and rt5682 Date: Tue, 1 Mar 2022 15:29:23 +0800 Message-ID: <20220301072924.24814-2-jiaxin.yu@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301072924.24814-1-jiaxin.yu@mediatek.com> References: <20220301072924.24814-1-jiaxin.yu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_233939_699853_9FE0EAAC X-CRM114-Status: UNSURE ( 7.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jiaxin Yu Adds new compatible string "mt8192_mt6359_rt1015p_rt5682s" for machines with rt1015p and rt5682s. Signed-off-by: Jiaxin Yu --- .../devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml index a781e7aaaa38..4b0b0478018a 100644 --- a/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml +++ b/Documentation/devicetree/bindings/sound/mt8192-mt6359-rt1015-rt5682.yaml @@ -18,6 +18,7 @@ properties: enum: - mediatek,mt8192_mt6359_rt1015_rt5682 - mediatek,mt8192_mt6359_rt1015p_rt5682 + - mediatek,mt8192_mt6359_rt1015p_rt5682s mediatek,platform: $ref: "/schemas/types.yaml#/definitions/phandle" From patchwork Tue Mar 1 07:29:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxin Yu X-Patchwork-Id: 12764251 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 9C156C433EF for ; Tue, 1 Mar 2022 07:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hSiaVeIy+nwKdhFvLfaMVemdNRnROtfL+qSRBdPU0Iw=; b=g0RzAliBS44+X2 YpJSI7UsrvQ5p/qRht8YEdkMBdqsD05dSfvJqVUCoObNF5Ycq7FjXPKPqCAII+aJSjw1kVrckPJ2U zG/FoKYdbmc7IfeH7w/Gsx0rSIE8OnWd47bPWEC8/s28hzSPT5JeDva1niJ6eYLlKdu75dgClVDUt 2bwHA/GyRKHvbnpEMRBp5WA5CyGVXC4BiHcN6dDwlE+wJlJt62db/ELLlZNTYdvFhsNUasUqUEAMh O8fJjpbhRh06z2suBA+XAhT+/D6jpe7ZXEcD0/bK1HV+B+/yCSqMeHxmhJClBA0vZ+GouRS7Dy46l Ns/0sJghCJl0y8hX0VPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOwxB-00FKG5-Gc; Tue, 01 Mar 2022 07:29:50 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOwx4-00FKBx-0J; Tue, 01 Mar 2022 07:29:44 +0000 X-UUID: 401d73947c584469948c49a14d88c16b-20220301 X-UUID: 401d73947c584469948c49a14d88c16b-20220301 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 825696553; Tue, 01 Mar 2022 00:29:33 -0700 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 28 Feb 2022 23:29:31 -0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 1 Mar 2022 15:29:30 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 1 Mar 2022 15:29:29 +0800 From: Jiaxin Yu To: CC: , , , , , , , , , , Jiaxin Yu , Jiaxin Yu Subject: [PATCH 2/2] ASoC: mediatek: mt8192: support rt1015p_rt5682s Date: Tue, 1 Mar 2022 15:29:24 +0800 Message-ID: <20220301072924.24814-3-jiaxin.yu@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220301072924.24814-1-jiaxin.yu@mediatek.com> References: <20220301072924.24814-1-jiaxin.yu@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_232942_061970_814DC630 X-CRM114-Status: GOOD ( 14.78 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jiaxin Yu Supports machines with rt1015p and rt5682s. Uses new proposed compatible string "mt8192_mt6359_rt1015p_rt5682s". Signed-off-by: Jiaxin Yu --- sound/soc/mediatek/Kconfig | 1 + .../mt8192/mt8192-mt6359-rt1015-rt5682.c | 87 +++++++++++++++++-- 2 files changed, 83 insertions(+), 5 deletions(-) diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index d515613a79da..cacfbab4262d 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -176,6 +176,7 @@ config SND_SOC_MT8192_MT6359_RT1015_RT5682 select SND_SOC_RT1015 select SND_SOC_RT1015P select SND_SOC_RT5682_I2C + select SND_SOC_RT5682S select SND_SOC_DMIC help This adds ASoC driver for Mediatek MT8192 boards diff --git a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c index a606133951b7..17ca6db5cd64 100644 --- a/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c +++ b/sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c @@ -31,6 +31,9 @@ #define RT5682_CODEC_DAI "rt5682-aif1" #define RT5682_DEV0_NAME "rt5682.1-001a" +#define RT5682S_CODEC_DAI "rt5682s-aif1" +#define RT5682S_DEV0_NAME "rt5682s.1-001a" + struct mt8192_mt6359_priv { struct snd_soc_jack headset_jack; struct snd_soc_jack hdmi_jack; @@ -632,18 +635,30 @@ SND_SOC_DAILINK_DEFS(i2s7, DAILINK_COMP_ARRAY(COMP_DUMMY()), DAILINK_COMP_ARRAY(COMP_EMPTY())); -SND_SOC_DAILINK_DEFS(i2s8, +SND_SOC_DAILINK_DEFS(i2s8_rt5682, DAILINK_COMP_ARRAY(COMP_CPU("I2S8")), DAILINK_COMP_ARRAY(COMP_CODEC(RT5682_DEV0_NAME, RT5682_CODEC_DAI)), DAILINK_COMP_ARRAY(COMP_EMPTY())); -SND_SOC_DAILINK_DEFS(i2s9, +SND_SOC_DAILINK_DEFS(i2s8_rt5682s, + DAILINK_COMP_ARRAY(COMP_CPU("I2S8")), + DAILINK_COMP_ARRAY(COMP_CODEC(RT5682S_DEV0_NAME, + RT5682S_CODEC_DAI)), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + +SND_SOC_DAILINK_DEFS(i2s9_rt5682, DAILINK_COMP_ARRAY(COMP_CPU("I2S9")), DAILINK_COMP_ARRAY(COMP_CODEC(RT5682_DEV0_NAME, RT5682_CODEC_DAI)), DAILINK_COMP_ARRAY(COMP_EMPTY())); +SND_SOC_DAILINK_DEFS(i2s9_rt5682s, + DAILINK_COMP_ARRAY(COMP_CPU("I2S9")), + DAILINK_COMP_ARRAY(COMP_CODEC(RT5682S_DEV0_NAME, + RT5682S_CODEC_DAI)), + DAILINK_COMP_ARRAY(COMP_EMPTY())); + SND_SOC_DAILINK_DEFS(connsys_i2s, DAILINK_COMP_ARRAY(COMP_CPU("CONNSYS_I2S")), DAILINK_COMP_ARRAY(COMP_DUMMY()), @@ -961,7 +976,6 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { .ignore_suspend = 1, .init = mt8192_rt5682_init, .be_hw_params_fixup = mt8192_i2s_hw_params_fixup, - SND_SOC_DAILINK_REG(i2s8), .ops = &mt8192_rt5682_i2s_ops, }, { @@ -970,7 +984,6 @@ static struct snd_soc_dai_link mt8192_mt6359_dai_links[] = { .dpcm_playback = 1, .ignore_suspend = 1, .be_hw_params_fixup = mt8192_i2s_hw_params_fixup, - SND_SOC_DAILINK_REG(i2s9), .ops = &mt8192_rt5682_i2s_ops, }, { @@ -1100,6 +1113,19 @@ static struct snd_soc_card mt8192_mt6359_rt1015p_rt5682_card = { .num_dapm_routes = ARRAY_SIZE(mt8192_mt6359_rt1015p_rt5682_routes), }; +static struct snd_soc_card mt8192_mt6359_rt1015p_rt5682s_card = { + .name = "mt8192_mt6359_rt1015p_rt5682s", + .owner = THIS_MODULE, + .dai_link = mt8192_mt6359_dai_links, + .num_links = ARRAY_SIZE(mt8192_mt6359_dai_links), + .controls = mt8192_mt6359_rt1015p_rt5682_controls, + .num_controls = ARRAY_SIZE(mt8192_mt6359_rt1015p_rt5682_controls), + .dapm_widgets = mt8192_mt6359_rt1015p_rt5682_widgets, + .num_dapm_widgets = ARRAY_SIZE(mt8192_mt6359_rt1015p_rt5682_widgets), + .dapm_routes = mt8192_mt6359_rt1015p_rt5682_routes, + .num_dapm_routes = ARRAY_SIZE(mt8192_mt6359_rt1015p_rt5682_routes), +}; + static int mt8192_mt6359_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card; @@ -1139,7 +1165,8 @@ static int mt8192_mt6359_dev_probe(struct platform_device *pdev) dai_link->platforms = i2s3_rt1015_platforms; dai_link->num_platforms = ARRAY_SIZE(i2s3_rt1015_platforms); - } else if (card == &mt8192_mt6359_rt1015p_rt5682_card) { + } else if (card == &mt8192_mt6359_rt1015p_rt5682_card || + card == &mt8192_mt6359_rt1015p_rt5682s_card) { dai_link->cpus = i2s3_rt1015p_cpus; dai_link->num_cpus = ARRAY_SIZE(i2s3_rt1015p_cpus); @@ -1150,6 +1177,52 @@ static int mt8192_mt6359_dev_probe(struct platform_device *pdev) dai_link->num_platforms = ARRAY_SIZE(i2s3_rt1015p_platforms); } + } else if (strcmp(dai_link->name, "I2S8") == 0) { + if (card == &mt8192_mt6359_rt1015_rt5682_card || + card == &mt8192_mt6359_rt1015p_rt5682_card) { + dai_link->cpus = i2s8_rt5682_cpus; + dai_link->num_cpus = + ARRAY_SIZE(i2s8_rt5682_cpus); + dai_link->codecs = i2s8_rt5682_codecs; + dai_link->num_codecs = + ARRAY_SIZE(i2s8_rt5682_codecs); + dai_link->platforms = i2s8_rt5682_platforms; + dai_link->num_platforms = + ARRAY_SIZE(i2s8_rt5682_platforms); + } else if (card == &mt8192_mt6359_rt1015p_rt5682s_card) { + dai_link->cpus = i2s8_rt5682s_cpus; + dai_link->num_cpus = + ARRAY_SIZE(i2s8_rt5682s_cpus); + dai_link->codecs = i2s8_rt5682s_codecs; + dai_link->num_codecs = + ARRAY_SIZE(i2s8_rt5682s_codecs); + dai_link->platforms = i2s8_rt5682s_platforms; + dai_link->num_platforms = + ARRAY_SIZE(i2s8_rt5682s_platforms); + } + } else if (strcmp(dai_link->name, "I2S9") == 0) { + if (card == &mt8192_mt6359_rt1015_rt5682_card || + card == &mt8192_mt6359_rt1015p_rt5682_card) { + dai_link->cpus = i2s9_rt5682_cpus; + dai_link->num_cpus = + ARRAY_SIZE(i2s9_rt5682_cpus); + dai_link->codecs = i2s9_rt5682_codecs; + dai_link->num_codecs = + ARRAY_SIZE(i2s9_rt5682_codecs); + dai_link->platforms = i2s9_rt5682_platforms; + dai_link->num_platforms = + ARRAY_SIZE(i2s9_rt5682_platforms); + } else if (card == &mt8192_mt6359_rt1015p_rt5682s_card) { + dai_link->cpus = i2s9_rt5682s_cpus; + dai_link->num_cpus = + ARRAY_SIZE(i2s9_rt5682s_cpus); + dai_link->codecs = i2s9_rt5682s_codecs; + dai_link->num_codecs = + ARRAY_SIZE(i2s9_rt5682s_codecs); + dai_link->platforms = i2s9_rt5682s_platforms; + dai_link->num_platforms = + ARRAY_SIZE(i2s9_rt5682s_platforms); + } } if (hdmi_codec && strcmp(dai_link->name, "TDM") == 0) { @@ -1185,6 +1258,10 @@ static const struct of_device_id mt8192_mt6359_dt_match[] = { .compatible = "mediatek,mt8192_mt6359_rt1015p_rt5682", .data = &mt8192_mt6359_rt1015p_rt5682_card, }, + { + .compatible = "mediatek,mt8192_mt6359_rt1015p_rt5682s", + .data = &mt8192_mt6359_rt1015p_rt5682s_card, + }, {} }; #endif