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 5eafb55..41aedb6 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 72d26ce..741968e 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 392461c..02ec0fa 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 163bf9c..bcd8e7a 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 4081822..fc189f7 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 5f867b1..1a257f6 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";