Configure the required regulators for Bluetooth and enable it on the
Xperia 10 III.

Signed-off-by: erebion <[email protected]>
---
 .../dts/qcom/sm6350-sony-xperia-lena-pdx213.dts    | 109 +++++++++++++++++++++
 1 file changed, 109 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts 
b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
index f3ed6445c7d35..9be0e7ceccb55 100644
--- a/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
+++ b/arch/arm64/boot/dts/qcom/sm6350-sony-xperia-lena-pdx213.dts
@@ -19,6 +19,10 @@ / {
        qcom,msm-id = <434 0x10000>, <459 0x10000>;
        qcom,board-id = <0x1000b 0>;
 
+       aliases {
+               serial1 = &uart1;
+       };
+
        chosen {
                #address-cells = <2>;
                #size-cells = <2>;
@@ -381,6 +385,44 @@ &qupv3_id_1 {
        status = "okay";
 };
 
+/* UART1: HS UART for Bluetooth */
+&qup_uart1_cts {
+       /*
+        * Configure a bias-bus-hold on CTS to lower power
+        * usage when Bluetooth is turned off. Bus hold will
+        * maintain a low power state regardless of whether
+        * the Bluetooth module drives the pin in either
+        * direction or leaves the pin fully unpowered.
+        */
+       /delete-property/ bias-disable;
+       bias-bus-hold;
+};
+
+&qup_uart1_rts {
+       /* We'll drive RTS, so no pull */
+       drive-strength = <2>;
+       /delete-property/ bias-pull-down;
+       bias-disable;
+};
+
+&qup_uart1_rx {
+       /*
+        * Configure a pull-up on 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).
+        */
+       /delete-property/ bias-disable;
+       bias-pull-up;
+};
+
+&qup_uart1_tx {
+       /* We'll drive TX, so no pull */
+       drive-strength = <2>;
+       /delete-property/ bias-pull-up;
+       bias-disable;
+};
+
 &sdc2_off_state {
        sd-cd-pins {
                pins = "gpio94";
@@ -424,6 +466,73 @@ ts_int_default: ts-int-default-state {
                drive-strength = <2>;
                bias-disable;
        };
+
+       qup_uart1_sleep_cts: qup-uart1-sleep-cts-state {
+               pins = "gpio61";
+               function = "gpio";
+               /*
+                * Configure a bias-bus-hold on CTS to lower power
+                * usage when Bluetooth is turned off. Bus hold will
+                * maintain a low power state regardless of whether
+                * the Bluetooth module drives the pin in either
+                * direction or leaves the pin fully unpowered.
+                */
+               bias-bus-hold;
+       };
+
+       qup_uart1_sleep_rts: qup-uart1-sleep-rts-state {
+               pins = "gpio62";
+               function = "gpio";
+               /*
+                * Configure pull-down on RTS. As RTS is active low
+                * signal, pull it low to indicate the BT SoC that it
+                * can wakeup the system anytime from suspend state by
+                * pulling RX low (by sending wakeup bytes).
+                */
+               bias-pull-down;
+       };
+
+       qup_uart1_sleep_rx: qup-uart1-sleep-rx-state {
+               pins = "gpio64";
+               function = "gpio";
+               /*
+                * Configure a pull-up on RX. This is needed to avoid
+                * garbage data when the TX pin of the Bluetooth module
+                * is floating which may cause spurious wakeups.
+                */
+               bias-pull-up;
+       };
+
+       qup_uart1_sleep_tx: qup-uart1-sleep-tx-state {
+               pins = "gpio63";
+               function = "gpio";
+               /*
+                * Configure pull-up on TX when it isn't actively driven
+                * to prevent BT SoC from receiving garbage during sleep.
+                */
+               bias-pull-up;
+       };
+};
+
+&uart1 {
+       /delete-property/ interrupts;
+       interrupts-extended = <&intc GIC_SPI 602 IRQ_TYPE_LEVEL_HIGH>,
+                            <&tlmm 64 IRQ_TYPE_EDGE_FALLING>;
+
+       pinctrl-names = "default", "sleep";
+       pinctrl-1 = <&qup_uart1_sleep_cts>, <&qup_uart1_sleep_rts>, 
<&qup_uart1_sleep_tx>, <&qup_uart1_sleep_rx>;
+
+       status = "okay";
+
+       bluetooth {
+               compatible = "qcom,wcn3991-bt";
+               vddio-supply = <&pm6350_l11>;
+               vddxo-supply = <&pm6350_l7>;
+               vddrf-supply = <&pm6150l_l2>;
+               vddch0-supply = <&pm6150l_l10>;
+               swctrl-gpios = <&tlmm 69 GPIO_ACTIVE_HIGH>;
+               firmware-name = "crnv32u.bin";
+       };
 };
 
 &usb_1 {

-- 
2.53.0

Reply via email to