Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1052448pxb; Wed, 6 Apr 2022 07:36:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzThE1eEaTEEAxNaOChy8Y8/RY14WtgFa7jDBydcz2fRuYkio22RYZh1Y8U9LdL8LGnzeCZ X-Received: by 2002:a17:902:a981:b0:156:52b2:40d6 with SMTP id bh1-20020a170902a98100b0015652b240d6mr9066178plb.34.1649255808313; Wed, 06 Apr 2022 07:36:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649255808; cv=none; d=google.com; s=arc-20160816; b=IYRvw6I/Dg9VcS1ni4QeOG0Oj040TRNCtI36qy5TXbcHU8ddplP3T+JSJ/W9JxE5XH uObdeR2rRixtulMIlWC/Q7DOyZ4ntREq6QKmG80EKWht7SK1wLxL9a8msIuY2BrxwdJv Un3cBJKi/l8DQxQCvFt8XPaH3Hyn7ZEbn2VljDPEAy/hDXrSxPUuXHxTK1brRiIRu+oQ rAkHZCAm5lF2HRv62LiQI4AzlHnj3NaYL9fEuW7tMFPtE9sK1g1XUhn75eh5MPYGGTqw a9UYg8YeoZvQB1g4ZpHWo4HF4wlBBhOFjAZx10itFJg7tEQwzoo35uYOvVHyyQ+BiY/5 AsaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3T1DLNs454DRQUzm0Ou8rT4NITlZJwcCtRIhth0zBLg=; b=Z2UX3hS1KG+6XzojjlW8CdZgZpcONm3B3mzO7VNDft5Cmf3M5EMoMfNmlH6d7LIFjG Ga8AgDaN4kpOPpVEYHaljz1YInM9XxcEYn832+++UoGFGKF/g72X6FdgaZsdGKArH1kb oieG7Detk1kVB5sbNXT+FilmjsIY2OLkfZy8BMtoQMWOASOgeVy1HCBfeko41zsNLTu7 bL/D3d2/AzF+/2cwdMDhN6LIzgWNEGcvzrfMtLbPlUblGuFFFXT8a88zCIOZbhENVFAy 7LA/jApg4Ub31Lnxe73WfPr9OSyRmIuWhAIMvFYzVin0+XRVLKHdprqS4PSOXWx/FITX CiaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dZmHadTO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g11-20020a63e60b000000b003981febb082si9290529pgh.488.2022.04.06.07.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:36:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dZmHadTO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B4D1B15754E; Wed, 6 Apr 2022 05:32:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1849717AbiDFCj7 (ORCPT + 99 others); Tue, 5 Apr 2022 22:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573664AbiDEWwl (ORCPT ); Tue, 5 Apr 2022 18:52:41 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E8B42183B for ; Tue, 5 Apr 2022 14:35:34 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id y6so273629plg.2 for ; Tue, 05 Apr 2022 14:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3T1DLNs454DRQUzm0Ou8rT4NITlZJwcCtRIhth0zBLg=; b=dZmHadTOGH2sWttG/8o6yry7YYYDnFAlF3s85cSg04QUfWBiZwEu+ZFKK7bHAq2Nzw 0h401ttv6zohsw5jB+Tc2UGfvz6jvfT3KGOZAD5FEm4TMsV6B4icl5lM+1ruDwJY5mqK rJIa8Bc8z5PKxidv6RtFMbTaAU6b5gKanaV/4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3T1DLNs454DRQUzm0Ou8rT4NITlZJwcCtRIhth0zBLg=; b=dQBLsT75jzFg+3EHXsH8UuSfvD4Mv7wNpFHRARHTwzFCnJXn7+G7KuzUdW7ccVjP8a RD+s97tVRp6zWihR4ntTQREAFJFTTs+ZKVtDg26tRng9z8Jg4GMTGNWOP2TOp6rEaCWo LGDBUoXAZPYhg/tWkrENJhgmtQYVyEYnn6ph2KeSg5hcyS/aioQH6J+/0BDg1rWjEM3K pJf9NQZGlSlNk9v4Ti8Ms8KHEeNtMldRpSk2FH5rYY1g3oHvYV8wH7hIPqQnhMq5uCO1 URBHbwBcLrjp7MaCEN78IXBRfqq33/NP/NcuVvFflZnn5QxTvPMmHAzgtv0pD5aYcYj8 YgSQ== X-Gm-Message-State: AOAM530iq/pQmnicXUPU1n5EusKzIYZD4o2q01p8SiXbLdHKt6xBVqAX R/bpiDxjStWWIZ/FxgYjdIThow== X-Received: by 2002:a17:90b:4c44:b0:1c7:109c:b419 with SMTP id np4-20020a17090b4c4400b001c7109cb419mr6324577pjb.113.1649194534059; Tue, 05 Apr 2022 14:35:34 -0700 (PDT) Received: from localhost ([2620:15c:202:201:6b63:d403:e31b:da39]) by smtp.gmail.com with UTF8SMTPSA id g12-20020a056a001a0c00b004e1307b249csm16964755pfv.69.2022.04.05.14.35.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Apr 2022 14:35:33 -0700 (PDT) Date: Tue, 5 Apr 2022 14:35:31 -0700 From: Matthias Kaehlcke To: Srinivasa Rao Mandadapu Cc: agross@kernel.org, bjorn.andersson@linaro.org, robh+dt@kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_rohitkr@quicinc.com, srinivas.kandagatla@linaro.org, dianders@chromium.org, swboyd@chromium.org, judyhsiao@chromium.org, Venkata Prasad Potturu Subject: Re: [PATCH v6 1/3] arm64: dts: qcom: sc7280: Add nodes for va tx and rx macros and external codecs Message-ID: References: <1649157220-29304-1-git-send-email-quic_srivasam@quicinc.com> <1649157220-29304-2-git-send-email-quic_srivasam@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1649157220-29304-2-git-send-email-quic_srivasam@quicinc.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Tue, Apr 05, 2022 at 04:43:38PM +0530, Srinivasa Rao Mandadapu wrote: > SC7280 has VA, TX and RX macros with SoundWire Controllers to attach with > codecs like WCD938x, max98360a using soundwire masters and i2s bus. > Add these nodes for sc7280 based platforms audio use case. > Add tlmm gpio property in wcd938x node for switching CTIA/OMTP Headset. > > Signed-off-by: Srinivasa Rao Mandadapu > Co-developed-by: Venkata Prasad Potturu > Signed-off-by: Venkata Prasad Potturu > --- A change log would be helpful for reviewers > arch/arm64/boot/dts/qcom/sc7280-crd.dts | 6 ++ > arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 8 ++ > arch/arm64/boot/dts/qcom/sc7280-idp.dtsi | 88 ++++++++++++++++++ > arch/arm64/boot/dts/qcom/sc7280.dtsi | 121 +++++++++++++++++++++++++ > 4 files changed, 223 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/sc7280-crd.dts b/arch/arm64/boot/dts/qcom/sc7280-crd.dts > index e2efbdd..224a82d 100644 > --- a/arch/arm64/boot/dts/qcom/sc7280-crd.dts > +++ b/arch/arm64/boot/dts/qcom/sc7280-crd.dts You might want to consider splitting this patch into one that adds the SoC specific bits and one for each board. It's cleaner and might allow to land the SoC specific bits even when the board specific part is still under discussion. It also might make the life easier for folks who want to pick the SoC specific parts, but aren't interested in the board bits (e.g. because they want to support a different board). Just a thought, the split is not strictly necessary. > @@ -84,6 +84,12 @@ ap_ts_pen_1v8: &i2c13 { > pins = "gpio51"; > }; > > +&wcd938x { > + pinctrl-names = "default"; > + pinctrl-0 = <&us_euro_select>; > + us-euro-gpios = <&tlmm 81 GPIO_ACTIVE_HIGH>; > +}; > + > &tlmm { > tp_int_odl: tp-int-odl { > pins = "gpio7"; > diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi > index de646d9..c6a04c3 100644 > --- a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi > +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi > @@ -20,6 +20,14 @@ > #include "sc7280-chrome-common.dtsi" > > / { > + max98360a: audio-codec-0 { > + compatible = "maxim,max98360a"; > + pinctrl-names = "default"; > + pinctrl-0 = <&_en>; > + sdmode-gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; > + #sound-dai-cells = <0>; > + }; > + This node shouldn't be at top but with the other device nodes, in alphabetical order, i.e. before 'pwmleds'. > chosen { > stdout-path = "serial0:115200n8"; > }; > diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi > index f912a89..83c76b2 100644 > --- a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi > +++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi > @@ -20,6 +20,41 @@ > serial1 = &uart7; > }; > > + max98360a: audio-codec-0 { > + compatible = "maxim,max98360a"; > + pinctrl-names = "default"; > + pinctrl-0 = <&_en>; > + sdmode-gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; > + #sound-dai-cells = <0>; > + }; > + > + wcd938x: audio-codec-1 { > + compatible = "qcom,wcd9380-codec"; > + #sound-dai-cells = <1>; > + > + pinctrl-names = "default"; > + pinctrl-0 = <&wcd938x_reset_active>, <&wcd938x_reset_sleep>; > + reset-gpios = <&tlmm 83 GPIO_ACTIVE_HIGH>; > + > + qcom,rx-device = <&wcd_rx>; > + qcom,tx-device = <&wcd_tx>; > + > + vdd-rxtx-supply = <&vreg_l18b_1p8>; > + vdd-io-supply = <&vreg_l18b_1p8>; > + vdd-buck-supply = <&vreg_l17b_1p8>; > + vdd-mic-bias-supply = <&vreg_bob>; > + > + 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>; > + }; > + > gpio-keys { > compatible = "gpio-keys"; > label = "gpio-keys"; > @@ -373,6 +408,19 @@ > status = "okay"; > }; > > +&rxmacro { > + status = "okay"; > +}; > + > +&txmacro { > + status = "okay"; > +}; > + > +&vamacro { > + status = "okay"; > + vdd-micb-supply = <&vreg_bob>; > +}; > + > &sdhc_1 { > status = "okay"; > > @@ -574,6 +622,24 @@ > drive-strength = <6>; > }; > > +&swr0 { > + wcd_rx: codec@0,4 { > + compatible = "sdw20217010d00"; > + reg = <0 4>; > + #sound-dai-cells = <1>; > + qcom,rx-port-mapping = <1 2 3 4 5>; > + }; > +}; > + > +&swr1 { > + wcd_tx: codec@0,3 { > + compatible = "sdw20217010d00"; > + reg = <0 3>; > + #sound-dai-cells = <1>; > + qcom,tx-port-mapping = <1 2 3 4>; > + }; > +}; > + > &tlmm { > amp_en: amp-en { > pins = "gpio63"; > @@ -663,5 +729,27 @@ > function = "gpio"; > bias-pull-down; > }; > + > + us_euro_select: us-euro-select { nit: in the schematic this is called 'us_euro_hs_sel'. IMO it's preferable to use the name from the schematic rather than inventing a new one, unless there's a good reason for it. > + pins = "gpio81"; > + function = "gpio"; > + bias-pull-down; > + drive-strength = <2>; > + }; > + > + wcd938x_reset_active: wcd938x-reset-active { same as above: the schematic calls this pin 'wcd_reset_n' drop the -active suffix > + pins = "gpio83"; > + function = "gpio"; > + drive-strength = <16>; A value of 16 seems pretty high. Is it really needed? > + output-high; > + }; > + > + wcd938x_reset_sleep: wcd938x-reset-sleep { > + pins = "gpio83"; > + function = "gpio"; > + drive-strength = <16>; see above > + bias-disable; > + output-low; > + }; > }; > > diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi > index db74fc3..78ec84c 100644 > --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi > +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi > @@ -822,6 +822,127 @@ > #power-domain-cells = <1>; > }; > > + rxmacro: codec@3200000 { These node are not at the correct position. They should be sorted by address and hence be inserted between 'lpasscc@3000000' and 'interconnect@3c40000'. > + compatible = "qcom,sc7280-lpass-rx-macro"; > + reg = <0 0x03200000 0 0x1000>; > + > + status = "disabled"; > + pinctrl-names = "default"; > + pinctrl-0 = <&rx_swr_active>; > + > + clocks = <&lpass_aon LPASS_AON_CC_TX_MCLK_CLK>, > + <&lpass_aon LPASS_AON_CC_TX_MCLK_2X_CLK>, > + <&vamacro>; > + clock-names = "mclk", "npl", "fsgen"; > + > + power-domains = <&lpass_hm LPASS_CORE_CC_LPASS_CORE_HM_GDSC>, > + <&lpass_aon LPASS_AON_CC_LPASS_AUDIO_HM_GDSC>; > + power-domain-names ="macro", "dcodec"; > + > + #clock-cells = <0>; > + #sound-dai-cells = <1>; > + }; > + > + txmacro: codec@3220000 { > + compatible = "qcom,sc7280-lpass-tx-macro"; > + reg = <0 0x03220000 0 0x1000>; > + > + status = "disabled"; > + pinctrl-names = "default"; > + pinctrl-0 = <&tx_swr_active>; > + > + clocks = <&lpass_aon LPASS_AON_CC_TX_MCLK_CLK>, > + <&lpass_aon LPASS_AON_CC_TX_MCLK_2X_CLK>, > + <&vamacro>; > + clock-names = "mclk", "npl", "fsgen"; > + > + power-domains = <&lpass_hm LPASS_CORE_CC_LPASS_CORE_HM_GDSC>, > + <&lpass_aon LPASS_AON_CC_LPASS_AUDIO_HM_GDSC>; > + power-domain-names ="macro", "dcodec"; > + > + #clock-cells = <0>; > + #sound-dai-cells = <1>; > + }; > + > + vamacro: codec@3370000 { > + compatible = "qcom,sc7280-lpass-va-macro"; > + reg = <0 0x03370000 0 0x1000>; > + > + status = "disabled"; > + pinctrl-0 = <&dmic01_active>; > + pinctrl-names = "default"; > + > + clocks = <&lpass_aon LPASS_AON_CC_TX_MCLK_CLK>; > + clock-names = "mclk"; > + > + power-domains = <&lpass_hm LPASS_CORE_CC_LPASS_CORE_HM_GDSC>, > + <&lpass_aon LPASS_AON_CC_LPASS_AUDIO_HM_GDSC>; > + power-domain-names ="macro", "dcodec"; > + > + #clock-cells = <0>; > + #sound-dai-cells = <1>; > + }; > + > + swr0: soundwire@3210000 { > + compatible = "qcom,soundwire-v1.6.0"; > + reg = <0 0x03210000 0 0x2000>; > + > + interrupts = ; > + clocks = <&rxmacro>; > + clock-names = "iface"; > + > + qcom,din-ports = <0>; > + qcom,dout-ports = <5>; > + > + resets = <&lpass_audiocc LPASS_AUDIO_SWR_RX_CGCR>; > + reset-names = "swr_audio_cgcr"; > + > + qcom,ports-word-length = /bits/ 8 <0x01 0x07 0x04 0xff 0xff>; > + qcom,ports-sinterval-low = /bits/ 8 <0x03 0x3f 0x1f 0x03 0x03>; > + qcom,ports-offset1 = /bits/ 8 <0x00 0x00 0x0b 0x01 0x01>; > + qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x0b 0x00 0x00>; > + qcom,ports-lane-control = /bits/ 8 <0x01 0x00 0x00 0x00 0x00>; > + qcom,ports-block-pack-mode = /bits/ 8 <0xff 0x00 0x01 0xff 0xff>; > + qcom,ports-hstart = /bits/ 8 <0xff 0x03 0xff 0xff 0xff>; > + qcom,ports-hstop = /bits/ 8 <0xff 0x06 0xff 0xff 0xff>; > + qcom,ports-block-group-count = /bits/ 8 <0xff 0xff 0xff 0xff 0x00>; > + > + #sound-dai-cells = <1>; > + #address-cells = <2>; > + #size-cells = <0>; > + }; > + > + swr1: soundwire@3230000 { > + compatible = "qcom,soundwire-v1.6.0"; > + reg = <0 0x03230000 0 0x2000>; > + > + interrupts-extended = <&intc GIC_SPI 496 IRQ_TYPE_LEVEL_HIGH>, > + <&pdc 130 IRQ_TYPE_LEVEL_HIGH>; > + interrupt-names = "swr_master_irq", "swr_wake_irq"; > + clocks = <&txmacro>; > + clock-names = "iface"; > + > + qcom,din-ports = <3>; > + qcom,dout-ports = <0>; > + > + resets = <&lpass_audiocc LPASS_AUDIO_SWR_TX_CGCR>; > + reset-names = "swr_audio_cgcr"; > + > + qcom,ports-sinterval-low = /bits/ 8 <0x01 0x03 0x03>; > + qcom,ports-offset1 = /bits/ 8 <0x01 0x00 0x02>; > + qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x00>; > + qcom,ports-hstart = /bits/ 8 <0xff 0xff 0xff>; > + qcom,ports-hstop = /bits/ 8 <0xff 0xff 0xff>; > + qcom,ports-word-length = /bits/ 8 <0xff 0x0 0xff>; s/0x0/0x00/ > + qcom,ports-block-pack-mode = /bits/ 8 <0xff 0xff 0xff>; > + qcom,ports-block-group-count = /bits/ 8 <0xff 0xff 0xff>; > + qcom,ports-lane-control = /bits/ 8 <0x00 0x01 0x00>; > + qcom,port-offset = <1>; > + > + #sound-dai-cells = <1>; > + #address-cells = <2>; > + #size-cells = <0>; > + }; add empty line > ipcc: mailbox@408000 { > compatible = "qcom,sc7280-ipcc", "qcom,ipcc"; > reg = <0 0x00408000 0 0x1000>;