arm64: dts: qcom: sc7180-trogdor: Add wakeup support for BT UART
authorsatya priya <skakit@codeaurora.org>
Mon, 14 Sep 2020 13:58:36 +0000 (19:28 +0530)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 15 Sep 2020 00:15:26 +0000 (00:15 +0000)
Add the necessary pinctrl, interrupt property and a suitable sleep config
to support Bluetooth wakeup feature.

GPIO mode is configured in sleep state to drive the RTS/RFR line low.
If QUP function is selected in sleep state, UART RTS/RFR is pulled high
during suspend and BT SoC not able to send wakeup bytes.

Tested-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: satya priya <skakit@codeaurora.org>
Link: https://lore.kernel.org/r/1600091917-7464-4-git-send-email-skakit@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi

index f46d331..bf87558 100644 (file)
@@ -794,6 +794,13 @@ ap_spi_fp: &spi10 {
 &uart3 {
        status = "okay";
 
+       /delete-property/interrupts;
+       interrupts-extended = <&intc GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>,
+                               <&tlmm 41 IRQ_TYPE_EDGE_FALLING>;
+
+       pinctrl-names = "default", "sleep";
+       pinctrl-1 = <&qup_uart3_sleep>;
+
        bluetooth: bluetooth {
                compatible = "qcom,wcn3991-bt";
                vddio-supply = <&pp1800_l10a>;
@@ -1307,6 +1314,53 @@ ap_spi_fp: &spi10 {
                };
        };
 
+       qup_uart3_sleep: qup-uart3-sleep {
+               pinmux {
+                       pins = "gpio38", "gpio39",
+                              "gpio40", "gpio41";
+                       function = "gpio";
+               };
+
+               pinconf-cts {
+                       /*
+                        * Configure a pull-down on CTS to match the pull of
+                        * the Bluetooth module.
+                        */
+                       pins = "gpio38";
+                       bias-pull-down;
+               };
+
+               pinconf-rts {
+                       /*
+                        * 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).
+                        */
+                        pins = "gpio39";
+                        bias-pull-down;
+               };
+
+               pinconf-tx {
+                       /*
+                        * Configure pull-up on TX when it isn't actively driven
+                        * to prevent BT SoC from receiving garbage during sleep.
+                        */
+                       pins = "gpio40";
+                       bias-pull-up;
+               };
+
+               pinconf-rx {
+                       /*
+                        * 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.
+                        */
+                       pins = "gpio41";
+                       bias-pull-up;
+               };
+       };
+
        trackpad_int_1v8_odl: trackpad-int-1v8-odl {
                pinmux {
                        pins = "gpio58";