From patchwork Thu Sep 22 09:49:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12984880 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 37509C6FA8B for ; Thu, 22 Sep 2022 10:08:45 +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=ZBcVM+dNT7dGuwcayOX+tTFI67v7gXCXjDKDeCaPN1I=; b=B0HUq6/y7kwlFnYQLcJKf7sZuf aOK4bONxSDh8qWThLobzsHBlrZF3Z3w5nOc3VFuh8GU3ZPdZyynxJspwC7uEWCNBrSnidQsDaQvEm GiTCuHzQnNbZo06TQcmlpPHczNRwIy1yGPIgERgcoWWmppXgcWQm3SZVN7/uZVEXv+qF2nJf8L9Y6 sxDhwHNDah8rqnyjmGNxIifTQ/JwjV1v7nwcRoGtwOe10GzZIMz2+EXl3IXRR4Jra1KKnhI8c0FSp AzwWcVPdTEwcUy8Rs9Ibv2DJUfh16Ma0mN29Yu8mq6tdhkHKoKp0dwiP7n/GK6aSdv20czsrKaJtO IusYziig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obJ8G-00EnGZ-BS; Thu, 22 Sep 2022 10:08:36 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obIpb-00EZ44-GO; Thu, 22 Sep 2022 09:49:21 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 31D1E660221D; Thu, 22 Sep 2022 10:49:14 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663840154; bh=HBq0403+8YpuivvuFKBBDzFD3nvqHpkf4SYdCxNYb+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LNCLBrgBKICqL6Zc2LWoquUWoO3DCOlq28tDIoj598l9jpRLe5F920EcaKFgA/jT5 okrEDAY5AUDWJ02UsOTatrut6vF9uFkLsL+4gsrWT+Z8pieR2NaxieTGkIFaNKpUgg hvO0rpYiR7nfn9im4zz0Md5UA3TeRjxzjtj5SDQV8XPQPOwjDFJw7hj0v+XK1jqI7f 657GcI2AGuscMNkCdTwKL9IhF875xgIIdZvglEPgzL7zmOMFSCzk3vyVttClTRcQih lIFpZFD8DWpgHX6PrMa22f2yM+uOVj8lqG97v0rwTq5+KOzZ1uhk2Wu4t4NZ5MvO+y l8AqpkCok77WQ== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno Subject: [PATCH 1/4] arm64: dts: mediatek: cherry: Add Audio Front End (AFE) support Date: Thu, 22 Sep 2022 11:49:05 +0200 Message-Id: <20220922094908.41623-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220922094908.41623-1-angelogioacchino.delregno@collabora.com> References: <20220922094908.41623-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220922_024919_868316_FFE0ABBC X-CRM114-Status: UNSURE ( 9.28 ) 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 In preparation for adding audio support, enable the AFE HW with the appropriate eTDM configuration and memory region. Signed-off-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi index 9b62e161db26..bc7890300a57 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi @@ -117,9 +117,23 @@ scp_mem: memory@50000000 { reg = <0 0x50000000 0 0x2900000>; no-map; }; + + afe_mem: memory@60d80000 { + compatible = "shared-dma-pool"; + reg = <0 0x60d80000 0 0x100000>; + no-map; + }; }; }; +&afe { + status = "okay"; + + mediatek,etdm-in2-cowork-source = <2>; + mediatek,etdm-out2-cowork-source = <0>; + memory-region = <&afe_mem>; +}; + &i2c0 { status = "okay"; From patchwork Thu Sep 22 09:49:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12984879 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 51A34C6FA82 for ; Thu, 22 Sep 2022 10:08:43 +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=GpZtFrMvgpzkW7K6t+sA3UQxZl7aYxl7wu1jxpPoQiA=; b=4Sikm0Pv0HdtEs3JbLpd099DBW kyCyE3q/EETTrFIPkSGRjmbIr7rZzMoZREW3OcQQSiEf/3elymogWZ6vLDS6fXK7o43T2PMxd+7DV Vvea7LvOdxhmJvDK7/s6IHFFV8UFAirg3yPkjHK8vCz2n9jQ4Ldux8s5cyLQHszVOcvT2Srr/GK93 WmxTvJXV2f3GzMUfofOO3DCDa9JPzywKs14C1jzTW6lCC9t8ZZTvFXuKOK8OQRiaAmXm08r9MvCka aVa+Z5bXiXoixoi8QpBzCOcd0TqglN39WOTn77weqBMsAtEhsYXQ/BHqVyY2AKoTt0wLri32UQsCF DH6jTNdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obJ8F-00EnFp-9E; Thu, 22 Sep 2022 10:08:35 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obIpb-00EZ4S-GM; Thu, 22 Sep 2022 09:49:21 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id CF352660221E; Thu, 22 Sep 2022 10:49:14 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663840155; bh=fkgvOEpFveDqGiVfiz6Zm3QLw7vdRwQw9bnbQlnHoOk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H+cBS6rhWgJGmzcx2x181scVLmXL0RRRCKb81jbR7XY+bxqAFOoe8fxZLJJNUjmaM W2u1BjDecDBjzsEGdlKBncc1kL6TBkts3u1L+3MXyRLTlhSX/zH3EzsJqSEieGvnTJ /QXRoxI836Z/1bLxlrjPRLF210jBZKCfl/RJ/GI2PdndpujTkHZe7XoRqNlTbhkuyD e6KZzvzFXPoXikVzvPSPxLArNjFQS/FJ9ghUFt98KzeJNS6RN3wyoleReKI9EM9FfR vFtoDj4w/hXtsPr3yP1UwoRr632syKWUcvIdAmbA/t1xYWMSgv3Xve/ai099UjiMIY ZVXY8j0XP4d3A== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno Subject: [PATCH 2/4] arm64: dts: mediatek: cherry: Enable the Audio DSP for SOF Date: Thu, 22 Sep 2022 11:49:06 +0200 Message-Id: <20220922094908.41623-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220922094908.41623-1-angelogioacchino.delregno@collabora.com> References: <20220922094908.41623-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220922_024919_868590_D5D84795 X-CRM114-Status: UNSURE ( 9.90 ) 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 This platform is able to use the Audio DSP embedded into the MT8195 SoC: in preparation for adding audio support for Cherry, add the ADSP related memory nodes and enable it. Signed-off-by: AngeloGioacchino Del Regno --- .../arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi index bc7890300a57..3bc624e6f499 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi @@ -118,14 +118,32 @@ scp_mem: memory@50000000 { no-map; }; + adsp_mem: memory@60000000 { + compatible = "shared-dma-pool"; + reg = <0 0x60000000 0 0xd80000>; + no-map; + }; + afe_mem: memory@60d80000 { compatible = "shared-dma-pool"; reg = <0 0x60d80000 0 0x100000>; no-map; }; + + adsp_device_mem: memory@60e80000 { + compatible = "shared-dma-pool"; + reg = <0 0x60e80000 0 0x280000>; + no-map; + }; }; }; +&adsp { + status = "okay"; + + memory-region = <&adsp_device_mem>, <&adsp_mem>; +}; + &afe { status = "okay"; From patchwork Thu Sep 22 09:49:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12984883 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 1736DC6FA8B for ; Thu, 22 Sep 2022 10:08: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: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=qV5leCHbr4JivqIZ66oYInQjuplf0tpW/SlhpQUaiZw=; b=hxbYuv2ukgssUdNLT1LGRmnah0 GSuoWQ1TvrBXQ57TIqrzRg+00QUMpRWitOOQyM+MwLBP0G1mUz7Q8uReESN4L+EcUADOQmAEx7bxx JIT0LUIsZ9zZ4zZzIOsAmlzmwlVMVa8qWL3VkVVrh1U9mrJ1UvsiFWQEtuY+xDOP6Ns02RnF7kdmu kW0kXALRjxEOQ/3kVfpma9hH3/ZpZpCqHZY1uJMSkh1ftUHmNQAwQtFsKE4KU4eO+X2LMWTlysiuk JE41h8fL/W73wq0AtPFleTuHuhPob1SBWPJ6QsZNsWTZOYB1m23RbnY0zedz+rS2A7VSfMKA5b/WD gWpEZIyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obJ8L-00EnJk-Ap; Thu, 22 Sep 2022 10:08:41 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obIpb-00EZ4d-Gb; Thu, 22 Sep 2022 09:49:22 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id B4E05660221F; Thu, 22 Sep 2022 10:49:15 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663840156; bh=aRbfk1mhUI8dAkF85RnEwt7brGuOKIQtd68vjz91JhA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=azxjEguhsDUEOz0xDuinewwHFTLJS0stz6G3zouz9QjS7aepKc6POfoeaCHVWlbNr 7qKEzBztUrEJ2YLcjUdofbfC+roVyqCAXB3CP824gBTJTWHFYzmEDpJ9s7wrXDzOFk buChQveFUXxD4+DZPAnRrYUJ8HRh4rrqt0upBIv0VXS6Iot6pwETLY7/gJd7pkiPgb jLF5BrczFb453x3QNvKDd+4SblxZn6H7HM4cuS7kMqRhpBRcGx9qRGTMTNzWUMuh6/ bHaNT1m48J5rODZxMNcaRF2armeRRiAAxF4QNlNOUfnbl98Z8AgBtvmtA++rVEFzl6 lpqd30rbEsYwQ== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno Subject: [PATCH 3/4] arm64: dts: mediatek: cherry: Add external codecs and speaker amplifier Date: Thu, 22 Sep 2022 11:49:07 +0200 Message-Id: <20220922094908.41623-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220922094908.41623-1-angelogioacchino.delregno@collabora.com> References: <20220922094908.41623-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220922_024919_959742_D4430D9E X-CRM114-Status: GOOD ( 12.30 ) 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 The entire Cherry family has two digital microphones, for which we use the generic dmic-codec, linked to the MT6359 PMIC. Moreover, it uses a Realtek RT1019p amplifier for the speakers and has either a Realtek RT5682i or RT5682s audio codec on I2C2: specifically, RT5682i is found on Tomato's rev 1 and rev 2 boards, while RT5682s is found in rev3 and rev4 boards. Signed-off-by: AngeloGioacchino Del Regno --- .../dts/mediatek/mt8195-cherry-tomato-r1.dts | 5 +++ .../dts/mediatek/mt8195-cherry-tomato-r2.dts | 5 +++ .../dts/mediatek/mt8195-cherry-tomato-r3.dts | 5 +++ .../boot/dts/mediatek/mt8195-cherry.dtsi | 37 +++++++++++++++++++ 4 files changed, 52 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts index 3348ba69ff6c..3767b49ea896 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts @@ -10,6 +10,11 @@ / { compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195"; }; +&audio_codec { + compatible = "realtek,rt5682i"; + realtek,btndet-delay = <16>; +}; + &ts_10 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts index 4669e9d917f8..0ed83a79d680 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts @@ -10,6 +10,11 @@ / { compatible = "google,tomato-rev2", "google,tomato", "mediatek,mt8195"; }; +&audio_codec { + compatible = "realtek,rt5682i"; + realtek,btndet-delay = <16>; +}; + &pio_default { pins-low-power-hdmi-disable { pinmux = , diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts index 5021edd02f7c..c47b341e98fb 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts @@ -11,6 +11,11 @@ / { "google,tomato", "mediatek,mt8195"; }; +&audio_codec { + compatible = "realtek,rt5682s"; + realtek,amic-delay-ms = <250>; +}; + &pio_default { pins-low-power-hdmi-disable { pinmux = , diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi index 3bc624e6f499..95e93b791432 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi @@ -26,6 +26,12 @@ chosen { stdout-path = "serial0:115200n8"; }; + dmic-codec { + compatible = "dmic-codec"; + num-channels = <2>; + wakeup-delay-ms = <50>; + }; + memory@40000000 { device_type = "memory"; reg = <0 0x40000000 0 0x80000000>; @@ -136,6 +142,14 @@ adsp_device_mem: memory@60e80000 { no-map; }; }; + + spk_amplifier: rt1019p { + compatible = "realtek,rt1019p"; + label = "rt1019p"; + pinctrl-names = "default"; + pinctrl-0 = <&rt1019p_pins_default>; + sdb-gpios = <&pio 100 GPIO_ACTIVE_HIGH>; + }; }; &adsp { @@ -185,6 +199,17 @@ &i2c2 { clock-frequency = <400000>; pinctrl-names = "default"; pinctrl-0 = <&i2c2_pins>; + + audio_codec: codec@1a { + /* Realtek RT5682i or RT5682s, sharing the same configuration */ + reg = <0x1a>; + interrupts-extended = <&pio 89 IRQ_TYPE_EDGE_BOTH>; + realtek,jd-src = <1>; + + AVDD-supply = <&mt6359_vio18_ldo_reg>; + MICVDD-supply = <&pp3300_z2>; + VBAT-supply = <&pp3300_z5>; + }; }; &i2c3 { @@ -289,6 +314,11 @@ &mmc1 { vqmmc-supply = <&mt_pmic_vmc_ldo_reg>; }; +&mt6359codec { + mediatek,dmic-mode = <1>; /* one-wire */ + mediatek,mic-type-0 = <2>; /* DMIC */ +}; + /* for CPU-L */ &mt6359_vcore_buck_reg { regulator-always-on; @@ -723,6 +753,13 @@ pins-low-power-pupd { }; }; + rt1019p_pins_default: rt1019p-default-pins { + pins-amp-sdb { + pinmux = ; + output-low; + }; + }; + scp_pins: scp-default-pins { pins-vreq { pinmux = ; From patchwork Thu Sep 22 09:49:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 12984881 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 61A53C6FA82 for ; Thu, 22 Sep 2022 10:08:45 +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=I4oWCwYFuP6OwbsQXM22bh9hzaCtQ3VsEH730TRt3wo=; b=QkGNUnD/N08Jvdu+dnD+Av9bYZ PiF2+ajPAOjar8zR8IuQIRjC/+VtPCtIgjio3Y7N/OYRUg3OC1sdCv53SEyr0sp8fmDM/V9i0wLhn T7R6Y/p+7T/q2Cw1aHvrd0X0flUVVfK/m47vKqUk8xyS+61wD2XVENTQf5ra1rDkm45gh9HPHcjA6 ErVHEiAEN0ZOX9dRpJ6+2aWqCjlmYVjjtmgXBeTYHWzGjzk2DM89Fd+lgir5LvnHLschjIq5FTB4Q m2aPGZYLXKGCb7hMl63RdCXlVwVk50VXreY1S0E/q5FF2fCikKJ1sKp2QjvBhdOC+VQygEqbImNx8 8qq5ZIVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obJ8E-00EnEy-5I; Thu, 22 Sep 2022 10:08:34 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obIpb-00EZ4p-Gc; Thu, 22 Sep 2022 09:49:22 +0000 Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 5AB706602220; Thu, 22 Sep 2022 10:49:16 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663840156; bh=wJr++mgtlB0haCHpsGcU+/sZxX7EhT3lTzKcLP5Sa+s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=my13z2QCQ8ScWdhB1vhyZRsI+1ungf5aAE9eQB5FnsrX8JmyqTjOqLlkOqL54P/w9 hwMsDnsIGWpQrAJuM/lDuFNGaN53YvjZG4D67yd/2yvbl/GXsUbXOQsYX5NT3faYQR L0wutPj8FEcMVdbNYzfndu3g3rkeMNp0S3ToETcOI+jMGldcUpZB4v5LnkaWas7SgO 1PiYEyooESo0x/wz79FHNCKjsfI4a0owXfS0TXPSSCd3XYjA9NZIgNVnFWc8b0n3yj rPOtrHV/Uq9tl6gg9APb0J/yPYI1IRgeEVgOL3avTo9og1zecBxyUG7ZPg411MNDTP XNfwiDB0SWPvg== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, wenst@chromium.org, AngeloGioacchino Del Regno Subject: [PATCH 4/4] arm64: dts: mediatek: cherry: Add sound card configuration Date: Thu, 22 Sep 2022 11:49:08 +0200 Message-Id: <20220922094908.41623-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220922094908.41623-1-angelogioacchino.delregno@collabora.com> References: <20220922094908.41623-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220922_024919_905701_CC14DB70 X-CRM114-Status: UNSURE ( 9.74 ) 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 Configure the sound card on all MT8195 Cherry Tomato devices to enable audio support. Signed-off-by: AngeloGioacchino Del Regno --- .../dts/mediatek/mt8195-cherry-tomato-r1.dts | 5 +++ .../dts/mediatek/mt8195-cherry-tomato-r2.dts | 5 +++ .../dts/mediatek/mt8195-cherry-tomato-r3.dts | 5 +++ .../boot/dts/mediatek/mt8195-cherry.dtsi | 40 +++++++++++++++++++ 4 files changed, 55 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts index 3767b49ea896..2d5e8f371b6d 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts @@ -15,6 +15,11 @@ &audio_codec { realtek,btndet-delay = <16>; }; +&sound { + compatible = "mediatek,mt8195_mt6359_rt1019_rt5682"; + model = "mt8195_r1019_5682"; +}; + &ts_10 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts index 0ed83a79d680..2586c32ce6e6 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts @@ -35,6 +35,11 @@ pins-low-power-pcie0-disable { }; }; +&sound { + compatible = "mediatek,mt8195_mt6359_rt1019_rt5682"; + model = "mt8195_r1019_5682"; +}; + &ts_10 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts index c47b341e98fb..f54f9477b99d 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts @@ -36,6 +36,11 @@ pins-low-power-pcie0-disable { }; }; +&sound { + compatible = "mediatek,mt8195_mt6359_rt1019_rt5682"; + model = "m8195_r1019_5682s"; +}; + &ts_10 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi index 95e93b791432..3410e16d7e99 100644 --- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi @@ -526,6 +526,34 @@ &pio { "AP_SPI_FLASH_MOSI", "AP_SPI_FLASH_MISO"; + aud_pins_default: audio-default-pins { + pins-cmd-dat { + pinmux = , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + , + ; + }; + + pins-hp-jack-int-odl { + pinmux = ; + input-enable; + bias-pull-up = ; + }; + }; + cr50_int: cr50-irq-default-pins { pins-gsc-ap-int-odl { pinmux = ; @@ -833,6 +861,18 @@ cros-ec-rpmsg { }; }; +&sound { + status = "okay"; + + mediatek,adsp = <&adsp>; + mediatek,dai-link = + "DL10_FE", "DPTX_BE", "ETDM1_IN_BE", "ETDM2_IN_BE", + "ETDM1_OUT_BE", "ETDM2_OUT_BE","UL_SRC1_BE", + "AFE_SOF_DL2", "AFE_SOF_DL3", "AFE_SOF_UL4", "AFE_SOF_UL5"; + pinctrl-names = "default"; + pinctrl-0 = <&aud_pins_default>; +}; + &spi0 { status = "okay";