Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp264334iol; Thu, 9 Jun 2022 03:30:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVQxa8S/Tqwfg8a0YoUFU3KAqYLqCJM6DkX2IsN5FwG9b0h3Qx68rLXKVqJ3FdoV7xl+QA X-Received: by 2002:a05:6402:2789:b0:42d:ce10:1d6 with SMTP id b9-20020a056402278900b0042dce1001d6mr44483619ede.188.1654770648912; Thu, 09 Jun 2022 03:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654770648; cv=none; d=google.com; s=arc-20160816; b=FyOxtNEUnYoDPqesMSna8DkdKe08OFKRLrhRkHC8ZsKkaNdiHmfLtC1MHso0jmvWtg F3rKJ7TzU4GkrWY5v1FqPMk8HnFZCy/vdhzrImqkPU/0SCbApuFt/4SbvmDvS7aWA/VM i+AiYfALrNYHmxsGiI3ji5+mOHkuaFDkFWc9VjsPetWAzXjD3oYf86JtlGh9pVeiLGzD ClT0qm2X4OxRliytqMILaxfSJfl/CT2mQ9VxovqMUteK+Osvh/+Cv0etszyf8ejIKeHA BNoo4n1vkHgKPbYUnPtP8kKKqanudDsPFmMHR4imEF2EpGCaevFC+/PgZAgnULfz5sNN lr3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=3ai7MXDHhQ0YkmN4XjLxpe4VHIXkfJfMzV2EfEfNPqA=; b=L3cfwaHNEqMFSQS9ygh+Qy5ErZMY7c0k1+YieMoeBFZ1b8m3rKiWyXwzBW7mWzLIpq WvXNxmXQrf2vjpD2wEecFW+25UrR9k+X1lNpvbgyLFOk2aX8YdOEUwe+vVaWpZTxV+Xs H6bJlI2cvdjemYZYVIprHX9B47zh0L9r+DTMisRIoKDpgw89fys/4w8WohbbxNX+1dKb LXM2hrpWTea9B7OjQcrjTK48YUhuLdpHShojxHGxWf4MRj3R/E3VM/Glhyd3vHRGVHuQ +9x7CkQhKXX35JXNxsavhqa74B6q6rzHZcJB52nojBwrRONYRnX+DFTQ9lh8hLEqyAaI 1IEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shiftphones.com header.s=2018 header.b=q3qFRsOM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=shiftphones.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn15-20020a17090794cf00b007120fa39360si708357ejc.602.2022.06.09.03.30.23; Thu, 09 Jun 2022 03:30:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@shiftphones.com header.s=2018 header.b=q3qFRsOM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=shiftphones.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242223AbiFIJyr (ORCPT + 99 others); Thu, 9 Jun 2022 05:54:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239398AbiFIJyh (ORCPT ); Thu, 9 Jun 2022 05:54:37 -0400 X-Greylist: delayed 2337 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 09 Jun 2022 02:54:35 PDT Received: from mail.shift-gmbh.com (mail.shift-gmbh.com [85.10.195.145]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33A7B19578A; Thu, 9 Jun 2022 02:54:33 -0700 (PDT) From: Alexander Martinz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shiftphones.com; s=2018; t=1654768471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ai7MXDHhQ0YkmN4XjLxpe4VHIXkfJfMzV2EfEfNPqA=; b=q3qFRsOM0276IDWHlcDx5ar0aVWlGYi/hivWeZCNX4vetaAs94nL3WD5W8jjKIOhuUX10N 9yklJLJ3nk7v2sGTmgwLFqQeVGhqc7pc7D4Q7f6XO8uyQQs/rbO0US5qfm1lIVFId7/7Pw bO90EOk4ZKWREEwZeszqcT25Swz+KVC5EQ5/vwrwBolzzaZbsDbhfVE4JhzEH3KRmETdK+ wpI5ZLpRQecrGgxz9fOojk+YXK3NgdHV20zpn+o1tW/0OPi7qQy4Gpi2WFX8cWWSToOm0w FaurpkpwnXFGyId4LP9VlVA6Z7BiAPgpfvQxSJdO+bU4q8iJFqSV6IRepJB7Ng== To: ~postmarketos/upstreaming@lists.sr.ht Cc: phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Martinz , Dylan Van Assche Subject: [PATCH 2/2] arm64: dts: qcom/sdm845-shift-axolotl: Add audio support Date: Thu, 9 Jun 2022 11:54:12 +0200 Message-Id: <20220609095412.211060-2-amartinz@shiftphones.com> In-Reply-To: <20220609095412.211060-1-amartinz@shiftphones.com> References: <20220609095412.211060-1-amartinz@shiftphones.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Authentication-Results: ORIGINATING; auth=pass smtp.auth=amartinz@shiftphones.com smtp.mailfrom=amartinz@shiftphones.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds audio support for the SHIFT6mq phone. The primary microphone and headphone jack are handled by the SDM845 sound card and WCD9340 codec. The primary speaker needs to go through the TFA9890 speaker amplifier. Signed-off-by: Alexander Martinz Tested-by: Dylan Van Assche --- .../boot/dts/qcom/sdm845-shift-axolotl.dts | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts index fa72f23ef0c2..8c4967d6d0e3 100644 --- a/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts +++ b/arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dts @@ -8,6 +8,8 @@ #include #include +#include +#include #include "sdm845.dtsi" #include "pm8998.dtsi" #include "pmi8998.dtsi" @@ -492,6 +494,19 @@ touchscreen@38 { }; }; +&i2c11 { + status = "okay"; + clock-frequency = <400000>; + + tfa9890_codec: tfa9890@34 { + compatible = "nxp,tfa9890"; + reg = <0x34>; + vddd-supply = <&vreg_s4a_1p8>; + reset-gpio = <&tlmm 7 0>; + #sound-dai-cells = <1>; + }; +}; + &ipa { status = "okay"; @@ -530,6 +545,27 @@ volume_down_resin: resin { }; }; +&q6afedai { + qi2s@22 { + reg = <22>; + qcom,sd-lines = <0>; + }; +}; + +&q6asmdai { + dai@0 { + reg = <0>; + }; + + dai@1 { + reg = <1>; + }; + + dai@2 { + reg = <2>; + }; +}; + /* * Prevent garbage data on bluetooth UART lines */ @@ -578,6 +614,84 @@ &qupv3_id_1 { status = "okay"; }; +&sound { + model = "SHIFT6mq"; + compatible = "qcom,sdm845-sndcard"; + pinctrl-0 = <&quat_mi2s_active &quat_mi2s_sd0_active>; + pinctrl-names = "default"; + + audio-routing = "RX_BIAS", "MCLK", + "AMIC1", "MIC BIAS1", + "AMIC2", "MIC BIAS2", + "AMIC3", "MIC BIAS3"; + + mm1-dai-link { + link-name = "MultiMedia1"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>; + }; + }; + + mm2-dai-link { + link-name = "MultiMedia2"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>; + }; + }; + + mm3-dai-link { + link-name = "MultiMedia3"; + cpu { + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>; + }; + }; + + speaker-dai-link { + link-name = "Speaker Playback"; + codec { + sound-dai = <&tfa9890_codec 0>; + }; + + cpu { + sound-dai = <&q6afedai QUATERNARY_MI2S_RX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + }; + + slim-dai-link { + link-name = "SLIM Playback"; + codec { + sound-dai = <&wcd9340 0>; + }; + + cpu { + sound-dai = <&q6afedai SLIMBUS_0_RX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + }; + + slimcap-dai-link { + link-name = "SLIM Capture"; + codec { + sound-dai = <&wcd9340 1>; + }; + + cpu { + sound-dai = <&q6afedai SLIMBUS_0_TX>; + }; + + platform { + sound-dai = <&q6routing>; + }; + }; +}; + &tlmm { gpio-reserved-ranges = <0 4>, <81 4>; @@ -686,6 +800,15 @@ config { bias-pull-down; }; }; + + wcd_intr_default: wcd_intr_default { + pins = <54>; + function = "gpio"; + + input-enable; + bias-pull-down; + drive-strength = <2>; + }; }; &uart6 { @@ -756,6 +879,24 @@ &venus { firmware-name = "qcom/sdm845/axolotl/venus.mbn"; }; +&wcd9340 { + pinctrl-0 = <&wcd_intr_default>; + pinctrl-names = "default"; + clock-names = "extclk"; + clocks = <&rpmhcc RPMH_LN_BB_CLK2>; + reset-gpios = <&tlmm 64 0>; + vdd-buck-supply = <&vreg_s4a_1p8>; + vdd-buck-sido-supply = <&vreg_s4a_1p8>; + vdd-tx-supply = <&vreg_s4a_1p8>; + vdd-rx-supply = <&vreg_s4a_1p8>; + vdd-io-supply = <&vreg_s4a_1p8>; + + qcom,micbias1-microvolt = <2700000>; + qcom,micbias2-microvolt = <2700000>; + qcom,micbias3-microvolt = <2700000>; + qcom,micbias4-microvolt = <2700000>; +}; + &wifi { status = "okay"; -- 2.36.1