OSDN Git Service

arm64: dts: qcom: sm8250: Add nodes for tx and rx macros with soundwire masters
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Wed, 6 Oct 2021 16:47:09 +0000 (17:47 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Thu, 18 Nov 2021 00:55:55 +0000 (18:55 -0600)
SM8250 has TX and RX macros with SoundWire Controllers to attach with
codecs like WCD938x. Add these nodes for sm8250 mtp audio use case.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211006164712.16078-2-srinivas.kandagatla@linaro.org
arch/arm64/boot/dts/qcom/sm8250.dtsi

index 6f6129b..c46c35a 100644 (file)
                        #sound-dai-cells = <1>;
                };
 
+               rxmacro: rxmacro@3200000 {
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&rx_swr_active>;
+                       compatible = "qcom,sm8250-lpass-rx-macro";
+                       reg = <0 0x3200000 0 0x1000>;
+
+                       clocks = <&q6afecc LPASS_CLK_ID_TX_CORE_MCLK LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+                               <&q6afecc LPASS_CLK_ID_TX_CORE_NPL_MCLK  LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+                               <&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+                               <&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+                               <&vamacro>;
+
+                       clock-names = "mclk", "npl", "macro", "dcodec", "fsgen";
+
+                       #clock-cells = <0>;
+                       clock-frequency = <9600000>;
+                       clock-output-names = "mclk";
+                       #sound-dai-cells = <1>;
+               };
+
+               swr1: soundwire-controller@3210000 {
+                       reg = <0 0x3210000 0 0x2000>;
+                       compatible = "qcom,soundwire-v1.5.1";
+                       interrupts = <GIC_SPI 298 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&rxmacro>;
+                       clock-names = "iface";
+                       label = "RX";
+                       qcom,din-ports = <0>;
+                       qcom,dout-ports = <5>;
+
+                       qcom,ports-sinterval-low =      /bits/ 8 <0x03 0x1F 0x1F 0x07 0x00>;
+                       qcom,ports-offset1 =            /bits/ 8 <0x00 0x00 0x0B 0x01 0x00>;
+                       qcom,ports-offset2 =            /bits/ 8 <0x00 0x00 0x0B 0x00 0x00>;
+                       qcom,ports-hstart =             /bits/ 8 <0xFF 0x03 0xFF 0xFF 0xFF>;
+                       qcom,ports-hstop =              /bits/ 8 <0xFF 0x06 0xFF 0xFF 0xFF>;
+                       qcom,ports-word-length =        /bits/ 8 <0x01 0x07 0x04 0xFF 0xFF>;
+                       qcom,ports-block-pack-mode =    /bits/ 8 <0xFF 0x00 0x01 0xFF 0xFF>;
+                       qcom,ports-lane-control =       /bits/ 8 <0x01 0x00 0x00 0x00 0x00>;
+                       qcom,ports-block-group-count =  /bits/ 8 <0xFF 0xFF 0xFF 0xFF 0x00>;
+
+                       #sound-dai-cells = <1>;
+                       #address-cells = <2>;
+                       #size-cells = <0>;
+               };
+
+               txmacro: txmacro@3220000 {
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&tx_swr_active>;
+                       compatible = "qcom,sm8250-lpass-tx-macro";
+                       reg = <0 0x3220000 0 0x1000>;
+
+                       clocks = <&q6afecc LPASS_CLK_ID_TX_CORE_MCLK LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+                                <&q6afecc LPASS_CLK_ID_TX_CORE_NPL_MCLK  LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+                                <&q6afecc LPASS_HW_MACRO_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+                                <&q6afecc LPASS_HW_DCODEC_VOTE LPASS_CLK_ATTRIBUTE_COUPLE_NO>,
+                                <&vamacro>;
+
+                       clock-names = "mclk", "npl", "macro", "dcodec", "fsgen";
+
+                       #clock-cells = <0>;
+                       clock-frequency = <9600000>;
+                       clock-output-names = "mclk";
+                       #address-cells = <2>;
+                       #size-cells = <2>;
+                       #sound-dai-cells = <1>;
+               };
+
+               /* tx macro */
+               swr2: soundwire-controller@3230000 {
+                       reg = <0 0x3230000 0 0x2000>;
+                       compatible = "qcom,soundwire-v1.5.1";
+                       interrupts-extended = <&intc GIC_SPI 297 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "core";
+
+                       clocks = <&txmacro>;
+                       clock-names = "iface";
+                       label = "TX";
+
+                       qcom,din-ports = <5>;
+                       qcom,dout-ports = <0>;
+                       qcom,ports-sinterval-low =      /bits/ 8 <0xFF 0x01 0x01 0x03 0x03>;
+                       qcom,ports-offset1 =            /bits/ 8 <0xFF 0x01 0x00 0x02 0x00>;
+                       qcom,ports-offset2 =            /bits/ 8 <0xFF 0x00 0x00 0x00 0x00>;
+                       qcom,ports-block-pack-mode =    /bits/ 8 <0xFF 0xFF 0xFF 0xFF 0xFF>;
+                       qcom,ports-hstart =             /bits/ 8 <0xFF 0xFF 0xFF 0xFF 0xFF>;
+                       qcom,ports-hstop =              /bits/ 8 <0xFF 0xFF 0xFF 0xFF 0xFF>;
+                       qcom,ports-word-length =        /bits/ 8 <0xFF 0xFF 0xFF 0xFF 0xFF>;
+                       qcom,ports-block-group-count =  /bits/ 8 <0xFF 0xFF 0xFF 0xFF 0xFF>;
+                       qcom,ports-lane-control =       /bits/ 8 <0xFF 0x00 0x01 0x00 0x01>;
+                       qcom,port-offset = <1>;
+                       #sound-dai-cells = <1>;
+                       #address-cells = <2>;
+                       #size-cells = <0>;
+               };
+
                aoncc: clock-controller@3380000 {
                        compatible = "qcom,sm8250-lpass-aoncc";
                        reg = <0 0x03380000 0 0x40000>;
                                        input-enable;
                                };
                        };
+
+                       rx_swr_active: rx_swr-active-pins {
+                               clk {
+                                       pins = "gpio3";
+                                       function = "swr_rx_clk";
+                                       drive-strength = <2>;
+                                       slew-rate = <1>;
+                                       bias-disable;
+                               };
+
+                               data {
+                                       pins = "gpio4", "gpio5";
+                                       function = "swr_rx_data";
+                                       drive-strength = <2>;
+                                       slew-rate = <1>;
+                                       bias-bus-hold;
+                               };
+                       };
+
+                       tx_swr_active: tx_swr-active-pins {
+                               clk {
+                                       pins = "gpio0";
+                                       function = "swr_tx_clk";
+                                       drive-strength = <2>;
+                                       slew-rate = <1>;
+                                       bias-disable;
+                               };
+
+                               data {
+                                       pins = "gpio1", "gpio2";
+                                       function = "swr_tx_data";
+                                       drive-strength = <2>;
+                                       slew-rate = <1>;
+                                       bias-bus-hold;
+                               };
+                       };
+
+                       tx_swr_sleep: tx_swr-sleep-pins {
+                               clk {
+                                       pins = "gpio0";
+                                       function = "swr_tx_clk";
+                                       drive-strength = <2>;
+                                       input-enable;
+                                       bias-pull-down;
+                               };
+
+                               data1 {
+                                       pins = "gpio1";
+                                       function = "swr_tx_data";
+                                       drive-strength = <2>;
+                                       input-enable;
+                                       bias-bus-hold;
+                               };
+
+                               data2 {
+                                       pins = "gpio2";
+                                       function = "swr_tx_data";
+                                       drive-strength = <2>;
+                                       input-enable;
+                                       bias-pull-down;
+                               };
+                       };
                };
 
                gpu: gpu@3d00000 {