arm64: dts: qcom: sdm845: commonize bluetooth UART pinmux
authorCaleb Connolly <caleb@connolly.tech>
Sun, 16 Oct 2022 17:29:41 +0000 (18:29 +0100)
committerBjorn Andersson <andersson@kernel.org>
Tue, 18 Oct 2022 03:01:46 +0000 (22:01 -0500)
The 4-pin configuration for UART6 is used for all or almost all SDM845
devices with built in Bluetooth. Move the pinmux configuration to
sdm845.dtsi in preparation to be removed from individual devices in
future patches.

Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Caleb Connolly <caleb@connolly.tech>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20221016172944.1892206-2-kc@postmarketos.org
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
arch/arm64/boot/dts/qcom/sdm845-db845c.dts
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium-common.dtsi
arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts
arch/arm64/boot/dts/qcom/sdm845.dtsi

index 5eafb556cc0cd332a72c193fe15b76e558c20155..41aedb60e16de1a3842f0b2cd7f62934745ad9a4 100644 (file)
@@ -860,6 +860,8 @@ ap_ts_i2c: &i2c14 {
 &uart6 {
        status = "okay";
 
+       pinctrl-0 = <&qup_uart6_4pin>;
+
        bluetooth: wcn3990-bt {
                compatible = "qcom,wcn3990-bt";
                vddio-supply = <&src_pp1800_s4a>;
@@ -1079,41 +1081,6 @@ ap_ts_i2c: &i2c14 {
        };
 };
 
-&qup_uart6_default {
-       /* Change pinmux to all 4 pins since CTS and RTS are connected */
-       pinmux {
-               pins = "gpio45", "gpio46",
-                      "gpio47", "gpio48";
-       };
-
-       pinconf-cts {
-               /*
-                * Configure a pull-down on 45 (CTS) to match the pull of
-                * the Bluetooth module.
-                */
-               pins = "gpio45";
-               bias-pull-down;
-       };
-
-       pinconf-rts-tx {
-               /* We'll drive 46 (RTS) and 47 (TX), so no pull */
-               pins = "gpio46", "gpio47";
-               drive-strength = <2>;
-               bias-disable;
-       };
-
-       pinconf-rx {
-               /*
-                * Configure a pull-up on 48 (RX). This is needed to avoid
-                * garbage data when the TX pin of the Bluetooth module is
-                * in tri-state (module powered off or not driving the
-                * signal yet).
-                */
-               pins = "gpio48";
-               bias-pull-up;
-       };
-};
-
 &qup_uart9_default {
        pinconf-tx {
                pins = "gpio4";
index 72d26ceb4baf13046a5165b31da32e24a90dd9ab..741968ef6f31805c55f111b3e8377198fa23fe47 100644 (file)
 &uart6 {
        status = "okay";
 
+       pinctrl-0 = <&qup_uart6_4pin>;
+
        bluetooth {
                compatible = "qcom,wcn3990-bt";
 
        };
 };
 
-&qup_uart6_default {
-       pinmux {
-               pins = "gpio45", "gpio46", "gpio47", "gpio48";
-               function = "qup6";
-       };
-
-       cts {
-               pins = "gpio45";
-               bias-disable;
-       };
-
-       rts-tx {
-               pins = "gpio46", "gpio47";
-               drive-strength = <2>;
-               bias-disable;
-       };
-
-       rx {
-               pins = "gpio48";
-               bias-pull-up;
-       };
-};
-
 &qup_uart9_default {
        pinconf-tx {
                pins = "gpio4";
index 392461c29e76ea724b113584536c79e28d53f550..02ec0fa4e5f08f8a90e44eba869cd90105f59765 100644 (file)
        };
 };
 
-/*
- * Prevent garbage data on bluetooth UART lines
- */
-&qup_uart6_default {
-       pinmux {
-               pins = "gpio45", "gpio46", "gpio47", "gpio48";
-               function = "qup6";
-       };
-
-       cts {
-               pins = "gpio45";
-               bias-pull-down;
-       };
-
-       rts-tx {
-               pins = "gpio46", "gpio47";
-               drive-strength = <2>;
-               bias-disable;
-       };
-
-       rx {
-               pins = "gpio48";
-               bias-pull-up;
-       };
-};
-
 &uart6 {
        status = "okay";
 
+       pinctrl-0 = <&qup_uart6_4pin>;
+
        bluetooth {
                compatible = "qcom,wcn3990-bt";
 
index 163bf9c1a1d812454f1f17cf478a81bb12d9830f..bcd8e7a97f1ec686583ed670da62c1a82de9999a 100644 (file)
 &uart6 {
        status = "okay";
 
+       pinctrl-0 = <&qup_uart6_4pin>;
+
        bluetooth {
                compatible = "qcom,wcn3990-bt";
 
        vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
        vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
 };
-
-/* PINCTRL - additions to nodes defined in sdm845.dtsi */
-
-&qup_uart6_default {
-       pinmux {
-               pins = "gpio45", "gpio46", "gpio47", "gpio48";
-               function = "qup6";
-       };
-
-       cts {
-               pins = "gpio45";
-               bias-disable;
-       };
-
-       rts-tx {
-               pins = "gpio46", "gpio47";
-               drive-strength = <2>;
-               bias-disable;
-       };
-
-       rx {
-               pins = "gpio48";
-               bias-pull-up;
-       };
-};
index 4081822e0686c4ac14f606b974c17f207952a125..fc189f7caaa4bbda4ce6c5c76e83bb609d884e4e 100644 (file)
 &uart6 {
        status = "okay";
 
+       pinctrl-0 = <&qup_uart6_4pin>;
+
        bluetooth {
                compatible = "qcom,wcn3990-bt";
 
        qcom,snoc-host-cap-skip-quirk;
        status = "okay";
 };
-
-/* PINCTRL - additions to nodes defined in sdm845.dtsi */
-
-&qup_uart6_default {
-       pinmux {
-                pins = "gpio45", "gpio46", "gpio47", "gpio48";
-                function = "qup6";
-       };
-
-       cts {
-               pins = "gpio45";
-               bias-disable;
-       };
-
-       rts-tx {
-               pins = "gpio46", "gpio47";
-               drive-strength = <2>;
-               bias-disable;
-       };
-
-       rx {
-               pins = "gpio48";
-               bias-pull-up;
-       };
-};
index 5f867b1a2df0f2096bfa380b3c07457f5b865d27..1a257f672887496514d49b3b4311e7fd0a45ebf1 100644 (file)
                                };
                        };
 
+                       qup_uart6_4pin: qup-uart6-4pin-state {
+
+                               cts-pins {
+                                       pins = "gpio45";
+                                       function = "qup6";
+                                       bias-pull-down;
+                               };
+
+                               rts-tx-pins {
+                                       pins = "gpio46", "gpio47";
+                                       function = "qup6";
+                                       drive-strength = <2>;
+                                       bias-disable;
+                               };
+
+                               rx-pins {
+                                       pins = "gpio48";
+                                       function = "qup6";
+                                       bias-pull-up;
+                               };
+                       };
+
                        qup_uart7_default: qup-uart7-default {
                                pinmux {
                                        pins = "gpio95", "gpio96";