From patchwork Fri May 12 16:04:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 682614 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 433E2C77B7F for ; Fri, 12 May 2023 16:05:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241935AbjELQFC (ORCPT ); Fri, 12 May 2023 12:05:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241708AbjELQFB (ORCPT ); Fri, 12 May 2023 12:05:01 -0400 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D927010CE for ; Fri, 12 May 2023 09:04:59 -0700 (PDT) Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-50bc075d6b2so18582704a12.0 for ; Fri, 12 May 2023 09:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683907498; x=1686499498; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aTITtva9ESnDWPsfvxoiIyGYO4jGWyqhVk7CK7KuwE0=; b=Ng6V89v7bBqoSRsfmCWvon9AUTLZHk4wNVGxXsFgRD+mJL4BQcjTMvFYSCpqU4okTL avOT6qcoaDtdu94YYp+0vhMO8ynK8cBdHdAw5XN4y16xVP0zXzhNe0p1WfyTducF7qR3 ysPl0aqOXA9Fswk9vjjxF+ExqLzMWTkv+8zEqaf9CIpW5QQ+2RtOstJy1phyA8EzEGPv 7G5jQtSykd8q8/IuoLHM3KFIjxTzImYzYKbMOE1Kw+mD4tv+1Ov0WKzZov56g6V8W9WW iVKLdJhfn0ETFWSRUISYXjuANY9Qg0FL+NpbEEKqg0uWhy05dHwJILqfzzWwV4dicFXh ezdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683907498; x=1686499498; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aTITtva9ESnDWPsfvxoiIyGYO4jGWyqhVk7CK7KuwE0=; b=VV0CB0mPJLdeUg+rxHOqA5kACM4vF/hhY9IJEkp4mNtBW2CMTbBRB7tY7bc+knyAtI EnuXWu0Fk1l8TYIauaFbroaND+Ph0ktHkNC13ocfjJMrjTmg4JYrlQDp4FEffxoDHFab YJDvWAhfIVpmm8WtQR1ges8zEyJ69GZ4nld/IXuOQMhgzheWuE9hDPhEGsMP30NXOraY mWEtGdMmzVR+4AApjEIzju+dPfhWrcfzc/c2YdmSJOkSOpvZje6AD3vjlxeAkwoZWyVC wOlrFLOgn+luh4L9MoIkg98EQyn03Sb6cNAeP50IyXKBTikrBQ5LgUg5zXFncEyWU6VC SH7A== X-Gm-Message-State: AC+VfDxJsVHr07LpYW5CU7pv7r9xvE1fbrtcJ+oEPpFWed4RIGQPcrtl E44NhrUSHsUZzPGMPaeGKKrPrw== X-Google-Smtp-Source: ACHHUZ4l6y4L1Co/q9xMiAqUbhWQLBl5/9kwT6gnhMbGxPJrO0k2itQKwxGbquiPqzWGqLtq9JoTiQ== X-Received: by 2002:aa7:d64d:0:b0:50c:3dc:2262 with SMTP id v13-20020aa7d64d000000b0050c03dc2262mr18851543edr.39.1683907498385; Fri, 12 May 2023 09:04:58 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:7ede:fc7b:2328:3883]) by smtp.gmail.com with ESMTPSA id d5-20020a50fe85000000b004fbf6b35a56sm4224935edt.76.2023.05.12.09.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 09:04:55 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , Patrick Lai , Srinivas Kandagatla Subject: [PATCH 1/2] arm64: dts: qcom: sm8550-qrd: add WCD9385 audio-codec Date: Fri, 12 May 2023 18:04:51 +0200 Message-Id: <20230512160452.206585-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add Qualcomm Aqstic WCD9385 audio codec on two Soundwire interfaces: RX and TX. Signed-off-by: Krzysztof Kozlowski --- Cc: Patrick Lai Cc: Srinivas Kandagatla --- arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts index d5a645ee2a61..ccc58e6b45bd 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts @@ -23,6 +23,32 @@ aliases { serial0 = &uart7; }; + wcd938x: audio-codec { + compatible = "qcom,wcd9385-codec"; + + pinctrl-names = "default"; + pinctrl-0 = <&wcd_default>; + + qcom,micbias1-microvolt = <1800000>; + qcom,micbias2-microvolt = <1800000>; + qcom,micbias3-microvolt = <1800000>; + qcom,micbias4-microvolt = <1800000>; + qcom,mbhc-buttons-vthreshold-microvolt = <75000 150000 237000 500000 500000 500000 500000 500000>; + qcom,mbhc-headset-vthreshold-microvolt = <1700000>; + qcom,mbhc-headphone-vthreshold-microvolt = <50000>; + qcom,rx-device = <&wcd_rx>; + qcom,tx-device = <&wcd_tx>; + + reset-gpios = <&tlmm 108 GPIO_ACTIVE_LOW>; + + vdd-buck-supply = <&vreg_l15b_1p8>; + vdd-rxtx-supply = <&vreg_l15b_1p8>; + vdd-io-supply = <&vreg_l15b_1p8>; + vdd-mic-bias-supply = <&vreg_bob1>; + + #sound-dai-cells = <1>; + }; + chosen { stdout-path = "serial0:115200n8"; }; @@ -385,8 +411,38 @@ &sleep_clk { clock-frequency = <32000>; }; +&swr1 { + status = "okay"; + + /* WCD9385 RX */ + wcd_rx: codec@0,4 { + compatible = "sdw20217010d00"; + reg = <0 4>; + qcom,rx-port-mapping = <1 2 3 4 5>; + }; +}; + +&swr2 { + status = "okay"; + + /* WCD9385 TX */ + wcd_tx: codec@0,3 { + compatible = "sdw20217010d00"; + reg = <0 3>; + qcom,tx-port-mapping = <1 1 2 3>; + }; +}; + &tlmm { gpio-reserved-ranges = <32 8>; + + wcd_default: wcd-reset-n-active-state { + pins = "gpio108"; + function = "gpio"; + drive-strength = <16>; + bias-disable; + output-low; + }; }; &uart7 { From patchwork Fri May 12 16:04:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 681272 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 EF872C77B7F for ; Fri, 12 May 2023 16:05:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241932AbjELQFF (ORCPT ); Fri, 12 May 2023 12:05:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241946AbjELQFE (ORCPT ); Fri, 12 May 2023 12:05:04 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46C8130CB for ; Fri, 12 May 2023 09:05:02 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-965ab8ed1fcso1857766366b.2 for ; Fri, 12 May 2023 09:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683907501; x=1686499501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w0PYOudo3P+JObhGAcVuidrG1Rb2PsNeOuDCShvwBdM=; b=JUtVKq5Krnb6A19hxU2smnPX5rjDEKnJ2/NB8aUU71UHi87917K++0BW7h9vg33KHx HXf1iNcnXkFMyGeh7lSc0+swaiXQmZWJsVN/xboyeusLosYnwYfuymqKsTwZ8pZifGtC SjwVGBqhsfDE5pOzBrgZu61BCA/dp7iTAq/R1qREfuIINlWxIVa3xQpJrjW6jkAbHuaR p5/HnujJf9cYjh5X8qAf4JU29L4UcwNWnSMKl1fOqSQXaEV+j7Wg2Vhk20Dx078mZqlo 2sA8Ghl7JoGP/q8ZhNa2ilJ8BFWLH0X24+LU3+7vbgDITnZTlqJl2Mnu5qiFCSCGzBYQ hylw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683907501; x=1686499501; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w0PYOudo3P+JObhGAcVuidrG1Rb2PsNeOuDCShvwBdM=; b=b8jKLnY/rTsSgPC+IZy2jRCcQc3ZREnqiYUKSd48D39IMfi7QAerOJrezJrh1MWZlK sj756EHDqqOJHSoDTfXsy2bStAe1220Lvo5m1h8SkXwiU6sEVE9as8LR68HWdGlyjp8O w3+7wKeCGHkrwdml9Dx3wPVIlHlWfyaIFVBGZZ/vboKXFDcXw5xHYOyq4Uo/jhHXzk9x jxTJZ6HefqBeB0tc7mOc/1apQXGtW7DVvmxfFeV7o4c9pajlFQRR49avGXY87LBVf1rt dWt+r891HmWozvGJ58n+X6Ba/9vpH8yxQvGy1bdkHzvxjDv2SE5dMTx4JU/vuT3w2+Ot 1y9g== X-Gm-Message-State: AC+VfDxUDw3DUFXErWqMMUhAifsTsl63wLFpZjAybdyvsOeIPrQkBC0b +6ttgaqwSazQwZi5Kvs2YpiVsQ== X-Google-Smtp-Source: ACHHUZ4nQh48nD9diogVXknvtWR0ykPVeneEFht9Gt2ECiN4OYr+m21HACXFlFlkcpqL3sIuO5PivQ== X-Received: by 2002:a17:907:1b24:b0:94e:5c28:1c19 with SMTP id mp36-20020a1709071b2400b0094e5c281c19mr24930056ejc.5.1683907500702; Fri, 12 May 2023 09:05:00 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:7ede:fc7b:2328:3883]) by smtp.gmail.com with ESMTPSA id d5-20020a50fe85000000b004fbf6b35a56sm4224935edt.76.2023.05.12.09.04.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 09:04:59 -0700 (PDT) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , Patrick Lai , Srinivas Kandagatla Subject: [PATCH 2/2] arm64: dts: qcom: sm8550-mtp: add WCD9385 audio-codec Date: Fri, 12 May 2023 18:04:52 +0200 Message-Id: <20230512160452.206585-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230512160452.206585-1-krzysztof.kozlowski@linaro.org> References: <20230512160452.206585-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add Qualcomm Aqstic WCD9385 audio codec on two Soundwire interfaces: RX and TX. Signed-off-by: Krzysztof Kozlowski --- Not tested and not really verified against schematics (no access). MTP added based on downstream DTS. Cc: Patrick Lai Cc: Srinivas Kandagatla --- arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 56 +++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts index af0381acac25..905a5d3aa400 100644 --- a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts +++ b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts @@ -23,6 +23,32 @@ aliases { serial0 = &uart7; }; + wcd938x: audio-codec { + compatible = "qcom,wcd9385-codec"; + + pinctrl-names = "default"; + pinctrl-0 = <&wcd_default>; + + qcom,micbias1-microvolt = <1800000>; + qcom,micbias2-microvolt = <1800000>; + qcom,micbias3-microvolt = <1800000>; + qcom,micbias4-microvolt = <1800000>; + qcom,mbhc-buttons-vthreshold-microvolt = <75000 150000 237000 500000 500000 500000 500000 500000>; + qcom,mbhc-headset-vthreshold-microvolt = <1700000>; + qcom,mbhc-headphone-vthreshold-microvolt = <50000>; + qcom,rx-device = <&wcd_rx>; + qcom,tx-device = <&wcd_tx>; + + reset-gpios = <&tlmm 108 GPIO_ACTIVE_LOW>; + + vdd-buck-supply = <&vreg_l15b_1p8>; + vdd-rxtx-supply = <&vreg_l15b_1p8>; + vdd-io-supply = <&vreg_l15b_1p8>; + vdd-mic-bias-supply = <&vreg_bob1>; + + #sound-dai-cells = <1>; + }; + chosen { stdout-path = "serial0:115200n8"; }; @@ -535,6 +561,28 @@ &sleep_clk { clock-frequency = <32000>; }; +&swr1 { + status = "okay"; + + /* WCD9385 RX */ + wcd_rx: codec@0,4 { + compatible = "sdw20217010d00"; + reg = <0 4>; + qcom,rx-port-mapping = <1 2 3 4 5>; + }; +}; + +&swr2 { + status = "okay"; + + /* WCD9385 TX */ + wcd_tx: codec@0,3 { + compatible = "sdw20217010d00"; + reg = <0 3>; + qcom,tx-port-mapping = <1 1 2 3>; + }; +}; + &tlmm { gpio-reserved-ranges = <32 8>; @@ -565,6 +613,14 @@ sde_te_suspend: sde-te-suspend-state { drive-strength = <2>; bias-pull-down; }; + + wcd_default: wcd-reset-n-active-state { + pins = "gpio108"; + function = "gpio"; + drive-strength = <16>; + bias-disable; + output-low; + }; }; &uart7 {