Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2193606pxk; Mon, 14 Sep 2020 07:09:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/YtpkZc12O3K14xIaU9zA9+SnvgJ/uCGFYbYrJUAksJ54dc/r9NaXTF9HrNdxylgfYp1F X-Received: by 2002:a17:906:b43:: with SMTP id v3mr14626029ejg.383.1600092551114; Mon, 14 Sep 2020 07:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600092551; cv=none; d=google.com; s=arc-20160816; b=paDBjDpj51JZfPDUEl4vOQisf1O/P1B/pJ0GoI5vCL9b1hqur5zNngK+DYKuh+mVYH KLblsQH/Xk5PhgX8oa8TGsdW97r4Ft3Cdqz0EH/rIy3FryAp28omWXfcIyjCOpQzvzlH IsRwTqoYFnLo9YBprKJMMvWkqnKWeicQyNlLGujjym8v4VmyHbkbouvexd2/lNiWMabh GPZMRsfvx3j1aNdawCYZDPwxbBl18nYleZ/syGGaK3SNm9ZeT01u5MMPcLXY7vTa7Iol wRwmrEw+c/W5OC+7Yq3PUjW6t222k7cIPPiaWNJpsDow6F+yn4V9f6pLcA55n0pgQLCx 739A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=VtTfQi5dZIVLRrpga3RBHZ53Xvrke5UTUvM+QGD/c7I=; b=Qyb5XtY2AzeyhhXJuejn9uk81PIMxXPX3MIoLGzZ2I+rcePbbWO5rl2r509fsqjzkD GA2TnOxFa5+h5CDRqiTJuVWMQHOCLe0iNE5og1a9CREIR8QCiB/jLJkdYwqRzqCqiWGV Z9Ak4QRqoYvaqjtvAP4hqQNfKXQF8Y+tR/+FeRwvMiknftdpRBA9SDT0HVCAETOJCDSm 766L3lT03VBWKfUJV1xL5NDWeA5iILXp/plS+h4PhSJ2QIlbFaAvgrcFWrmdqL9vM0ST NjnTdr7vKu5wN1TMOMVdw36wom0B1L4PNFqDkiCN+b9Bm9tk6fRoI7kwb9PJxHuFijAn 2AFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kt18si6964069ejb.338.2020.09.14.07.08.47; Mon, 14 Sep 2020 07:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726845AbgINOIB (ORCPT + 99 others); Mon, 14 Sep 2020 10:08:01 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:26334 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726790AbgINN7Z (ORCPT ); Mon, 14 Sep 2020 09:59:25 -0400 Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 14 Sep 2020 06:59:25 -0700 Received: from ironmsg02-blr.qualcomm.com ([10.86.208.131]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/AES256-SHA; 14 Sep 2020 06:59:23 -0700 Received: from c-skakit-linux.ap.qualcomm.com (HELO c-skakit-linux.qualcomm.com) ([10.242.51.242]) by ironmsg02-blr.qualcomm.com with ESMTP; 14 Sep 2020 19:28:55 +0530 Received: by c-skakit-linux.qualcomm.com (Postfix, from userid 2344709) id 2054644CE; Mon, 14 Sep 2020 19:28:54 +0530 (IST) From: satya priya To: Bjorn Andersson Cc: Matthias Kaehlcke , gregkh@linuxfoundation.org, Andy Gross , Rob Herring , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, akashast@codeaurora.org, rojay@codeaurora.org, msavaliy@qti.qualcomm.com, dianders@chromium.org, satya priya Subject: [PATCH V6 2/4] arm64: dts: qcom: sc7180: Add wakeup support for BT UART on sc7180-idp Date: Mon, 14 Sep 2020 19:28:35 +0530 Message-Id: <1600091917-7464-3-git-send-email-skakit@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600091917-7464-1-git-send-email-skakit@codeaurora.org> References: <1600091917-7464-1-git-send-email-skakit@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: satya priya --- Changes in V2: - This patch adds sleep state for BT UART. Newly added in V2. Changes in V3: - Remove "output-high" for TX from both sleep and default states as it is not required. Configure pull-up for TX in sleep state. Changes in V4: - As per Matthias's comment, removed drive-strength for sleep state and fixed nit-pick. Changes in V5: - As per Matthias's comments, moved pinmux change for sleep state, pinctrl and interrupt config to the board specific file. Changes in V6: - As per Doug's comments changed subject, deleted interrupts property. - As per Bjorn's comments changed commit text and rationale for RTS, TX and RX. arch/arm64/boot/dts/qcom/sc7180-idp.dts | 55 +++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sc7180-idp.dts b/arch/arm64/boot/dts/qcom/sc7180-idp.dts index 04888df..e416409 100644 --- a/arch/arm64/boot/dts/qcom/sc7180-idp.dts +++ b/arch/arm64/boot/dts/qcom/sc7180-idp.dts @@ -346,6 +346,13 @@ &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: wcn3990-bt { compatible = "qcom,wcn3990-bt"; vddio-supply = <&vreg_l10a_1p8>; @@ -545,3 +552,51 @@ }; }; +&tlmm { + 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; + }; + }; +}; -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation