From patchwork Thu Oct 19 02:11:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhengqiao Xia X-Patchwork-Id: 13428167 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 27B23CDB482 for ; Thu, 19 Oct 2023 02:11:50 +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:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Azt+KfO9BoapxXrqgvd2zufA2s8NVZ07Ks//tnwBWjg=; b=1HV0TpDI/syIkiutVB3zv6PdPD hjGNXgnPwfa+oSZQjiLPeLn41YmEouUQESOFZKySmDuuLgiktey3eSrebuo5Wpbx+qb63/lzfeMIC xrhuZ+sp9n17BeLhm12e4lSm7gpwFWmvO+BwANdCk8K2WThTHuSf9bdhnOb/Xp4YmX45hqZA8IbrN GDnfRx5Q5kv7aTsegixab9XCnq3AC9ypOzLgTF7g1GDTS8pK/E6tsaKxS22ojTtKqOK983plgl9GD xAKOXf2+4WNd6ddMLl0pOJ+OUEHEE+uMjcDVahWZPnw4tkhrD/NIxB1OxwsGSv0a4BSLk+obOOKm8 b2NdDHwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtIVo-00G6d6-2s; Thu, 19 Oct 2023 02:11:48 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtIVl-00G6cC-0G for linux-mediatek@lists.infradead.org; Thu, 19 Oct 2023 02:11:47 +0000 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b20577ef7bso4780724b3a.3 for ; Wed, 18 Oct 2023 19:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1697681503; x=1698286303; darn=lists.infradead.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=Azt+KfO9BoapxXrqgvd2zufA2s8NVZ07Ks//tnwBWjg=; b=kmspirehVvERTKxFJSi2Rl9ekpUSrX/pZ0geP2Fr0KeK4+HdZ7Ji8r6PfOkBswbpOv RbvOSCmdTR0GsMX4jshdKF+MqJhh4EsTSaDGvDEgb6Aw5vao0GMAvFHvxJR35vr5PFcY 7+9bWTluqNkvWueDJ0l9WSBI8SNzLXOTO1cBNVXAVIHfEpp8tWuePw1UNCc5xFuaoFbO nVxbNLoS3YrMN84NAq+9jfFPk9+Bwxxn7pQBRs0fn2cYU/Lfwa/H0WuhC0rbRSwvwToC GHOhhF+SqXBno0o9ylEh4i9eo8SiqFCUkQkK3LQ/8IsD8Txl/LQvqh1+SdYukNRujIcJ eYYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697681503; x=1698286303; h=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=Azt+KfO9BoapxXrqgvd2zufA2s8NVZ07Ks//tnwBWjg=; b=PRjcQvf3HZb4/8/0EqKEMpH/p82LIvcUoU8TlUW2yvnctbmTqizzyPt8s0O8JzMKL/ 4/NxHpNn6d7Pk8pMuOWYWslpqqMile88BuLZWi7damX9B160BIA8LBJ5C6SyoKGVWiPT pQeM+mgfQwyzywhJTN1VqqvV7lPydAD/PXfii6qJ+ulfxHpb3ftIIQCZ4kJyXKy7ZSx4 MkLf+H+7+mA4dlGxaQ8LyMdnsBc3ENMTot+A15cgYpd9d63CBQdbM+pmSbs7r2Nf5Dk6 K6YhnmJUK83GCtzpSoOXucVYykVSdC7Aa1+edAd7WJ7H+sWke4x8ACCK8tSEfPjuH6JE lvqA== X-Gm-Message-State: AOJu0YxjipYkMXXUxd+b5MCk3Sz67kDy/S0Rku0HO2LauHge8PXTqPAj hNjwKsS94gu5P3LKeD5e2g3J5g== X-Google-Smtp-Source: AGHT+IFNM9DN+I31MJZtznVBNyudmhbiTq1tVGLCtePwCwctczzofTe/a2wJR7hJZK/9i/gwrSmiFg== X-Received: by 2002:a05:6a00:2d1a:b0:68e:2d59:b1f3 with SMTP id fa26-20020a056a002d1a00b0068e2d59b1f3mr748544pfb.13.1697681503421; Wed, 18 Oct 2023 19:11:43 -0700 (PDT) Received: from ubuntu.huaqin.com ([101.78.151.205]) by smtp.gmail.com with ESMTPSA id d7-20020aa797a7000000b0068fadc9226dsm3974278pfq.33.2023.10.18.19.11.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 19:11:43 -0700 (PDT) From: xiazhengqiao To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, angelogioacchino.delregno@collabora.com, matthias.bgg@gmail.com, perex@perex.cz, trevor.wu@mediatek.com, jiaxin.yu@mediatek.com Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, xiazhengqiao Subject: [v1 1/2] ASoC: dt-bindings: mt8186-mt6366-rt1019-rt5682s: add RT5650 support Date: Thu, 19 Oct 2023 10:11:32 +0800 Message-Id: <20231019021133.23855-2-xiazhengqiao@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231019021133.23855-1-xiazhengqiao@huaqin.corp-partner.google.com> References: <20231019021133.23855-1-xiazhengqiao@huaqin.corp-partner.google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231018_191145_137975_9B8F7160 X-CRM114-Status: UNSURE ( 7.32 ) 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 new sound card "mt8186_rt5650". RT5650 comes with amp and earphone codec. Signed-off-by: xiazhengqiao Reviewed-by: AngeloGioacchino Del Regno --- .../devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml b/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml index d80083df03eb..bdf7b0960533 100644 --- a/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml +++ b/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml @@ -17,6 +17,7 @@ properties: enum: - mediatek,mt8186-mt6366-rt1019-rt5682s-sound - mediatek,mt8186-mt6366-rt5682s-max98360-sound + - mediatek,mt8186-mt6366-rt5650-sound mediatek,platform: $ref: /schemas/types.yaml#/definitions/phandle From patchwork Thu Oct 19 02:11:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhengqiao Xia X-Patchwork-Id: 13428168 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 89FE1CDB47E for ; Thu, 19 Oct 2023 02:11:53 +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:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TesY55WayWThzDzzYAmx0jlTWe8bYphYnJXBdBkbqm4=; b=TIYaSMOmglSK8LbsBKkufdDIGJ kcCFazGwMtRjaNqrtxtGfg5P71W+wOTTqeT5QRUyG493p0j76bSmGoS5f4j2VOv1aISjj2JS19lV9 uxCv9iTM0Y+nzDgxJEny/qETOPxYrcL78u1lJuzHL1mgRFD37/IzIxBXR83gC1ZkcO0osrCbZZcnm pJOGE1WkIus3+iS2ztw8D4o1lmW4F/HsYLy9eOD+42AEhICrYmewz1j8RYDG0rA2U+i4sjW2Wejg9 3lnbXPUxOug5gwgzJVazD0/Jmytq0m1DrtGYxprob+x8O+1s3c/JX6KgvrB6dH8XLoT7RdickyyV+ qMdYzp4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qtIVs-00G6do-0x; Thu, 19 Oct 2023 02:11:52 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qtIVn-00G6cX-35 for linux-mediatek@lists.infradead.org; Thu, 19 Oct 2023 02:11:51 +0000 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6bd96cfb99cso3360070b3a.2 for ; Wed, 18 Oct 2023 19:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=huaqin-corp-partner-google-com.20230601.gappssmtp.com; s=20230601; t=1697681506; x=1698286306; darn=lists.infradead.org; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=TesY55WayWThzDzzYAmx0jlTWe8bYphYnJXBdBkbqm4=; b=gMub6IoH0NWoCtWSOOYzsuNuLEuInG0zZDd5qw2B2+lTuTUtfehR15g5Uc60bRTM4u ns6eTQRP4KKM14FtIFYfFvoR66hAK/IgbsvbenZ/CGP2DJfxMQR5R/2Xm6wXHznOKFP7 EXFICfDe6EvQ8GlIxhAmy1+EGpSFdFJHUbgCrMYNTA+HOcww4jPb9g0GGGJ/RoWzPAdj LEXk7n734ph5+t93psPm2Uso835Uoh1nKOYMlCoWYpmUSyOg6Us6/LoDtAHDh6SY0pY1 5UidBfQWePGOTQ0mdcc1+xxSLlD6nCmarYp97Z6hgE+SZlqdUjmTyTRUcZZdJHuQ6nM4 aHag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697681506; x=1698286306; h=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=TesY55WayWThzDzzYAmx0jlTWe8bYphYnJXBdBkbqm4=; b=VRC9R5KuMrpY3EYs2pD/htC6UtMM7BMb/LVCpoTelKFfxpRKs2ClXPykvQffutocxv p2kPiVR02Dz/rBVastn4OmrLuiuEAu/5XwldTdVHDE4G4qqAXGdzDE+MfEfwGYbXfKa0 jF61mn8ZjbxdecfZQea11XffO/oLHpfOIFcMhb+99SPmJZCqjow0xOeP2dsKb+yqK44h XFpQaIhwYXFDnLwtM4C7Q+m86E5FhY8kbt4d67reJSyPifgBabd+/kbRHvSx3A6aKl5O t8uM0dSZssturQpo7zPfqj122unBbeEN2bYSMG8xgQfSpge4+ual0BjuhDURE9ESGQCY JTDA== X-Gm-Message-State: AOJu0YwwJ9crS9bptqKpsg5Osdvgwce4fem0P9AhYCEHuFJG60jwTQhw J0UGrWGvU8FqBCkjNRfdTb/HJA== X-Google-Smtp-Source: AGHT+IEjGbSHVE9/MFrqNqEm01C96ZHgZKf48mYBwZfkvR+TH1wdoxro0LKzp/BecYxza4103ygmyg== X-Received: by 2002:a05:6a00:23c9:b0:693:3cac:7897 with SMTP id g9-20020a056a0023c900b006933cac7897mr947076pfc.9.1697681506266; Wed, 18 Oct 2023 19:11:46 -0700 (PDT) Received: from ubuntu.huaqin.com ([101.78.151.205]) by smtp.gmail.com with ESMTPSA id d7-20020aa797a7000000b0068fadc9226dsm3974278pfq.33.2023.10.18.19.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 19:11:46 -0700 (PDT) From: xiazhengqiao To: lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, angelogioacchino.delregno@collabora.com, matthias.bgg@gmail.com, perex@perex.cz, trevor.wu@mediatek.com, jiaxin.yu@mediatek.com Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, xiazhengqiao Subject: [v1 2/2] ASoC: mediatek: mt8186_mt6366_rt1019_rt5682s: add rt5650 support Date: Thu, 19 Oct 2023 10:11:33 +0800 Message-Id: <20231019021133.23855-3-xiazhengqiao@huaqin.corp-partner.google.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231019021133.23855-1-xiazhengqiao@huaqin.corp-partner.google.com> References: <20231019021133.23855-1-xiazhengqiao@huaqin.corp-partner.google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231018_191147_997173_2BD21BE0 X-CRM114-Status: GOOD ( 13.73 ) 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 RT5650 as the codec and the amp, add a new sound card named mt8186_rt5650. Signed-off-by: xiazhengqiao Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/Kconfig | 1 + .../mt8186/mt8186-mt6366-rt1019-rt5682s.c | 45 ++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig index 43c8fea00439..b93d455744ab 100644 --- a/sound/soc/mediatek/Kconfig +++ b/sound/soc/mediatek/Kconfig @@ -210,6 +210,7 @@ config SND_SOC_MT8186_MT6366_RT1019_RT5682S select SND_SOC_MAX98357A select SND_SOC_RT1015P select SND_SOC_RT5682S + select SND_SOC_RT5645 select SND_SOC_BT_SCO select SND_SOC_DMIC select SND_SOC_HDMI_CODEC diff --git a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c index 4684bfd89ecd..8c534c338f0e 100644 --- a/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c +++ b/sound/soc/mediatek/mt8186/mt8186-mt6366-rt1019-rt5682s.c @@ -170,6 +170,7 @@ static int mt8186_rt5682s_init(struct snd_soc_pcm_runtime *rtd) struct snd_soc_component *cmpnt_codec = snd_soc_rtd_to_codec(rtd, 0)->component; int ret; + int type; ret = mt8186_dai_i2s_set_share(afe, "I2S1", "I2S0"); if (ret) { @@ -193,7 +194,8 @@ static int mt8186_rt5682s_init(struct snd_soc_pcm_runtime *rtd) snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); - return snd_soc_component_set_jack(cmpnt_codec, jack, NULL); + type = SND_JACK_HEADSET | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | SND_JACK_BTN_3; + return snd_soc_component_set_jack(cmpnt_codec, jack, (void *)&type); } static int mt8186_rt5682s_i2s_hw_params(struct snd_pcm_substream *substream, @@ -1058,6 +1060,28 @@ mt8186_mt6366_rt1019_rt5682s_routes[] = { {"DSP_DL2_VIRT", NULL, SOF_DMA_DL2}, }; +static const struct snd_soc_dapm_route +mt8186_mt6366_rt5650_routes[] = { + /* SPK */ + {"Speakers", NULL, "SPOL"}, + {"Speakers", NULL, "SPOR"}, + /* Headset */ + { "Headphone", NULL, "HPOL" }, + { "Headphone", NULL, "HPOR" }, + { "IN1P", NULL, "Headset Mic" }, + { "IN1N", NULL, "Headset Mic"}, + /* HDMI */ + { "HDMI1", NULL, "TX" }, + /* SOF Uplink */ + {SOF_DMA_UL1, NULL, "UL1_CH1"}, + {SOF_DMA_UL1, NULL, "UL1_CH2"}, + {SOF_DMA_UL2, NULL, "UL2_CH1"}, + {SOF_DMA_UL2, NULL, "UL2_CH2"}, + /* SOF Downlink */ + {"DSP_DL1_VIRT", NULL, SOF_DMA_DL1}, + {"DSP_DL2_VIRT", NULL, SOF_DMA_DL2}, +}; + static const struct snd_kcontrol_new mt8186_mt6366_rt1019_rt5682s_controls[] = { SOC_DAPM_PIN_SWITCH("Speakers"), @@ -1096,6 +1120,21 @@ static struct snd_soc_card mt8186_mt6366_rt5682s_max98360_soc_card = { .num_configs = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_codec_conf), }; +static struct snd_soc_card mt8186_mt6366_rt5650_soc_card = { + .name = "mt8186_rt5650", + .owner = THIS_MODULE, + .dai_link = mt8186_mt6366_rt1019_rt5682s_dai_links, + .num_links = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_dai_links), + .controls = mt8186_mt6366_rt1019_rt5682s_controls, + .num_controls = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_controls), + .dapm_widgets = mt8186_mt6366_rt1019_rt5682s_widgets, + .num_dapm_widgets = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_widgets), + .dapm_routes = mt8186_mt6366_rt5650_routes, + .num_dapm_routes = ARRAY_SIZE(mt8186_mt6366_rt5650_routes), + .codec_conf = mt8186_mt6366_rt1019_rt5682s_codec_conf, + .num_configs = ARRAY_SIZE(mt8186_mt6366_rt1019_rt5682s_codec_conf), +}; + static int mt8186_mt6366_rt1019_rt5682s_dev_probe(struct platform_device *pdev) { struct snd_soc_card *card; @@ -1253,6 +1292,10 @@ static const struct of_device_id mt8186_mt6366_rt1019_rt5682s_dt_match[] = { .compatible = "mediatek,mt8186-mt6366-rt5682s-max98360-sound", .data = &mt8186_mt6366_rt5682s_max98360_soc_card, }, + { + .compatible = "mediatek,mt8186-mt6366-rt5650-sound", + .data = &mt8186_mt6366_rt5650_soc_card, + }, {} }; MODULE_DEVICE_TABLE(of, mt8186_mt6366_rt1019_rt5682s_dt_match);