From patchwork Tue Oct 3 13:18:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 13407637 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2C55E7545A for ; Tue, 3 Oct 2023 13:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234458AbjJCNSv (ORCPT ); Tue, 3 Oct 2023 09:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232517AbjJCNSu (ORCPT ); Tue, 3 Oct 2023 09:18:50 -0400 Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [81.169.146.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734DCA3; Tue, 3 Oct 2023 06:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339124; cv=none; d=strato.com; s=strato-dkim-0002; b=fdIfBg7djrGLNldQCyqyw/z3+FAfxmNj876eOnFAGf17lNgABA+FpB83mO2xPS89H+ 9TM+syGHdI9GD0gsNMKT+SxoBneJbG9hTUU1tPqvdjZjeMNJGWi0FUhcCR2vn7eQzamH +xzAJgc0hZOOMFQsUwu0InAk5EN5TH//2q8K02vW3DcT4qMw4Kwul6PjEYDzJbaUZLF5 OHWjJBPa+RX+aVvkSQwKYLMJUQp/CS1FYoFuWyrJTRgiq/pM55pRhIbi0GPJCYFTW6By ds34oLa+xta8502APYokUXmnr+kosBE2D8c8Dh+7jIyw1uvd71h2dnxqYKDklrFl4PYh 5BRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339124; 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=Tcfqcvw/OBMlFrrMXxA2/+w2/9iajTV/ZetLrmXPr8s=; b=DCi4E7ZWUVqdjsLkIe5tRTtu8IEnkexI9n7TMfnMzGxnQ0usU7WDsjzH6vcLBTPRKo KsWbYGRyWUZ+VByq6nWRszr88+GfSwgnyWZ6MFuZrdXucFvrpBUv7SJ/0tbG2K+sXD+E fRJHd8XgCXw2Ou0xnZcQC+Y963uSaZ9y30ZqD8PZPEpDnaEEQPioo4V84iywlUxvee9X yNf5L4mvNnHjzSY9EbMv6akYkbznclADEmDPe/faIP6W7k2sBfes0PND1FXlouMpds9+ +TZVkrdCW7jYIJVc8yMndDlrQfcKQghgWuD/BlYleqG9ZY71+4T4sbcRpqrXJ+u1LAo9 J6Wg== 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=1696339124; 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=Tcfqcvw/OBMlFrrMXxA2/+w2/9iajTV/ZetLrmXPr8s=; b=TTN/0qTzq5ooaTjlgDYyskDve3QCpL8IBd8D++SIj8QzKl1iHDvgI7lq1DMLSiU5v/ EJ/gOjmfrbWwAQktLxs1hXAV3DwS36kkBrCsP56Jgr9Mi3/uAR41iBAJ/1rQpb33xhZH G/qvYUf+MtG8WPPQQu1Sp2hM5A6ficSxmqVJCGIhzXYOEqG/7sEC6vV5hVOB8XLFJrKi XMRAJxBUcYZf3Es02q18nLJrnyxIUA6I6qKQAkqb39yXG+OJ80euxKHiedu0Mf2RdhWg jeseAv4A4amNokVVbzDkrn4h/HYKtvLNuQld1xCJ4qxONq7F64FPwUU8RCe46mA6vB0z QoAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339124; 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=Tcfqcvw/OBMlFrrMXxA2/+w2/9iajTV/ZetLrmXPr8s=; b=Ca2ZaqRXe+vS2Mmip733TQ0F1mXpBOswp8jwB1xvQghGKwyvEi9/tIeThlwGsKLSUG LgsQYh8R1qzO4H+0Z3Cw== 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 R04c57z93DIi2OD (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:44 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:19 +0200 Subject: [PATCH v2 01/14] arm64: dts: qcom: msm8939: Add BAM-DMUX WWAN MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-1-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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Vincent Knecht BAM DMUX is used as the network interface to the modem. This is copied as-is from msm8916.dtsi. Signed-off-by: Vincent Knecht Reviewed-by: Konrad Dybcio Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8939.dtsi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi b/arch/arm64/boot/dts/qcom/msm8939.dtsi index 324b5d26db40..65c68e0e88d5 100644 --- a/arch/arm64/boot/dts/qcom/msm8939.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi @@ -1537,6 +1537,20 @@ spmi_bus: spmi@200f000 { #interrupt-cells = <4>; }; + bam_dmux_dma: dma-controller@4044000 { + compatible = "qcom,bam-v1.7.0"; + reg = <0x04044000 0x19000>; + interrupts = ; + #dma-cells = <1>; + qcom,ee = <0>; + + num-channels = <6>; + qcom,num-ees = <1>; + qcom,powered-remotely; + + status = "disabled"; + }; + mpss: remoteproc@4080000 { compatible = "qcom,msm8916-mss-pil"; reg = <0x04080000 0x100>, <0x04020000 0x040>; @@ -1569,6 +1583,22 @@ mpss: remoteproc@4080000 { qcom,halt-regs = <&tcsr 0x18000 0x19000 0x1a000>; status = "disabled"; + bam_dmux: bam-dmux { + compatible = "qcom,bam-dmux"; + + interrupt-parent = <&hexagon_smsm>; + interrupts = <1 IRQ_TYPE_EDGE_BOTH>, <11 IRQ_TYPE_EDGE_BOTH>; + interrupt-names = "pc", "pc-ack"; + + qcom,smem-states = <&apps_smsm 1>, <&apps_smsm 11>; + qcom,smem-state-names = "pc", "pc-ack"; + + dmas = <&bam_dmux_dma 4>, <&bam_dmux_dma 5>; + dma-names = "tx", "rx"; + + status = "disabled"; + }; + mba { memory-region = <&mba_mem>; }; From patchwork Tue Oct 3 13:18:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 13407638 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92D36E7545B for ; Tue, 3 Oct 2023 13:18:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234830AbjJCNSv (ORCPT ); Tue, 3 Oct 2023 09:18:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232671AbjJCNSu (ORCPT ); Tue, 3 Oct 2023 09:18:50 -0400 Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [85.215.255.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8610A6; 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=GRkXnFQBMI3C6pufZHuf7L7dYme3EGvJTbnmew385D1YsNuDZxQqWhXUvVNiYHg/Da Aw+uCumPsL7ZUcVM4qKjReVFI1f65S959ZGtWdw7Uq5P00L373m5pC64AtBOGOlGdQeY GR4bhSVjWSUmU7Mpnr5+wtDxZbHReTd5oVk4UJOcpkvv70estx4eF6nedGEWvb3/hDhF ZNPp7A1NmD60plsa5rRa4Gx/MS4I/AMuub1VmMx+mO3rnV4zEG6xPyBPEN8mQTihKmx7 wA3gYtxWTSkM8OTy/svfyXCnZgb+5FxHB40OsAHSjXSE5ZzQouo07AtNU/92HuhvQpGU qEDw== 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=5tOaNBnZIp76aCZehJuiHTr9zQUl8dzXjSzMfoXuOec=; b=IeB0CnFklh5LGJ1OMiA2mK7JZM/NWAK+ziEigROZq9BDvl7ikr8eaJNC+GNiZP+H4y C+4F4HfNApMO+iqOEAiiyrJPBLBe3X4E/Yv2NJQSMWNKE8+T+aBG+dC4bggsG3YgdT0/ l1aTYW2asWeGY8HbTpKkkkJj02GN86QFx9N60q0xtxQGUddwezs9QDXL0tb9F3Uu931S dhlXVL9qNmWOAX9khV47+yS9RZcKQ8xO9X09TBrOYqbJRDJptaQpNdH9HQhSQilIDIL8 dnipR93IYDXqTCc2LnNeify7Uto2g6ZU7dHT/NjLWxjlZJS/bwTbByTx+L9HiRSraEL5 GvCQ== 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=5tOaNBnZIp76aCZehJuiHTr9zQUl8dzXjSzMfoXuOec=; b=ji+N9xk0EAk9NVXHJKl69Sz1HfUW5Vand9bimnxpgV83/ojJHbxsTjhaNb2bkNQlgb 5JwlfQMfBzDJM8I9XDe/4itpSe+ENp8nSz6XIZhMuuJeCXK6ssBf47U6kiqkT2cg2xXS zhbYHv3EEkJ943p48vdoERn4j6pF01trv1PBXco6Tf1drPCqdK42oVUZS1l7M17icvjX shu1MKAsjMc0sPHUiYqvzsicNjZKPiigE2o6oiNPvPHc5WxDFXDnvnAFjj966td0AFMP bmfGRrAPUO3lC8+MIa+DB6UlgnTdq8SNGfkH2nsLxRJjkJCH29aPfpd9JYJ79fTWScwz 5UJA== 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=5tOaNBnZIp76aCZehJuiHTr9zQUl8dzXjSzMfoXuOec=; b=EsyIxqIcj/QY/mf4vEHjknXo26GA7GjV5YePYzLtELiZt8xt/bg2YbnNHiyVPVHk23 T/5CsOg2MS1rdEdXRBDQ== 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 R04c57z93DIi2OE (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:44 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:20 +0200 Subject: [PATCH v2 02/14] arm64: dts: qcom: msm8916: Add QDSP6 MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-2-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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org MSM8916 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 msm8916.dtsi. The apr node is disabled by default to avoid changing behavior for devices like DB410c that use the bypassed audio path. Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916.dtsi | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index 4f799b536a92..e8a14dd7e7c2 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -10,6 +10,7 @@ #include #include #include +#include #include / { @@ -1989,6 +1990,54 @@ smd-edge { 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>; + }; + }; + }; + fastrpc { compatible = "qcom,fastrpc"; qcom,smd-channels = "fastrpcsmd-apps-dsp"; 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: 13407639 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31820E748FA for ; Tue, 3 Oct 2023 13:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234847AbjJCNSw (ORCPT ); Tue, 3 Oct 2023 09:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234445AbjJCNSv (ORCPT ); Tue, 3 Oct 2023 09:18:51 -0400 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 13407640 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78EA1E776D6 for ; Tue, 3 Oct 2023 13:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235077AbjJCNSw (ORCPT ); Tue, 3 Oct 2023 09:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234590AbjJCNSv (ORCPT ); Tue, 3 Oct 2023 09:18:51 -0400 Received: from mo4-p02-ob.smtp.rzone.de (mo4-p02-ob.smtp.rzone.de [81.169.146.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 812BEAB; Tue, 3 Oct 2023 06:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339125; cv=none; d=strato.com; s=strato-dkim-0002; b=RJJJ6c3m9rHxAG2DyN+OMi8V6qhNOzpQXPVMHa3Wz/Qh4EJc/TfNoa0cAQ8BMyqgB+ Pp3xtnkWqo4qKQwDGVjuBTVOBqyxHMNYM+zHjs3q7SztLM4Acr7DUh6hL+QseaCxIu3c AJjXEPiT4jf2qHWaVwJ00UulOFO3o1D3hEG9VYADtzIl1pUf/MFhmKNGhg95higmypk5 vL6Ajm62sr0GdRo62aSnUIiix6dUcG4FcIptLnyUKlQqDu6scxg4dZKyZXvCby0DqZ+B yUdP1MMoB9aF6ETordixoX1BFFzS09pOUMZA2DWmh/QILXEf/kUrVfgbkERJYlAVFA0e rhNg== 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=axN5JTKzeHnuAwCYNQDx+NKlDEDPR1XqPTp8Vpb9ugo=; b=SNOATYAqOZBizfJlp66r2gcRodkOMZ4rwWy2pzc90+f234WwLoaVChimYCrWcqXJEI KRk0fjz+HxjJV3uCTMJoDczjZnioO2JGtQO6oRGNYS4672j55P4fkOVOuHXW6N12uym5 /RazlJu6qStkWwNYZwQ7Gr4THT1yEZkvK9Vm3eKLBr2AavAuCByNgoMzCnns/tsbnCtr VJLLENYOBPF6ahFTemxQatJ5JZyK5wULYXYEv6VHtax41mmg8gm5uNOVLRcV8vKyTSKa 1IsGi/UbOFoWAYWe7qpTMjzGERqmCQQP5FS90fRUj4CFBGvdmCiQrCqDspUUo+0WCOF6 1yaw== 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=axN5JTKzeHnuAwCYNQDx+NKlDEDPR1XqPTp8Vpb9ugo=; b=PJqm4E5guv2vaMi+fMjYoEJlLMRF1ciNE2n34JOqcv2sx4dhr32JyvxYBkNsYoA7o5 /X8yhdDFPAfru2ag1saVVoHe3OPfOJ47Hdf0Maxrg0WN/XNVvpzAtp1TZXvnu4i0UH3d 43F3Hjv8KRj+K7Nbin34G1Ajh4D4TCe1/5wUgKTDJmXOBOOASee5YPQPHmAVUMycoemp S87csp5qPfCeyClbC7tWNblU0o6ot09l/960LmUo1LlinxFMF5CgqgrSrsUqc4heDIH2 PlLJeH46Y3Dp6HzqoT1zBHgUHqyU6TMzLjhp9+mcW3i34EYdjoBzNYXmd/LeURj7gk1R nMGQ== 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=axN5JTKzeHnuAwCYNQDx+NKlDEDPR1XqPTp8Vpb9ugo=; b=Lru4Q6MDj5yRw8HsZG/E+xkykGPBaoNXE24VxA2E0+OfkP9OL5KE96r+RtXeQ6mSmH vEx7PZlAqI2buIg8d6AQ== 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 R04c57z93DIj2OG (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:22 +0200 Subject: [PATCH v2 04/14] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-4-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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Most MSM8916/MSM8939 devices use very similar setups for the modem, because most of the device-specific details are abstracted by the modem firmware. There are several definitions (status switches, DAI links etc) that will be exactly the same for every board. Introduce a common msm8916-modem-qdsp6.dtsi include that can be used to simplify enabling the modem for such devices. By default the digital/analog codec in the SoC/PMIC is used, but boards can define additional codecs by adding additional backend DAI links. Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi | 148 ++++++++++++++++++++++ 1 file changed, 148 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi new file mode 100644 index 000000000000..039961622633 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi @@ -0,0 +1,148 @@ +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) +/* + * msm8916-modem-qdsp6.dtsi describes the typical modem setup on MSM8916 devices + * (or similar SoCs) with audio routed via the QDSP6 services provided by the + * modem firmware. The digital/analog codec in the SoC/PMIC is used by default, + * but boards can define additional codecs by adding additional backend DAI links. + */ + +#include +#include + +&apr { + status = "okay"; +}; + +&bam_dmux { + status = "okay"; +}; + +&bam_dmux_dma { + status = "okay"; +}; + +&lpass { + status = "reserved"; /* Controlled by QDSP6 */ +}; + +&lpass_codec { + status = "okay"; +}; + +&mba_mem { + status = "okay"; +}; + +&mpss { + status = "okay"; +}; + +&mpss_mem { + status = "okay"; +}; + +&pm8916_codec { + status = "okay"; +}; + +&q6afedai { + dai@16 { + reg = ; + qcom,sd-lines = <0 1>; + }; + dai@20 { + reg = ; + qcom,sd-lines = <0 1>; + }; +}; + +&q6asmdai { + dai@0 { + reg = <0>; + direction = ; + }; + dai@1 { + reg = <1>; + direction = ; + }; + dai@2 { + reg = <2>; + direction = ; + }; + dai@3 { + reg = <3>; + direction = ; + is-compress-dai; + }; +}; + +&sound { + compatible = "qcom,msm8916-qdsp6-sndcard"; + model = "msm8916"; + + pinctrl-0 = <&cdc_pdm_default>; + pinctrl-1 = <&cdc_pdm_sleep>; + pinctrl-names = "default", "sleep"; + + status = "okay"; + + frontend0-dai-link { + link-name = "MultiMedia1"; + + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>; + }; + }; + + frontend1-dai-link { + link-name = "MultiMedia2"; + + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>; + }; + }; + + frontend2-dai-link { + link-name = "MultiMedia3"; + + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>; + }; + }; + + frontend3-dai-link { + link-name = "MultiMedia4"; + + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA4>; + }; + }; + + sound_link_backend0: backend0-dai-link { + link-name = "Primary MI2S"; + + cpu { + sound-dai = <&q6afedai PRIMARY_MI2S_RX>; + }; + platform { + sound-dai = <&q6routing>; + }; + codec { + sound-dai = <&lpass_codec 0>, <&pm8916_codec 0>; + }; + }; + + sound_link_backend1: backend1-dai-link { + link-name = "Tertiary MI2S"; + + cpu { + sound-dai = <&q6afedai TERTIARY_MI2S_TX>; + }; + platform { + sound-dai = <&q6routing>; + }; + codec { + sound-dai = <&lpass_codec 1>, <&pm8916_codec 1>; + }; + }; +}; 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: 13407641 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97DDDE74903 for ; Tue, 3 Oct 2023 13:18:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235261AbjJCNSx (ORCPT ); Tue, 3 Oct 2023 09:18:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232608AbjJCNSv (ORCPT ); Tue, 3 Oct 2023 09:18:51 -0400 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 13407642 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F556E82CAC for ; Tue, 3 Oct 2023 13:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232517AbjJCNSx (ORCPT ); Tue, 3 Oct 2023 09:18:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234880AbjJCNSw (ORCPT ); Tue, 3 Oct 2023 09:18:52 -0400 Received: from mo4-p03-ob.smtp.rzone.de (mo4-p03-ob.smtp.rzone.de [85.215.255.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EAAFB7; 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=fT1o1bfvAJmEucKypk4JvnYvVPf+gyyz7e86whnVfZ20S7qNU5yGUIvrwnz84Uphc7 jeCjbtpjr/ZgpKBKttj2klCINZ3gldsp82VIYQLwGj2xaI+gliiC0C63SgshSwqO4DJV Evqq2sGmK8rAx4zAPMWPO1xR6WSZjLdXUxrg7+me6fomISSGVvpMakOppNfyS1oQMLlI NTfqou2YB7n3M/sPVW/oLYZMBDWDveVGFPVejoystOSgTzrnvkSqrBqicaq09ONbmN7N dna4f7Gh8Hxtk5YbgRLMP6E84CxZuvsNtTgGtWU32w/0gWS3RW5nuazQqZLRlG76CDhF 8cMQ== 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=wkEd/6Cy6zxlz0xNYtgtZA9rujzyPOBqe0YaT0QbcHk=; b=i0U6MZKYoPjCIbPzdQbe4u2/uGaRqki9rdE6+qIte0Gb/qGCsfxp2yg85iQ1vlw4Gz B7DcXych98b7h2ExMMBRX7npTf2/bybFYpksgz5ESD3cmvhpls7OG2olJTx4rhB/jtNJ mjkjmL24khi/bvFzDpRzbb3fi3U9AEIpse0wg3Qi2neWiFaulzznE+SSuO3jmsjSOEzz 2+IucfzhCSXtvh6D/Li9EyltV093uY9XXGzCklAEHnIxyirISkymShja40s7ciFIVcxA h5eWo74rSvlZnQS2GAOFksUsZWCKptEjCHPlZ6GTbWYPNMrGp6Ysw5H/5aBnrDcrP/JG NdlQ== 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=wkEd/6Cy6zxlz0xNYtgtZA9rujzyPOBqe0YaT0QbcHk=; b=q7IP0NABHFpBrIhoZsdS+Sf6TwV2hADuAkBQ1mwqO/TuJCTtIU7+NiNBSbKoSqux8w ukFRK+fA3cdmkNmC1h1oZs/DqGR3IxwhoKtkQcN0J+hKX3O9Jo/U7RjkyucaoCx8B3A9 cJDD3ftnNeqDQLmd44qYR508e4mOmnMrnrAxcQQpE1h2u6JEq8meL28X+p1ONsTo7abv NjBAHIxJu7RE7BEd2/zbLRXYaUYbZEWBU1cgAGk1Fd0zSUoAkoS249x8e4G70QDQgcJh l9DbfJv2FGJZaTaA5+KL5aNBSKakTwiOLEhG8fA/QfdnSayrHBZlY2dRlbaufJBt9FGS rdCA== 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=wkEd/6Cy6zxlz0xNYtgtZA9rujzyPOBqe0YaT0QbcHk=; b=UR9uo9p9yO0V8BYeBwl1Vyoal4Zp8OgENSuFA1GbvpTNCxGHRSQJw7j23sS5LNtmkC 13r9oY40LQ7Fi4VTBKCA== 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 R04c57z93DIk2OI (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:24 +0200 Subject: [PATCH v2 06/14] arm64: dts: qcom: msm8916-samsung-serranove: Add sound and modem MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-6-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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Enable sound and modem for the Samsung S4 Mini Value Edition. 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: - Samsung-specific audio jack detection (not supported yet) Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts index 68da2a2d3077..5ce8f1350abc 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts @@ -6,6 +6,8 @@ /dts-v1/; #include "msm8916-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + #include #include #include @@ -319,6 +321,10 @@ &blsp_uart2 { status = "okay"; }; +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5a00000>; +}; + &pm8916_resin { status = "okay"; linux,code = ; @@ -350,6 +356,13 @@ &sdhc_2 { no-1-8-v; }; +&sound { + audio-routing = + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS External1"; +}; + &usb { status = "okay"; extcon = <&muic>, <&muic>; 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: 13407643 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D05A3E82CDE for ; Tue, 3 Oct 2023 13:18:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235456AbjJCNSy (ORCPT ); Tue, 3 Oct 2023 09:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234909AbjJCNSw (ORCPT ); Tue, 3 Oct 2023 09:18:52 -0400 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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: 13407645 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 911C1E7AD41 for ; Tue, 3 Oct 2023 13:19:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236257AbjJCNTD (ORCPT ); Tue, 3 Oct 2023 09:19:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235170AbjJCNSx (ORCPT ); Tue, 3 Oct 2023 09:18:53 -0400 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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: 13407648 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC89CE7AD49 for ; Tue, 3 Oct 2023 13:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235811AbjJCNTF (ORCPT ); Tue, 3 Oct 2023 09:19:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235380AbjJCNSy (ORCPT ); Tue, 3 Oct 2023 09:18:54 -0400 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 13407644 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65406E7AD42 for ; Tue, 3 Oct 2023 13:19:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235666AbjJCNS7 (ORCPT ); Tue, 3 Oct 2023 09:18:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235144AbjJCNSx (ORCPT ); Tue, 3 Oct 2023 09:18:53 -0400 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 97968C9; Tue, 3 Oct 2023 06:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339128; cv=none; d=strato.com; s=strato-dkim-0002; b=TD1KFakuRZxiSGXYRwMy++LKN5m/TwQVAup1OshHdXHDHjZlulOS5gp6mjEYMcRYIo nNWCXtOmU8pcGLFarvpIWth361Wx27APwN7cmCty2bVyvihAUgR5W8/P68yHwMfTpvr4 F/U/8m4Fjeroj2R6nbwpv02x3JygRbxDoRi0gWvfWuaEwgQjjGDoT9Q1Zck+/ydTMmdP 2AMfUcm5bxRVSS2TvqSRRq/Sa8nPkEUStf/V4nracW81aCFK80pabPQB2tZaxJz0eBZb UDEKt8W4iqT8JROJEtrVBCSYD5AjbisONNsoBablUI9XRVKyHQc62axx8cLlI3V8x62D 05og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339128; 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=5bjXhesMmGj3qm6NxqLDNr7lzDiYOW8cVTbalWvbuQc=; b=a240hws91gaaA/tI9/tPi0xK9GYMCzuSrHS1EKOe3khoCifItn3V34cehYNmtd6/ZV gH1Q5QMJoXcAL/Mc3rFTLlQbGtJusry40dwtOVHPgkyh/9fxj/ILYvdtwzE4SRbwC1Vw XHJJq8dUxUbZq9OqBSPpbTEBdBI37fS3K/8fSA+Me2SXwIrRJFX3p/weqUr0WFpXdJ5N iKKuaIbJs7X+CfaJf8/L5Az5JzHTK0PTgHsUnLjkm2yluYdxQ8lCSvoE3XiSfzHdglMS 51GPDPo38WqWsBAlgoUXoqV0haDEYup/u3szRFo+O2ZebsRULZ0oyvwUN0BsvyVfHRvs sNvA== 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=1696339128; 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=5bjXhesMmGj3qm6NxqLDNr7lzDiYOW8cVTbalWvbuQc=; b=SatUV8jMwzJWRYy+QYQz5EDs3Od8DmThzcd2f2wNyf9lLJkIyHni/IdnztjCSo8PRW P0F4WSty6g4MFDM6IC2Dfz1/FIIYxA+FOFHB/ALJ5q31m0eURlRsbNAr6IngvlJUsDVx 1KD05E/DWA9GGxHCQr1kpXFWH7hwJBU7UpiBfGRld8LA3RhG2RSB0N2DXCUBCUQ9lSkD YGcLGSw65CSqRTDBXPMTv2ZGy8Nq5s1kvVB2yn++bJh3RKcW6VREl66OejMB4wDaukIu MWnwkfgkbD0AXU+daW0xheaYLUOdB9lVLsHIlg2wXgAiFBkskJhQ8R5glUD5LjtKieXH 3wLw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339128; 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=5bjXhesMmGj3qm6NxqLDNr7lzDiYOW8cVTbalWvbuQc=; b=jNGWsy1w0WWdM5V5n0Xblcc4uRuG988okfqOTbx1E7gMttEmqudKafIP7LMbZ7Cqu4 ga5oJo2NSGvt7yV7gHCw== 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 R04c57z93DIl2OM (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:28 +0200 Subject: [PATCH v2 10/14] arm64: dts: qcom: msm8916-longcheer-l8150: Add sound and modem MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-10-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 , Nikita Travkin X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Nikita Travkin Enable sound and modem for the Longcheer L8150 (e.g. Wileyfox Swift). The setup is similar to most MSM8916 devices, i.e.: - QDSP6 audio - Speaker/earpiece/headphones/microphones via digital/analog codec in MSM8916/PM8916 - Audio jack detection via analog codec in PM8916 - WWAN Internet via BAM-DMUX except: - The mpss firmware region must be relocated to a different address. This is because the wcnss firmware is not relocatable for some reason. The mpss firmware is too large to avoid overlap with wcnss when placed at the default address (0x86800000). Surprisingly the vendor kernel does not handle this. The firmware regions end up overlapping there and somehow this does not explode. We try to handle this more safely by relocating the mpss region to the first higher address that is working correctly: 0x8e800000. Signed-off-by: Nikita Travkin Co-developed-by: Stephan Gerhold Signed-off-by: Stephan Gerhold --- .../boot/dts/qcom/msm8916-longcheer-l8150.dts | 31 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts index 47d1c5cb13f4..37fa55166918 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts @@ -3,6 +3,8 @@ /dts-v1/; #include "msm8916-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + #include #include #include @@ -25,17 +27,26 @@ chosen { /* * For some reason, the signed wcnss firmware is not relocatable. - * It must be loaded at 0x8b600000. All other firmware is relocatable, - * so place wcnss at the fixed address and then all other firmware - * regions will be automatically allocated at a fitting place. + * It must be loaded at 0x8b600000. Unfortunately, this also means that + * mpss_mem does not fit when loaded to the typical address at 0x86800000. + * + * Load wcnss_mem to the fixed address and relocate mpss_mem to the next + * working higher address. For some reason the modem firmware does not + * boot when placed at 0x8a800000 to 0x8e800000. */ reserved-memory { + /delete-node/ mpss@86800000; /delete-node/ wcnss; wcnss_mem: wcnss@8b600000 { reg = <0x0 0x8b600000 0x0 0x600000>; no-map; }; + + mpss_mem: mpss@8e800000 { + reg = <0x0 0x8e800000 0x0 0x5000000>; + no-map; + }; }; gpio-keys { @@ -225,6 +236,13 @@ &blsp_uart2 { status = "okay"; }; +&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,hphl-jack-type-normally-open; +}; + &pm8916_resin { status = "okay"; linux,code = ; @@ -254,6 +272,13 @@ &sdhc_2 { non-removable; }; +&sound { + audio-routing = + "AMIC1", "MIC BIAS Internal1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS Internal3"; +}; + &usb { status = "okay"; dr_mode = "peripheral"; From patchwork Tue Oct 3 13:18:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 13407646 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78F96E7AD42 for ; Tue, 3 Oct 2023 13:19:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236453AbjJCNTD (ORCPT ); Tue, 3 Oct 2023 09:19:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235376AbjJCNSy (ORCPT ); Tue, 3 Oct 2023 09:18:54 -0400 Received: from mo4-p03-ob.smtp.rzone.de (mo4-p03-ob.smtp.rzone.de [85.215.255.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 844F6A3; Tue, 3 Oct 2023 06:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339128; cv=none; d=strato.com; s=strato-dkim-0002; b=sz9sAkCK8nYQM08RmK+Niu0nJ96gXHB4dcHE7dOH1tgAQQmQahK0C4qw450TSd+YXn OVAtib9CITCBZXjUkjWKbfhKogzDbWkhH0f7oIkm8GQWXayGE18e8p2GdAmgx5NSOUR9 cNf4JjvsdPtHEpmMYbHsVnZm1nQjbIm51PVJ7tE/EXomPNkNyN9s0EM+Sq5NuLJAfgQ6 aOAMFZu0YimOtaaef57T+lCpGBgA8QJ8fFQWvHEE/ADlvl4SiMx0lVbxDkgfLAmGRBvl gXBaqcq9kJL9oqscBGSZ+mFv9lQPDmKsDl+AEfmfp7bxL+NVdDrsekU5TdvfFNj2zO3A 7tvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339128; 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=Ii17T7VAoR8+UlL8LnMJpVNUDvOUl5el80hXLnYIkJo=; b=n33Db94ywl7q0QOxk9RuBpvzP0ErDHw+X1mkcGQDZ8g4z+iBftMiQQtVeRkjgvZUZd cyAB95mDA0qjk6uvMm9XGlSlh8zraT1FZRTzhsGfwoqA6fYhZJ3b9rG/IWWJ9Pv6YyFj xgqBtuFSD90jJOlsYpgtkIdd/Lxh98P64zXbIMQjkKUxce6DPPlwtCiKqUKERNV4b6m5 n59W8kLUWLIMoPy+rF1aR606J4Skp1z1VM+XXY7vvJKxsFV4i2XbkmO9MgADi5ru8JpT Ng90G+8WO1V2Vk8uRvqyeDr6+vAyRZqD8M9ZBXMqmfMV2LsukuzCfZmdZE8eE/5KwfZN Sjuw== 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=1696339128; 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=Ii17T7VAoR8+UlL8LnMJpVNUDvOUl5el80hXLnYIkJo=; b=jT9t3bAZE2QwYwGkFuOj+LzsQKPjVaK6gKO1iar8yikAlW7zHRC7Ad6/rdqODbwVeN io4NcpB04oYMW/Mcm0ZKyRNfZKH1MgpzhPuHApVVR9XojThYVSyfSVz0uaT5+3F6Qdyh L8L8vfeNxsFtBsL5/ks0Sma7rJvHITCoXSZylW1qu5AOLqyoP+cvuhvjoDRu1Itz2Jh7 wVJdc4WrqVsFdLEUp1XjbW6uCcDVeO+/Npe8ggAfQ8hqvQX+LgB6YH2jGOHNjBUOkpFm 3VehuW6LDCP6qEsQA0/VS5nuqn92I06+ZfYihVzVS2qQ+FhRBLR40N3MCFDo9p89c4x4 9xgg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339128; 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=Ii17T7VAoR8+UlL8LnMJpVNUDvOUl5el80hXLnYIkJo=; b=1AL1PwhzDlQEgjQnEhg9f6KfmcMyaS2vsWoz1Se02CpydRblR6Qka2UXpdzthnjMK5 chEX3takA9dtJ+mNG7CQ== 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 R04c57z93DIm2ON (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:48 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:29 +0200 Subject: [PATCH v2 11/14] arm64: dts: qcom: msm8916-longcheer-l8910: Add sound and modem MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-11-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 , Jonathan Albrieux X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Jonathan Albrieux Enable sound and modem for the Longcheer L8910 (BQ Aquaris X5). 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: - Awinic AW8738 connected to HPH_R (headphones) output of the analog codec. Note that unlike for wingtech-wt88047 there is no analog switch that would allow disabling output via the headphone jack when the speaker is enabled. Signed-off-by: Jonathan Albrieux Co-developed-by: Stephan Gerhold Reviewed-by: Konrad Dybcio Signed-off-by: Stephan Gerhold --- .../boot/dts/qcom/msm8916-longcheer-l8910.dts | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts index 41cadb906b98..e64bf687ca7d 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts @@ -3,6 +3,8 @@ /dts-v1/; #include "msm8916-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + #include #include #include @@ -22,6 +24,16 @@ chosen { stdout-path = "serial0"; }; + speaker_amp: audio-amplifier { + compatible = "awinic,aw8738"; + mode-gpios = <&tlmm 114 GPIO_ACTIVE_HIGH>; + awinic,mode = <5>; + sound-name-prefix = "Speaker Amp"; + + pinctrl-0 = <&spk_ext_pa_default>; + pinctrl-names = "default"; + }; + flash-led-controller { compatible = "ocs,ocp8110"; enable-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>; @@ -107,6 +119,17 @@ &blsp_uart2 { status = "okay"; }; +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5000000>; +}; + +&pm8916_codec { + 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 = ; @@ -137,6 +160,28 @@ &sdhc_2 { cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>; }; +&sound { + /* + * Provide widgets/pin-switches to allow enabling speaker separately. + * The hardware does not provide a way to disable the output via the + * headphone jack when the speaker is enabled. + */ + model = "bq-paella"; + widgets = + "Speaker", "Speaker", + "Headphone", "Headphones"; + pin-switches = "Speaker"; + audio-routing = + "Speaker", "Speaker Amp OUT", + "Speaker Amp IN", "HPH_R", + "Headphones", "HPH_L", + "Headphones", "HPH_R", + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS External1"; + aux-devs = <&speaker_amp>; +}; + &usb { status = "okay"; extcon = <&usb_id>, <&usb_id>; @@ -205,6 +250,13 @@ sdc2_cd_default: sdc2-cd-default-state { bias-disable; }; + spk_ext_pa_default: spk-ext-pa-default-state { + pins = "gpio114"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + usb_id_default: usb-id-default-state { pins = "gpio110"; function = "gpio"; From patchwork Tue Oct 3 13:18:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 13407649 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42184E7AD40 for ; Tue, 3 Oct 2023 13:19:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235865AbjJCNTG (ORCPT ); Tue, 3 Oct 2023 09:19:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235625AbjJCNS7 (ORCPT ); Tue, 3 Oct 2023 09:18:59 -0400 Received: from mo4-p03-ob.smtp.rzone.de (mo4-p03-ob.smtp.rzone.de [85.215.255.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D8D8D3; Tue, 3 Oct 2023 06:18:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339128; cv=none; d=strato.com; s=strato-dkim-0002; b=sBTOCYL0l7xpzClqzSaMp1yAB+TbcIG0/h+JA1rplR1ec06wItNwxweMhv8iR8CCSW 8ubxVOrPS44ovxVBBGV8QqHhfrG+ntjnDzd8LbrDNJzrbgvEmKm5kdQdnmf5J1tj+ZvA WJGudu03eOChKkhboox6R7KZzB3BSNB/N/aniSUIjj4RCRRw9VFeFjMZG2BGlNGLJjZx 55DwQD/JksF79TBsJOCYB1mwtIlxAFAqcbpAaq1WGWrwC3N8yCtJc2+TFkowHY5hXfNv SMEe7110tvV2j3Hx8yL6NDjAMKYeDtwV1b+M23fYzOHE/wTy1HV89ffr8S9DzC6UfXw7 iQaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1696339128; 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=ABcr19tRNPJA9WwA6xu4YglVdNWC2sFiJ/DvAai4lIo=; b=n+5mtP/7v2dRfGdBn8FC2cQEDqZz4nUXdZP8O654BJCrtbaUrRouH54pq+F6Pa+cYD 32f2ac0KAfmyRm5Y/hvxCVcDqwKT//49ZwHK1D9lDC3bMp3GzCXTpfYaAEtdszAYvuRj LKsanQSFDxSr+IxI2NoHhmK3LLcDbQUgj4P1/siUW2gSNNWREe3NHIo1hnkYLZIgm0BK AR6vaKU9L1TtwqpMJApzauyb2zN9soGYOGYuCds/596vWfIJDMisLYC1g7ZE94wCbMIO GLXrU1rViq/I7lUzHpkeC41/QxV9ahLjf4wP3lvb0mK2Mekk/ATR7yUkJv/7yzSqrOMA pdAg== 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=1696339128; 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=ABcr19tRNPJA9WwA6xu4YglVdNWC2sFiJ/DvAai4lIo=; b=mtGigz86apnLDj4Aef2RFkKeMYEQ4Fj06SefhLGT8Mjc9F+Pd+TGxdNGqDhBCARhEA ke+fm003Xb6as6voEbHMBN5/LsG8e7x1KmQyCWa+YxqygUDUPMP/JmEMOuzgnAxH1oJS baXA+edN4EGbQg5w7pvBAs90gqMyrOAP238dHYRTXsgTyur/n+/XlZVUUs6IplXMTymi G3rFarBl3Ba8qWBiU8E8DuQgELKIJ8a8hRfxHWzNY1iqBoliwIR1SZ53KYPDkgmCicgA dwlbPJMGRiI/QVfD22X5pYhp+ukAJPPkL4mTjQ2UcEdXqmD50LPN4e5tdVzx1ygaIv+3 JMxA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1696339128; 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=ABcr19tRNPJA9WwA6xu4YglVdNWC2sFiJ/DvAai4lIo=; b=0rBD6xGGMzYpccoyDhR5F3E2OKkHPicRep76JrYZNxJE09AEt7xPEWwEbMgYxtlCVH pgcSghTHcwohbkBWCXDg== 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 R04c57z93DIm2OO (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 3 Oct 2023 15:18:48 +0200 (CEST) From: Stephan Gerhold Date: Tue, 03 Oct 2023 15:18:30 +0200 Subject: [PATCH v2 12/14] arm64: dts: qcom: msm8916-samsung-gt5: Add sound and modem MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-12-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 , Jasper Korten , Siddharth Manthan , Nikita Travkin X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Jasper Korten Enable sound and modem for the Samsung Galaxy Tab A 2015 tablets. The setup is similar to most MSM8916 devices, i.e.: - QDSP6 audio - Headphones/microphones via digital/analog codec in MSM8916/PM8916. Earpiece exists on samsung-gt58 only. - WWAN Internet via BAM-DMUX except: - gt510: Stereo Maxim MAX98357A codecs for speaker on Quaternary MI2S - gt58: Mono NXP TFA9895 codec for speaker on Quaternary MI2S - For some reason connected to GPIOs where no hardware I2C controller is available -> need to use i2c-gpio - Samsung-specific audio jack detection (not supported yet) Signed-off-by: Jasper Korten Co-developed-by: Siddharth Manthan Signed-off-by: Siddharth Manthan Co-developed-by: Nikita Travkin Signed-off-by: Nikita Travkin [Stephan: Add consistent commit message, minor refactoring] Signed-off-by: Stephan Gerhold --- .../boot/dts/qcom/msm8916-samsung-gt5-common.dtsi | 54 ++++++++++++++++++++++ arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts | 22 +++++++++ arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts | 42 +++++++++++++++++ 3 files changed, 118 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi index 6a16eb5ce07b..fbd2caf405d5 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi @@ -3,9 +3,12 @@ /dts-v1/; #include "msm8916-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" + #include #include #include +#include / { aliases { @@ -116,6 +119,29 @@ &blsp_uart2 { 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>; + }; +}; + +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5400000>; +}; + &pm8916_resin { linux,code = ; status = "okay"; @@ -133,6 +159,13 @@ &pm8916_usbin { status = "okay"; }; +&q6afedai { + dai@22 { + reg = ; + qcom,sd-lines = <1>; + }; +}; + &sdhc_1 { status = "okay"; }; @@ -147,6 +180,27 @@ &sdhc_2 { status = "okay"; }; +&sound { + audio-routing = + "AMIC1", "MIC BIAS External1", + "AMIC2", "MIC BIAS Internal2", + "AMIC3", "MIC BIAS External1"; + + 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 { dr_mode = "peripheral"; extcon = <&pm8916_usbin>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts index c3f1acc55078..5b34529b816c 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts @@ -9,6 +9,14 @@ / { compatible = "samsung,gt510", "qcom,msm8916"; chassis-type = "tablet"; + speaker_codec: audio-codec { + compatible = "maxim,max98357a"; + sdmode-gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; + #sound-dai-cells = <0>; + pinctrl-0 = <&audio_sdmode_default>; + pinctrl-names = "default"; + }; + clk_pwm: pwm { compatible = "clk-pwm"; #pwm-cells = <2>; @@ -146,7 +154,21 @@ &mdss_dsi0_out { remote-endpoint = <&panel_in>; }; +&sound { + model = "samsung-gt510"; + pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default>; + pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep>; + pinctrl-names = "default", "sleep"; +}; + &tlmm { + audio_sdmode_default: audio-sdmode-default-state { + pins = "gpio55"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + buckbooster_en_default: buckbooster-en-default-state { pins = "gpio51"; function = "gpio"; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts index 998625abd409..579312ed53ce 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts @@ -35,6 +35,26 @@ reg_vdd_tsp: regulator-vdd-tsp { pinctrl-names = "default"; }; + i2c-amplifier { + compatible = "i2c-gpio"; + sda-gpios = <&tlmm 55 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + scl-gpios = <&tlmm 56 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + + pinctrl-0 = <&_i2c_default>; + pinctrl-names = "default"; + + #address-cells = <1>; + #size-cells = <0>; + + speaker_codec: audio-codec@34 { + compatible = "nxp,tfa9895"; + reg = <0x34>; + vddd-supply = <&pm8916_l5>; + sound-name-prefix = "Speaker"; + #sound-dai-cells = <0>; + }; + }; + vibrator { compatible = "gpio-vibrator"; enable-gpios = <&tlmm 76 GPIO_ACTIVE_HIGH>; @@ -98,7 +118,21 @@ &mdss_dsi0_out { remote-endpoint = <&panel_in>; }; +&sound { + model = "samsung-a2015"; + pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default &secondary_mic_default>; + pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep &secondary_mic_default>; + pinctrl-names = "default", "sleep"; +}; + &tlmm { + amp_i2c_default: amp-i2c-default-state { + pins = "gpio55", "gpio56"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; + buckbooster_en_default: buckbooster-en-default-state { pins = "gpio8"; function = "gpio"; @@ -127,6 +161,14 @@ reg_tsp_en_default: reg-tsp-en-default-state { bias-disable; }; + secondary_mic_default: secondary-mic-default-state { + pins = "gpio98"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + output-high; + }; + tsp_int_default: tsp-int-default-state { pins = "gpio13"; function = "gpio"; 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: 13407647 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F6E3E7AD47 for ; Tue, 3 Oct 2023 13:19:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232608AbjJCNTE (ORCPT ); Tue, 3 Oct 2023 09:19:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235745AbjJCNTC (ORCPT ); Tue, 3 Oct 2023 09:19:02 -0400 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 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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 */ }; From patchwork Tue Oct 3 13:18:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 13407650 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 738F2E7AD40 for ; Tue, 3 Oct 2023 13:19:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236921AbjJCNTK (ORCPT ); Tue, 3 Oct 2023 09:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235893AbjJCNTC (ORCPT ); Tue, 3 Oct 2023 09:19:02 -0400 Received: from mo4-p04-ob.smtp.rzone.de (mo4-p04-ob.smtp.rzone.de [81.169.146.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F690A1; Tue, 3 Oct 2023 06:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696339129; cv=none; d=strato.com; s=strato-dkim-0002; b=FfXHI5z85pFW5Y617fsif0hDGFdhByWmGZKgyC6ItfYRrl6e1uxDUztu58PDnWw1sG ggE0w0gBXVVI3Dz21GwEWXMeC7qxh8V4lR/5Tp28a7VM5r8WiX5OLAKmejzSNk6GNbFB RAb/4XDrZOkbQ+XBnc6PijJwgZkOWkuSQq4g7q/uyqgovRDTmpy2GB2cXDHZhZrtF/tl C6z0fXXMl75uJrXCV8R86uWk6IE+xBHGENy00ZsnfZmlKSyP9v9iOgd7BSWR6qhH9QmH KpiAkfUFu0SRy+0Yo0XvfhunwlatvDK9dRADIBBySCjJx05uLCBKVMVEp797h0YC1QBX Hjiw== 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=Gthy3JZsd0POCax8iakG2TwMg0evFgfpOwFOAF4TfGU=; b=OIxGCXWXBRM8TQ0arBmYXi0iUmNH0KTrIJTF40U0/mfTFHE9sfrNt5L34/eqOshA/p Nu9rfTA6Cn/9fh9baQwgDO7oNFX4+yMOO/uzDp/lU1iy5bbxDeZqBdDtvKTiZV+8FuUB y0aJjREap5C9HMXMIf54nS2xX/7+MMNykC4JaZivWwHHgEVcPoyFyrQtdFyPhqdBKApq zfS3RyxuvKDWmMwPRL4YVHsgPf37OLbK0oHEMfK34sDk+a++egG2pCJRE8Iql+xO+pSs JqF0Ly9IoTAw/a21azfUWgM2yI/XQV5Tj9prZBvYdUcYteuoVGlAWNYZT31Paq4WSQi9 LJhw== 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=Gthy3JZsd0POCax8iakG2TwMg0evFgfpOwFOAF4TfGU=; b=KpgqbqGlCBEbqsIh5Z5cnOA9nM8SvKhW1z4HpDvLrq56BdRL3uh2MeeFPcYb7Eaaif gixvA/zzA7054hPv/qDNNUx9vLqor+1GNmC/nzxt/mm/YtQ8OOiAsQ7OVnqcY3k1dG+3 ylM6zaZKu1WsF/4y/+VTWOU0z0NcB4Mh3294xL7JEMdNUb0mazI1XecGKTNrpAMArraa EY9wPYMjHEaPg4qQsRXeQv3WwxfU25frVHyiJRTxIeoVNRe5rEVWugcPqw1yvlkZHwPZ 12V8Uuyj1xcGbxLYsSnWTp4qC2WJnnPU9Lx6Bh0l9WeBI78LCrbIViaGenSlW/j4VECM TOaA== 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=Gthy3JZsd0POCax8iakG2TwMg0evFgfpOwFOAF4TfGU=; b=DKuerXdB9UpbvEy5/to8ka0g/S5knTp24S+f3VVpez6j1EOLt8x/FNCqbE2XNjw5wo uuGsMjzl7cSS1/tGCyBg== 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 R04c57z93DIn2OQ (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:32 +0200 Subject: [PATCH v2 14/14] arm64: dts: qcom: msm8939-samsung-a7: Add sound and modem MIME-Version: 1.0 Message-Id: <20231003-msm8916-modem-v2-14-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 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: "Lin, Meng-Bo" Enable sound and modem for the Samsung A7. 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 for the same differences as the MSM8916-based Samsung A2015 devices: - NXP TFA9895 codec for speaker on Quaternary MI2S - Samsung-specific audio jack detection (not supported yet) Signed-off-by: "Lin, Meng-Bo" [Stephan: Add consistent commit message, minor refactoring] Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts | 70 +++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts index fccd8fec8b8f..aa6c39482a2f 100644 --- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts +++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts @@ -3,10 +3,12 @@ /dts-v1/; #include "msm8939-pm8916.dtsi" +#include "msm8916-modem-qdsp6.dtsi" #include #include #include +#include / { model = "Samsung Galaxy A7 (2015)"; @@ -287,6 +289,18 @@ muic: extcon@25 { }; }; +&blsp_i2c2 { + 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_i2c5 { status = "okay"; @@ -309,6 +323,29 @@ &blsp_uart2 { 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>; + }; +}; + +&mpss_mem { + reg = <0x0 0x86800000 0x0 0x5800000>; +}; + &pm8916_resin { linux,code = ; status = "okay"; @@ -321,6 +358,13 @@ pm8916_l17: l17 { }; }; +&q6afedai { + dai@22 { + reg = ; + qcom,sd-lines = <1>; + }; +}; + &sdhc_1 { status = "okay"; }; @@ -335,6 +379,32 @@ &sdhc_2 { status = "okay"; }; +&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 { extcon = <&muic>, <&muic>; status = "okay";