From patchwork Tue Oct 3 13:18:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 728984 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C8442628C for ; Tue, 3 Oct 2023 13:18:49 +0000 (UTC) Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23E56A7; Tue, 3 Oct 2023 06:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339125; cv=none; d=strato.com; s=strato-dkim-0002; b=iXvByhZmQv4Vwaqxi5klQsQ1u4CuQgIoeUAkwcbYtdy1S5iyBZiIDoZV68gNqkF+It 2mbflE67R7hYoq6VhRgWzXgAtqK4Wf5hsMulEj7Q6wOjbg8MyqJnrMugUX2/FeLicOu0 Qh9klP5Cgt25jphownK55vgM8ZLXpAz+5Nw7IPuVrcsD+RQVDaZtOsFkUjcvUXHijFZt H5upgM5/zMHZe+RaVLO1yb9if2GQUHlXg91Lcr08EHpNvx2NHalAAyxR/vBAZka6Cr6U WTaK2Vlf4kakSUNzW/vrJzYZsbfxdjcdsCEav6Gj2QB8CzgDV8wTkI0KOIiFRsrOgR38 z/5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339125; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=9LB17dLFMfNzTJngJvf42XBLSmJlOf4/DOV/P11USUY=; b=YdbmUy8X8f6a9Nj4x/E/Oub6xXxlrtrhHBNCyF1HYahIZLpewtu1zun6DGNDT06jtF ML6iIR9/q0BmSVTo5V25QNOO3wCWVRpiDEZkf0eIF3Cr3IHHoEcLCnFpI2/+nWd/nzbe QRaGcLbrc17vhhzSIO8r2MAbhzwf/gjNhu4cGySWi71L93d+SK2gXQ7es4+vqVrlEWHp zsxV3tXU1eoNKaPAR1s7lTMYMjazNCxF7U5txSuxN9gtieZiBGl6hEbwYOSaCm+DsKWB ++i321gZ5m9CnP5kcmcspEDJpwLfL4rwnj/PwM/RhMijKbSzbf+7NGAkbyZPi8cQgh1f klfw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339125; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=9LB17dLFMfNzTJngJvf42XBLSmJlOf4/DOV/P11USUY=; b=NkYEZ9e+dEE6Gtu+yuSQHUqrgCjjWDIEQ46+yczB0lgu8BE9Dzbc0BLgcpqFXXCcIY QgrS7awYirwGzUs1COV13+85thlioRah1OPM3rXsRiPUGO34kkmNQDfkh5MnW9i6ZblZ 4a1oNdkm5SAnMCYDBU0gANGGOHqJLxl+xc9HF0GBpz6qj3WUASacElzDi+vaQg+hE9Xk RcA4RW1njFlbXqe52f6IUWZj7A9ljPy8PCbC0iKY8dPRl9CHviJ42vM4jpyXgDUFzKRf gwYsf2GvM8oE4TVIrX91qHq7OW1DEKGYByCS8EdJvj06/ta63Wgn26iknJx4+5iVt8Dj O0aw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339125; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=9LB17dLFMfNzTJngJvf42XBLSmJlOf4/DOV/P11USUY=; b=ZPdEbvBV1b0xqeLjPFGT/XZno1FBBAM77dYEP5XOE1R8PLvjtgn+gaLNJmXuTtkWYy rhIG1rs9+EgZag97e6BA== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn8u4l+/zY=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.8.2 DYNA|AUTH) with ESMTPSA id R04c57z93DIj2OF (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:45 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:21 +0200 Subject: [PATCH v2 03/14] arm64: dts: qcom: msm8939: Add QDSP6 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-3-61b684be55c0@gerhold.net> References: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> In-Reply-To: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> To: Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Bryan O'Donoghue , Stephan Gerhold X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net MSM8939 does not have a dedicated ADSP. Instead, the audio services via APR are also implemented by the modem DSP. Audio can be either routed via the modem DSP (necessary for voice call audio etc) or directly sent to the LPASS hardware (currently used by DB410c). Bypassing QDSP6 audio is only possible with special firmware (on DB410c) or when the modem DSP is completely disabled. Add the typical nodes for QDSP6 audio to msm8939.dtsi. The apr node is disabled by default to avoid changing behavior for devices like apq8039-t2 that use the bypassed audio path. Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8939.dtsi | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi b/arch/arm64/boot/dts/qcom/msm8939.dtsi index 65c68e0e88d5..95610a32750a 100644 --- a/arch/arm64/boot/dts/qcom/msm8939.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi @@ -10,6 +10,7 @@ #include #include #include +#include #include / { @@ -1615,6 +1616,54 @@ smd-edge { qcom,remote-pid = <1>; label = "hexagon"; + + apr: apr { + compatible = "qcom,apr-v2"; + qcom,smd-channels = "apr_audio_svc"; + qcom,domain = ; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + q6core: service@3 { + compatible = "qcom,q6core"; + reg = ; + }; + + q6afe: service@4 { + compatible = "qcom,q6afe"; + reg = ; + + q6afedai: dais { + compatible = "qcom,q6afe-dais"; + #address-cells = <1>; + #size-cells = <0>; + #sound-dai-cells = <1>; + }; + }; + + q6asm: service@7 { + compatible = "qcom,q6asm"; + reg = ; + + q6asmdai: dais { + compatible = "qcom,q6asm-dais"; + #address-cells = <1>; + #size-cells = <0>; + #sound-dai-cells = <1>; + }; + }; + + q6adm: service@8 { + compatible = "qcom,q6adm"; + reg = ; + + q6routing: routing { + compatible = "qcom,q6adm-routing"; + #sound-dai-cells = <0>; + }; + }; + }; }; }; From patchwork Tue Oct 3 13:18:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 728983 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3CE1262B7 for ; Tue, 3 Oct 2023 13:18:50 +0000 (UTC) Received: from mo4-p03-ob.smtp.rzone.de (mo4-p03-ob.smtp.rzone.de [81.169.146.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DF76B4; Tue, 3 Oct 2023 06:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339126; cv=none; d=strato.com; s=strato-dkim-0002; b=aVgM+IvjYki+e6m03nYvuqPVuUudpgj3brw1fubF1/D0uXwih5JJo5hAdpMRJbqMFl EEx3JS47drXV7/eOm38fJCymgKL8PSR+f7zFY+opt4JJ2bGKOP6VDUHY9edI7jnIK5i7 fHQ0bpe83Ut1QL5oJQHYRhvrVpwspb6EyrJFzmIo1Q6st4r/3MisCmB3DXiDuqMScCny EXs7pSbPsLfzm7s9mhMiiFHcEFVOF6Hcb5mgNHsNDCCWZNcRunE9Wowxt364OC3x70JF raxAQVgxhnxp8ichqABmcylugQaIYOW/rbMerk3U+YZ2AwO3p9A0F++w/rLK0PF/lL2x dDXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339126; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=KXUcWTcA9b6HuhOlbQlLI1PnL8fJ2J/EZHn+uesquek=; b=AV4/OhY3AaERy8MdxKMdvt3/Txm9qEu/f7TFoHpN0h13WzIFmDhnrdCuPKB0DQLwRf J/bzdkOZsL3kQiVIE5vkixUcLqY4lgQQ3K+p1gKutRtZywu5OCDme8d0Cl9Pt18N5oi0 FOHLkZd/rLZa7fWD1ASRlNyuvo8T3CALPaQB1fDP6m0tLPntffL8tTYZq0ODU78w6IpR 0CIyHftunN/dvJTRho/09hYWeAvOsvqZPD+zqqAH9TiNc3zlaURkwkC3UN4xRAY5s0f+ Fc/K51WvKSCz2w83czRpdeh1B6TdadFkWxly3rJ+uBEKEJrvOnuwgEWMtsC0qGulC31O WdEA== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339126; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=KXUcWTcA9b6HuhOlbQlLI1PnL8fJ2J/EZHn+uesquek=; b=TxShZE2YDdsni6N0gmA6ElBz62zsKCOSxM1tIgUkvAP+m/bAsBhtiddhdGLpM6rOp4 0HZxBP/9FagVXR1B+N4/TQhxehPv5KTzLf1uPpNivVWbkWPcK1aDpmgTPtLQV0A/aT51 2LYKZ2pPlZ7raOPP8AITxV3Rq1gKdBWCb45nvQpHIEmGYnvf7KktJ2+KPZ4B2HXz63Xv lbQUcpotscHodVSedRYJgIvDQOT1m6MLzCfhH47deiDx8k1BxpZ8rH/H7W9yUy6Iz8wJ pj+deeNHEOkyvbtNTgwKUK6pZWq9WNGkXsyAM4qrSWPguEC5YJQAkhaER1Vyy54vEgvZ wpvg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339126; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=KXUcWTcA9b6HuhOlbQlLI1PnL8fJ2J/EZHn+uesquek=; b=e6/VmJm9jzo7SdTpCy/zciG2cqfjI1yuFWwrkybuCLiyMVA1DWWPQvOUtRWx/JRknm MF1/7A6RL0hlMJeyrfBw== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn8u4l+/zY=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.8.2 DYNA|AUTH) with ESMTPSA id R04c57z93DIj2OH (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:45 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:23 +0200 Subject: [PATCH v2 05/14] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-5-61b684be55c0@gerhold.net> References: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> In-Reply-To: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> To: Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Bryan O'Donoghue , Stephan Gerhold , "Lin, Meng-Bo" X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Enable sound and modem for the Samsung A2015 based devices (A3, A5, E5, E7, Grand Max). The setup is similar to most MSM8916 devices, i.e.: - QDSP6 audio - Earpiece/headphones/microphones via digital/analog codec in MSM8916/PM8916 - WWAN Internet via BAM-DMUX except: - NXP TFA9895 codec for speaker on Quaternary MI2S - Samsung-specific audio jack detection (not supported yet) [Lin: Add e2015 and grandmax] Co-developed-by: "Lin, Meng-Bo" Signed-off-by: "Lin, Meng-Bo" Signed-off-by: Stephan Gerhold --- .../dts/qcom/msm8916-samsung-a2015-common.dtsi | 71 ++++++++++++++++++++++ .../dts/qcom/msm8916-samsung-e2015-common.dtsi | 4 ++ .../boot/dts/qcom/msm8916-samsung-grandmax.dts | 4 ++ 3 files changed, 79 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi index 0b29132b74e1..2937495940ea 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi @@ -1,10 +1,13 @@ // SPDX-License-Identifier: GPL-2.0-only #include "msm8916-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + #include #include #include #include +#include / { aliases { @@ -196,6 +199,18 @@ vibrator: vibrator { }; }; +&blsp_i2c1 { + status = "okay"; + + speaker_codec: audio-codec@34 { + compatible = "nxp,tfa9895"; + reg = <0x34>; + vddd-supply = <&pm8916_l5>; + sound-name-prefix = "Speaker"; + #sound-dai-cells = <0>; + }; +}; + &blsp_i2c2 { status = "okay"; @@ -243,6 +258,25 @@ &gpu { status = "okay"; }; +/* + * For some reason the speaker amplifier is connected to the second SD line + * (MI2S_2_D1) instead of the first (MI2S_2_D0). This must be configured in the + * device tree, otherwise audio will seemingly play fine on the wrong SD line + * but the speaker stays silent. + * + * When routing audio via QDSP6 (the default) the &lpass node is reserved and + * the definitions from &q6afedai are used. When the modem is disabled audio can + * be alternatively routed directly to the LPASS hardware with reduced latency. + * The definitions for &lpass are here for completeness to simplify changing the + * setup with minor changes to the DT (either manually or with DT overlays). + */ +&lpass { + dai-link@3 { + reg = ; + qcom,playback-sd-lines = <1>; + }; +}; + &mdss { status = "okay"; }; @@ -253,6 +287,10 @@ &mdss_dsi0 { pinctrl-1 = <&mdss_sleep>; }; +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5400000>; +}; + &pm8916_resin { status = "okay"; linux,code = ; @@ -265,6 +303,13 @@ pm8916_l17: l17 { }; }; +&q6afedai { + dai@22 { + reg = ; + qcom,sd-lines = <1>; + }; +}; + &sdhc_1 { status = "okay"; }; @@ -279,6 +324,32 @@ &sdhc_2 { cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; }; +&sound { + model = "samsung-a2015"; + audio-routing = + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS External1"; + + pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default>; + pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep>; + pinctrl-names = "default", "sleep"; + + sound_link_backend2: backend2-dai-link { + link-name = "Quaternary MI2S"; + + cpu { + sound-dai = <&q6afedai QUATERNARY_MI2S_RX>; + }; + platform { + sound-dai = <&q6routing>; + }; + codec { + sound-dai = <&speaker_codec>; + }; + }; +}; + &usb { status = "okay"; extcon = <&muic>, <&muic>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi index 0824ab041d80..3c49dac92d2d 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi @@ -65,6 +65,10 @@ accelerometer@1d { }; }; +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5a00000>; +}; + ®_motor_vdd { regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts index 3f145dde4059..5882b3a593b8 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts @@ -49,6 +49,10 @@ ®_touch_key { status = "disabled"; }; +&sound { + model = "samsung-gmax"; /* No secondary microphone */ +}; + &tlmm { gpio_leds_default: gpio-led-default-state { pins = "gpio60"; From patchwork Tue Oct 3 13:18:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 728982 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5E7125107 for ; Tue, 3 Oct 2023 13:18:51 +0000 (UTC) Received: from mo4-p03-ob.smtp.rzone.de (mo4-p03-ob.smtp.rzone.de [81.169.146.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90469BD; Tue, 3 Oct 2023 06:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339126; cv=none; d=strato.com; s=strato-dkim-0002; b=L1oQY7PnVX/f6k10ssuj3NeRvAvSwmvEvpCWMQ7B8o3qWsQB8fxtjpA8rWmehWX+Gv Agtb7WK0WCsF4tL+jAI//5JmtobedGbkAb5hjJLB6lKLoAppta40KQYTrA0hGUWVQuFy qcvXhW5oiBGd7DE8xE631leYAfa1Y0dRz7u6jLc96hoSRiCWxhIUL5hHD9h54xrX++fb tN91gPUr3pmZDhZAQCCZNwrLJZHxEdvAB3BCvvY8HZ93hAbMeEV9Y+FUp9lyq+33YF/R Zp8fhO3w11iMgIQmvVfB652kp8tEBhA6z8ZEJwuMrfQU63jQkfuqf2/HOw4Y38QFs5pu itng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339126; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=CJfhHqq4bYPkDlzc+To1FAdUVzbIpBsNH1YlvpKh7/I=; b=GeCizgeOuxN19DGUGNvSNXNywnok/uHOL1mE25O4V0d/egFPgQVoIJlE49hg6E/5cp GI5Im/xIkWSfIrcX3qqhB6YwNdiEacnPmFrR+6E0WbizE7+SfSaO1+/dg16dr78DcAFT fd05xQNOOhXQqWD8OKnLAZna9VVuhGAlG0GPCSMfgTZlg/gBdoCBmiNgcQiIzkb6fzwc 8G5BZQXg6VTnD+G/kEweLFpcHNQugXX10Xexx9KlNl8cUik6bDWOTNVm3frD66gOsebW 52BE8cJUNVTfXjkVJ38gXXe97KA8CqvQ8UXkOxI3kKGDjhVsgNm6AgH70uTu2jQJ9GyZ gZbQ== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339126; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=CJfhHqq4bYPkDlzc+To1FAdUVzbIpBsNH1YlvpKh7/I=; b=EfvDZSgkuR9Cx98wiizOeEeMWht+xrpoEDw1AB/0eRTxZwK20bcFaDJqFSvLdMonng meP1aURrKGxzzGHq3lxQI+7Kwu8LaO89Day/IwpJIgG3y2nWNFDqe3f9Y4mdgB3ONJAV W3CwPpXtKCXGWr/um0B14pom0TylTpgJ5eZpNVWGpjNEEOf6MMNm4C+cvGw4Y3a7+gkw UXscrg/YPMaRhnQGt90KtuGolUaAJ6bIgI2LrTV0H8xLFkFYFTVUMZxdKdHwdSujQ9k/ yGYTyYbBFJxi5F9hijx8Pe5fUVvQLplzutpYgZoWEm0lXXWj2Kt156oyi3j30dztV2Pc tJtg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339126; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=CJfhHqq4bYPkDlzc+To1FAdUVzbIpBsNH1YlvpKh7/I=; b=fvq1pFVmORGTNpEVVlqgoTlioAa5Ef0OxDhYhkMTxHkkD847h4/mvZAJv1yny9obVy HAIj2Y043r2904QSHsCg== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn8u4l+/zY=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.8.2 DYNA|AUTH) with ESMTPSA id R04c57z93DIk2OJ (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:46 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:25 +0200 Subject: [PATCH v2 07/14] arm64: dts: qcom: msm8916-wingtech-wt88047: Add sound and modem Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-7-61b684be55c0@gerhold.net> References: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> In-Reply-To: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> To: Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Bryan O'Donoghue , Stephan Gerhold X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Enable sound and modem for the Xiaomi Redmi 2. The setup is similar to most MSM8916 devices, i.e.: - QDSP6 audio - Earpiece/headphones/microphones via digital/analog codec in MSM8916/PM8916 - Audio jack detection via analog codec in PM8916 - WWAN Internet via BAM-DMUX except: - Speaker amplifier is connected to HPH_R (headphones) output of the analog codec. There is a separate analog switch that allows disabling playback via the headphone jack. Reviewed-by: Konrad Dybcio Signed-off-by: Stephan Gerhold --- .../boot/dts/qcom/msm8916-wingtech-wt88047.dts | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts b/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts index 419f35c1fc92..d4b88c787e59 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts @@ -6,6 +6,8 @@ /dts-v1/; #include "msm8916-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + #include #include #include @@ -25,6 +27,28 @@ chosen { stdout-path = "serial0"; }; + speaker_amp: audio-amplifier { + compatible = "simple-audio-amplifier"; + enable-gpios = <&tlmm 117 GPIO_ACTIVE_HIGH>; + sound-name-prefix = "Speaker Amp"; + pinctrl-0 = <&speaker_amp_default>; + pinctrl-names = "default"; + }; + + /* + * This seems to be actually an analog switch that either routes audio + * to the headphone jack or nowhere. Given that we need to enable a GPIO + * to get sound on headphones, modelling it as simple-audio-amplifier + * works just fine. + */ + headphones_switch: audio-switch { + compatible = "simple-audio-amplifier"; + enable-gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>; + sound-name-prefix = "Headphones Switch"; + pinctrl-0 = <&headphones_switch_default>; + pinctrl-names = "default"; + }; + flash-led-controller { compatible = "ocs,ocp8110"; enable-gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>; @@ -146,6 +170,18 @@ &blsp_uart2 { status = "okay"; }; +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5100000>; +}; + +&pm8916_codec { + qcom,micbias1-ext-cap; + qcom,micbias-lvl = <2800>; + qcom,mbhc-vthreshold-low = <75 100 120 180 500>; + qcom,mbhc-vthreshold-high = <75 100 120 180 500>; + qcom,hphl-jack-type-normally-open; +}; + &pm8916_resin { status = "okay"; linux,code = ; @@ -180,6 +216,30 @@ &sdhc_2 { non-removable; }; +&sound { + /* + * Provide widgets/pin-switches to allow enabling speaker and headphones + * separately. Both are routed via the HPH_L/HPH_R pins of the codec. + */ + model = "wt88047"; + widgets = + "Speaker", "Speaker", + "Headphone", "Headphones"; + pin-switches = "Speaker", "Headphones"; + audio-routing = + "Speaker", "Speaker Amp OUTL", + "Speaker", "Speaker Amp OUTR", + "Speaker Amp INL", "HPH_R", + "Speaker Amp INR", "HPH_R", + "Headphones", "Headphones Switch OUTL", + "Headphones", "Headphones Switch OUTR", + "Headphones Switch INL", "HPH_L", + "Headphones Switch INR", "HPH_R", + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2"; + aux-devs = <&speaker_amp>, <&headphones_switch>; +}; + &usb { status = "okay"; extcon = <&usb_id>, <&usb_id>; @@ -226,6 +286,13 @@ gpio_keys_default: gpio-keys-default-state { bias-pull-up; }; + headphones_switch_default: headphones-switch-default-state { + pins = "gpio8"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + imu_default: imu-default-state { pins = "gpio115"; function = "gpio"; @@ -234,6 +301,13 @@ imu_default: imu-default-state { bias-disable; }; + speaker_amp_default: speaker-amp-default-state { + pins = "gpio117"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + touchscreen_default: touchscreen-default-state { touchscreen-pins { pins = "gpio13"; From patchwork Tue Oct 3 13:18:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 728979 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 810E1266DC for ; Tue, 3 Oct 2023 13:18:52 +0000 (UTC) Received: from mo4-p03-ob.smtp.rzone.de (mo4-p03-ob.smtp.rzone.de [85.215.255.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05F99BF; Tue, 3 Oct 2023 06:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339127; cv=none; d=strato.com; s=strato-dkim-0002; b=deyQBF1qDu2pB+WCeifvnr3fxdE7k/s7EX/ejVGlu3s8YyOqVe2bDtzgR1B+q2Iggs BV455oysg3m0vOv5v0Wd4FCyjSeD1MARkGVzro43RbAQr8Zf6UUu3uDVZJRDoL9/nSdx ZmP74Rc6dEtUQP07lo3K1r1eouN4MOVuAd5ZYZ+2R/tWWmwxK4HhlOp656n1YOxv27WE hB91feAgaHuv3QBkdwCJTCWAqAgI9ScO9xvkiD0NZH2tXQefHPgkZH5mVIU/Z+jP3QlC xG36YlvyN4e84mC9HbzBENdsHLuda/SA1wVpHOiQjh9ODDI8p4rdbVRrSMy4chtVOenv MVtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339127; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=V80D4xHlpO7GexIpJNi9sjTtC2eqOZQwsBpEhLVnXdA=; b=ZpBuZ+ckmBj0Mo59Ii7EEfyS356gptNaGBpU13KrlK71EUC1SShpZArWGuYuayxez4 RaIPr4ZPG0LrzOl5sHCzkIiZ+b3x8alzoMi7EZSaScFxxJUrvOQ2G+1DsggI6eQWbPmi +nj8X+UIXPidQJkV50O1czrvLzsUjLv/OJaHZHBmiihWVd/CsbLEQRfiEi8SXK5FktJY on+V5vwkhxvwwHY197iaHFVuSCPdif4C+YjxzP2E9LTIDxFm1pv+gBCWFiVKzEyLtzJR aAgYYavuhtFgLWvzK7Y+EeFkAUEMy+BcokGZtaOEwoLb6Oe4KxQOSizth4xbwGR+T4J6 VBnQ== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339127; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=V80D4xHlpO7GexIpJNi9sjTtC2eqOZQwsBpEhLVnXdA=; b=ATbsn7AUMsIQfZAhkJyhSGFmVgCziAecdOqs8nrCV6Uw2Tsjgp3VXmyXdnJx1GmpAC Y14ghcXrBJR5sbLzTrqn2Rp2fuAv8OUkdiOFmpu1C1ch+nw1ZyfprotHXpUqYrcsteZ6 PFyX3SBN8g6T0OAOOSbKy9zgGJSvMj5Qp5Zm4v+Ae2Y/iBJaZe8zU0uc+FaK8f43/nw5 V530PFiNiJnC4Pi5CrO7idbRnOB70Bc77+dAzvUrtcyyKLhhRASVmYDTMsjzzFTbMcHI TuxA9MKmOo0p99h7ibHv6vEl/vHWmMOssItDutjZEfLYg8F3eOyF3beCeuhFavT07l2F R4KA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339127; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=V80D4xHlpO7GexIpJNi9sjTtC2eqOZQwsBpEhLVnXdA=; b=ZNivYSztKdV3G2A8O0/E4qj7yTR6QnV71U0XKyi2fIeuATyD0wf6VVzaWa+2cYzOfq 0uu76QzpQfs5xQ8VhpCQ== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn8u4l+/zY=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.8.2 DYNA|AUTH) with ESMTPSA id R04c57z93DIl2OK (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:47 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:26 +0200 Subject: [PATCH v2 08/14] arm64: dts: qcom: msm8916-alcatel-idol347: Add sound and modem Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-8-61b684be55c0@gerhold.net> References: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> In-Reply-To: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> To: Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Bryan O'Donoghue , Stephan Gerhold , Vincent Knecht X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net From: Vincent Knecht Enable sound and modem for the Alcatel Idol 3 (4.7"). The setup is similar to most MSM8916 devices, i.e.: - QDSP6 audio - Microphones via digital/analog codec in MSM8916/PM8916 - WWAN Internet via BAM-DMUX except: - Stereo NXP TFA9890 codecs for speakers on Quaternary MI2S - These are also used as earpieces at the top/bottom. - Asahi Kasei AK4375 headphone codec on Secondary MI2S -> Primary MI2S is not used for playback Signed-off-by: Vincent Knecht [Stephan: Minor refactoring, add consistent commit message] Signed-off-by: Stephan Gerhold --- There are some trivial conflicts unless https://lore.kernel.org/linux-arm-msm/20230921-msm8916-rmem-fixups-v1-3-34d2b6e721cf@gerhold.net/ is applied first. But given that there are important fixups for the dynamic reserved memory changes in that series it should preferably get applied before this one anyway. --- .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 171 +++++++++++++++++++++ 1 file changed, 171 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts index fade93c55299..3459145516a1 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts @@ -3,6 +3,8 @@ /dts-v1/; #include "msm8916-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + #include #include #include @@ -22,6 +24,19 @@ chosen { stdout-path = "serial0"; }; + reserved-memory { + /delete-node/ reserved@86680000; + /delete-node/ rmtfs@86700000; + + rmtfs: rmtfs@86680000 { + compatible = "qcom,rmtfs-mem"; + reg = <0x0 0x86680000 0x0 0x160000>; + no-map; + + qcom,client-id = <1>; + }; + }; + gpio-keys { compatible = "gpio-keys"; @@ -50,6 +65,17 @@ led-0 { }; }; + reg_headphones_avdd: regulator-headphones-avdd { + compatible = "regulator-fixed"; + regulator-name = "headphones_avdd"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&tlmm 121 GPIO_ACTIVE_HIGH>; + enable-active-high; + pinctrl-0 = <&headphones_avdd_default>; + pinctrl-names = "default"; + }; + usb_id: usb-id { compatible = "linux,extcon-usb-gpio"; id-gpios = <&tlmm 69 GPIO_ACTIVE_HIGH>; @@ -58,6 +84,43 @@ usb_id: usb-id { }; }; +&blsp_i2c3 { + status = "okay"; + + headphones: audio-codec@10 { + compatible = "asahi-kasei,ak4375"; + reg = <0x10>; + avdd-supply = <®_headphones_avdd>; + tvdd-supply = <&pm8916_l6>; + pdn-gpios = <&tlmm 114 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&headphones_pdn_default>; + pinctrl-names = "default"; + #sound-dai-cells = <0>; + }; + + speaker_codec_top: audio-codec@34 { + compatible = "nxp,tfa9897"; + reg = <0x34>; + vddd-supply = <&pm8916_l6>; + rcv-gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&speaker_top_default>; + pinctrl-names = "default"; + sound-name-prefix = "Speaker Top"; + #sound-dai-cells = <0>; + }; + + speaker_codec_bottom: audio-codec@36 { + compatible = "nxp,tfa9897"; + reg = <0x36>; + vddd-supply = <&pm8916_l6>; + rcv-gpios = <&tlmm 111 GPIO_ACTIVE_HIGH>; + pinctrl-0 = <&speaker_bottom_default>; + pinctrl-names = "default"; + sound-name-prefix = "Speaker Bottom"; + #sound-dai-cells = <0>; + }; +}; + &blsp_i2c4 { status = "okay"; @@ -153,6 +216,18 @@ &blsp_uart2 { status = "okay"; }; +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5000000>; +}; + +&pm8916_codec { + qcom,micbias1-ext-cap; + qcom,micbias-lvl = <2800>; + qcom,mbhc-vthreshold-low = <75 100 120 180 500>; + qcom,mbhc-vthreshold-high = <75 100 120 180 500>; + qcom,hphl-jack-type-normally-open; +}; + &pm8916_resin { status = "okay"; linux,code = ; @@ -169,6 +244,17 @@ &pm8916_vib { status = "okay"; }; +&q6afedai { + dai@18 { + reg = ; + qcom,sd-lines = <0>; + }; + dai@22 { + reg = ; + qcom,sd-lines = <0>; + }; +}; + &sdhc_1 { status = "okay"; }; @@ -183,6 +269,54 @@ &sdhc_2 { cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; }; +&sound { + /* Add pin switches for speakers to allow disabling them individually */ + model = "alcatel-idol3"; + widgets = + "Speaker", "Speaker Top", + "Speaker", "Speaker Bottom"; + pin-switches = "Speaker Top", "Speaker Bottom"; + audio-routing = + "Speaker Top", "Speaker Top OUT", + "Speaker Bottom", "Speaker Bottom OUT", + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS External1"; + + pinctrl-0 = <&cdc_pdm_default &pri_mi2s_default &pri_mi2s_ws_default &sec_mi2s_default>; + pinctrl-1 = <&cdc_pdm_sleep &pri_mi2s_sleep &pri_mi2s_ws_sleep &sec_mi2s_sleep>; + pinctrl-names = "default", "sleep"; + + sound_link_backend2: backend2-dai-link { + link-name = "Quaternary MI2S"; + + cpu { + sound-dai = <&q6afedai QUATERNARY_MI2S_RX>; + }; + platform { + sound-dai = <&q6routing>; + }; + codec { + sound-dai = <&speaker_codec_top>, <&speaker_codec_bottom>; + }; + }; +}; + +&sound_link_backend0 { + /* Primary MI2S is not used, replace with Secondary MI2S for headphones */ + link-name = "Secondary MI2S"; + + cpu { + sound-dai = <&q6afedai SECONDARY_MI2S_RX>; + }; + platform { + sound-dai = <&q6routing>; + }; + codec { + sound-dai = <&headphones>; + }; +}; + &usb { status = "okay"; extcon = <&usb_id>, <&usb_id>; @@ -212,6 +346,15 @@ &wcnss_mem { status = "okay"; }; +/* Only some of the pins are used */ +&pri_mi2s_default { + pins = "gpio113", "gpio115"; +}; + +&pri_mi2s_sleep { + pins = "gpio113", "gpio115"; +}; + &tlmm { accel_int_default: accel-int-default-state { pins = "gpio31"; @@ -245,6 +388,20 @@ gyro_int_default: gyro-int-default-state { bias-disable; }; + headphones_avdd_default: headphones-avdd-default-state { + pins = "gpio121"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + headphones_pdn_default: headphones-pdn-default-state { + pins = "gpio114"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + /* * The OEM wired an additional GPIO to be asserted so that * the si-en,sn3190 LED IC works. Since this GPIO is not @@ -291,6 +448,20 @@ sdc2_cd_default: sdc2-cd-default-state { bias-disable; }; + speaker_bottom_default: speaker-bottom-default-state { + pins = "gpio111"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + + speaker_top_default: speaker-top-default-state { + pins = "gpio50"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + ts_int_reset_default: ts-int-reset-default-state { pins = "gpio13", "gpio100"; function = "gpio"; From patchwork Tue Oct 3 13:18:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 728981 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EFD2926E3B for ; Tue, 3 Oct 2023 13:18:52 +0000 (UTC) Received: from mo4-p03-ob.smtp.rzone.de (mo4-p03-ob.smtp.rzone.de [85.215.255.103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB8A0D7; Tue, 3 Oct 2023 06:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339127; cv=none; d=strato.com; s=strato-dkim-0002; b=m9nBnBQlIjsjlTOXU5RINHos6/J7VNn7Dm4f4VEVZE4JCtbqzxoTgLUi9/7CZNy9P2 pKP7GielkEBg3LdVYn3y6p/0hqwhl2DxanhWWSDqu1b9otfB+gaSSvibzH3Zcd/tXUTe zMmHS8IDvhUZxhD9rxxElhokrV1Euo416zT6xb4I6Q5H9l2fAAVxlhJ64UYeZA8O1a9P J7B3kNoFkfVYlh1pNOHID85uE3zEXWnaVbaaJ9BaIWSkxlznKvco1swEi7wYz2PKKA3e VTFlWp3PKFiqxhGxPy0x08ueYwUstfHI8o+kODdmu30PY5KQZ0gGwCq8lnNO0D91FYQO qOjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339127; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=fl2zPeMOpvqp5YiTJDF1poGBKcAKVmQvhzP6pe1xmJc=; b=nZxeR8dZCAD+H9mHntgb56ZPxulUxcn5CmI0uSwVYL92kXbV4yhUL2o3E3nIAmIR1z cbvKDsfrfIwQsnzAz+/qOtB+fdP45oox0EwZouxPEacOZgnFX3LNl7fyFa5Fci7mRUxN vmQpawYmWrFedLwqhO9bTDZ5ZwHQkaIt9GnLrhYbfMVm/XScJS10qEeXfYqoK3OaiA1W mnliF5osbXAYV4Kjm0VKlIrf5pZKBQGxEKfTI1v1stSSp4HE4yfyD1/EDd/TLMCGjHpd XOrliFSaQsUq825mDgm47uXONX/adYxg5WtTE7VznKY4EdUvqH4pMLxcPk6xK8mWDIjs DOPg== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo03 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339127; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=fl2zPeMOpvqp5YiTJDF1poGBKcAKVmQvhzP6pe1xmJc=; b=CUVMA85IO5/nB8jEayAhcWrW3OLaax6qW/gjNM6Pq/SY8Cg4fO2ZP3jBA/ytuDS949 2XiN23tzagy2gFRc/Y1Yl1Dw2+gdSd0d3YiUmavlmfCbIfn7iMLXJJajMMDd6laoJ1V6 YTRdjesm7ZbXqpgqVLB3KQZjf33jPZgLsfmgcU1KhtN3kT1rVXteKYf+X0orw9z49U0c YTLv7jaEZuOjT1zilKuUiFm79jqyMghd+RitHH+0qcGpukEHRHwpYK1l6EOu0JLeji4D L3aZ82pVyxdgUQlCIu8K7sxMwG9GjsnxWGrV6qVNtb7SiEYVgRLfU8IkIsGul3u4YrDf oxaA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339127; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=fl2zPeMOpvqp5YiTJDF1poGBKcAKVmQvhzP6pe1xmJc=; b=zCq0ZrWN2+ZjnyBSKSOrGk6GNSRYR2VLQIHMgGx6tzFQCW1EVFW49Ang05NK2oed0I rGKunBXb3KK9M/7nOuBg== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn8u4l+/zY=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.8.2 DYNA|AUTH) with ESMTPSA id R04c57z93DIl2OL (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:47 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:27 +0200 Subject: [PATCH v2 09/14] arm64: dts: qcom: msm8916-asus-z00l: Add sound and modem Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-9-61b684be55c0@gerhold.net> References: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> In-Reply-To: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> To: Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Bryan O'Donoghue , Stephan Gerhold , "J.R. Divya Antony" X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net From: "J.R. Divya Antony" Enable sound and modem for the ASUS Zenfone 2 Laser. The setup is similar to most MSM8916 devices, i.e.: - QDSP6 audio - Speakear/earpiece/headphones/microphones via digital/analog codec in MSM8916/PM8916 - Audio jack detection via analog codec in PM8916 - WWAN Internet via BAM-DMUX Signed-off-by: "J.R. Divya Antony" [Stephan: rebase and simplify, add consistent commit message] Reviewed-by: Konrad Dybcio Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts b/arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts index a8be6ff66893..77618c7374df 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts @@ -3,6 +3,8 @@ /dts-v1/; #include "msm8916-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + #include #include #include @@ -130,6 +132,18 @@ &blsp_uart2 { status = "okay"; }; +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5500000>; +}; + +&pm8916_codec { + qcom,micbias-lvl = <2800>; + qcom,mbhc-vthreshold-low = <75 150 237 450 500>; + qcom,mbhc-vthreshold-high = <75 150 237 450 500>; + qcom,micbias1-ext-cap; + qcom,hphl-jack-type-normally-open; +}; + &pm8916_rpm_regulators { pm8916_l17: l17 { regulator-min-microvolt = <2850000>; @@ -151,6 +165,13 @@ &sdhc_2 { cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; }; +&sound { + audio-routing = + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS External1"; +}; + &usb { status = "okay"; extcon = <&usb_id>, <&usb_id>; From patchwork Tue Oct 3 13:18:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 728980 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B48E3273DB for ; Tue, 3 Oct 2023 13:18:53 +0000 (UTC) Received: from mo4-p04-ob.smtp.rzone.de (mo4-p04-ob.smtp.rzone.de [85.215.255.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10121CC; Tue, 3 Oct 2023 06:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339129; cv=none; d=strato.com; s=strato-dkim-0002; b=FS5+Y/AfTep34ifUSpJ8zB8RurYCufhoKSfXI9nuaVGcWkCAoRvwqcseP1EjXyG2tK rjNBiD7lR36KdxMv+ha5x7UUq4DJk5Y3ZnwlvS7yM48bUTQPQL5ESSDUJ2Pk0iz4Pk44 s5v2yxqBk4FSKkvacGihl99w79odK/Dpe3JHJaoE2rVHo1EjiCTkJJ51W+1NDNAOE4dq AyPrhMxIuOAMpjo4FsRi/m06pD6TulDoLn8lMUiXLLAND9pfzygutWeFLvhNwaq0uplx TD1m1eEZ9UN+NVxbl4jsKBku0ieqz5d6l+OFiElLdzBg997y/7uh5AN6Rcc9P0EPDCxX GXsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339129; s=strato-dkim-0002; d=strato.com; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=R4s/lgVmJSqQs8BGSp4xT87hMmc1uv7f8BEO2YPhFgk=; b=fG8hXeQqxJl4GWJkbShX8jdJBVS3yorIpcYbc3UAdqLo9r4bf44T+9TmYwIyjHcoDX ENG6KmBzQ3essMhE7DN7aUh9ohP3m5OhpwFZkYMRcqNvjtPLVXopjmk0aHwetZ6t+uZM rHwfaRsEDw6xCsyrxZiox1R9rBB4AUrSr2mCQOAPYrx8bdFwJLHlCOXiKSldQmzCN9UW UXRmL+W2feXnmOo+TlTbVZwtOTQJM+1b9uGHKhHGeM365IoSQj6Pk01cntlX8Jvow57/ TyPVDRaK3Ek5JxmoUrqgnj1lBZ7v1yZvETv55UXwmVKk8E/ddSuSZuLy9lO07H/iBojc 5YSw== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339129; s=strato-dkim-0002; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=R4s/lgVmJSqQs8BGSp4xT87hMmc1uv7f8BEO2YPhFgk=; b=Q7BSuBMaPb/fvXbYBDYbusu8qG2+0jkLuQpvn+n/RaydPANXT85WzF+PRW7/rF5J4H Lq7g4aNbb6WxsYyMCGt5isFJAPWKjjkMLlOcMhQW2cGm9SiEhb+tv0hibXHOtLXZ5c5a CeUZKW0oZTZ5pHZJTqggpmwHReVol2t2tQS8bHQ5C+8plAHUepSCxqLk4OViTZrcsk9N UKBt1txkL8Jmjkyz4ZApzixecOimCWjLkQgBQ9LgVp53/lqQO3iYHqnN+VMJh0/6uSlP JlDir1GjIQYB4xK/YC3LKN/KXORQcrGtmy2/cxzsOpippMfxWIis5CMFx9TTaKnmNXJX Sswg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339129; s=strato-dkim-0003; d=gerhold.net; h=Cc:To:In-Reply-To:References:Message-Id:Subject:Date:From:Cc:Date: From:Subject:Sender; bh=R4s/lgVmJSqQs8BGSp4xT87hMmc1uv7f8BEO2YPhFgk=; b=NRufaT6G56Rng47fiYU4lUKx58p6XehzYKsQu2NDPe01dHKJxxmYVJ+tCsufx/EYdo bZ0JAtNYFiiIp4z3oDDQ== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQjVd4CteZ/7jYgS+mLFY+H0JAn8u4l+/zY=" Received: from [192.168.244.3] by smtp.strato.de (RZmta 49.8.2 DYNA|AUTH) with ESMTPSA id R04c57z93DIn2OP (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:49 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:31 +0200 Subject: [PATCH v2 13/14] arm64: dts: qcom: msm8916-samsung-j5: Add sound and modem Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-13-61b684be55c0@gerhold.net> References: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> In-Reply-To: <20231003-msm8916-modem-v2-0-61b684be55c0@gerhold.net> To: Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Bryan O'Donoghue , Stephan Gerhold , "Lin, Meng-Bo" , Markuss Broks X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net From: "Lin, Meng-Bo" Enable sound and modem for the Samsung J5 smartphones. The setup is similar to most MSM8916 devices, i.e.: - QDSP6 audio - Speaker/earpiece/headphones/microphones via digital/analog codec in MSM8916/PM8916 - WWAN Internet via BAM-DMUX except: - There is no secondary microphone, so a different "model" is used to differentiate that in the UCM configuration. - Samsung-specific audio jack detection (not supported yet) Co-developed-by: Markuss Broks Signed-off-by: Markuss Broks Signed-off-by: "Lin, Meng-Bo" [Stephan: Add consistent commit message] Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi | 14 ++++++++++++++ arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi index fe59be3505fe..5ca2ada266f4 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-only #include "msm8916-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + #include #include #include @@ -135,6 +137,10 @@ &blsp_uart2 { status = "okay"; }; +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5800000>; +}; + &pm8916_resin { status = "okay"; linux,code = ; @@ -154,6 +160,14 @@ &sdhc_2 { cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; }; +&sound { + model = "msm8916-1mic"; + audio-routing = + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS External1"; +}; + &usb { extcon = <&muic>, <&muic>; status = "okay"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts index 58c2f5a70e78..ba8650971d6a 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts @@ -19,6 +19,10 @@ &blsp_i2c5 { status = "disabled"; }; +&pm8916_codec { + qcom,micbias1-ext-cap; +}; + &touchscreen { /* FIXME: Missing sm5703-mfd driver to power up vdd-supply */ };