From patchwork Fri Apr 29 10:27:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Balakrishna Godavarthi \(QUIC\)" X-Patchwork-Id: 568796 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1E0FC433F5 for ; Fri, 29 Apr 2022 11:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358438AbiD2LeD (ORCPT ); Fri, 29 Apr 2022 07:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358435AbiD2Lds (ORCPT ); Fri, 29 Apr 2022 07:33:48 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98F5449247; Fri, 29 Apr 2022 04:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651231830; x=1682767830; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ozc1nAJKzhIpDHlfaNRXWXWHk5wj+THsga8WcVzOCHw=; b=pzUiyXKeVZhOccUdMs4lxB+MIWIeGZXV6Q9ATQBjkbOikEI4Pu/Aruga 4I1RIUvEZFoWSkowXtcDJ21sYuml3jd5At2nw+bSIffuB72IQuFgY61L0 d5qv2aPFQNF9kMJar4iOulYBsTJ5gGYRuleS3putx3+LYJ83j81sMrdim E=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 29 Apr 2022 04:30:30 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 04:30:28 -0700 Received: from bgodavar-linux.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 29 Apr 2022 04:30:23 -0700 From: Balakrishna Godavarthi To: , , , , , , , CC: , , , , , , Balakrishna Godavarthi Subject: [PATCH v1 1/3] dt-bindings: net: bluetooth: Add wlan-gpio entry for wcn6750 Date: Fri, 29 Apr 2022 15:57:51 +0530 Message-ID: <1651228073-1999-2-git-send-email-quic_bgodavar@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1651228073-1999-1-git-send-email-quic_bgodavar@quicinc.com> References: <1651228073-1999-1-git-send-email-quic_bgodavar@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch adds a wlan-gpio entry and its reference usage for BT SoC wcn6750. Signed-off-by: Sai Teja Aluvala Signed-off-by: Balakrishna Godavarthi --- Documentation/devicetree/bindings/net/qualcomm-bluetooth.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/net/qualcomm-bluetooth.yaml b/Documentation/devicetree/bindings/net/qualcomm-bluetooth.yaml index f93c6e7..624f957 100644 --- a/Documentation/devicetree/bindings/net/qualcomm-bluetooth.yaml +++ b/Documentation/devicetree/bindings/net/qualcomm-bluetooth.yaml @@ -24,6 +24,10 @@ properties: - qcom,qca6390-bt - qcom,wcn6750-bt + wlan-gpios: + maxItems: 1 + description: gpio specifier used to wlan chip + enable-gpios: maxItems: 1 description: gpio specifier used to enable chip @@ -123,6 +127,7 @@ allOf: - qcom,wcn6750-bt then: required: + - wlan-gpios - enable-gpios - swctrl-gpios - vddio-supply @@ -166,6 +171,7 @@ examples: compatible = "qcom,wcn6750-bt"; pinctrl-names = "default"; pinctrl-0 = <&bt_en_default>; + wlan-gpios = <&tlmm 84 GPIO_ACTIVE_HIGH>; enable-gpios = <&tlmm 85 GPIO_ACTIVE_HIGH>; swctrl-gpios = <&tlmm 86 GPIO_ACTIVE_HIGH>; vddio-supply = <&vreg_l19b_1p8>; From patchwork Fri Apr 29 10:27:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Balakrishna Godavarthi \(QUIC\)" X-Patchwork-Id: 567578 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED1DFC4332F for ; Fri, 29 Apr 2022 11:30:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358451AbiD2LeE (ORCPT ); Fri, 29 Apr 2022 07:34:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358442AbiD2Ldw (ORCPT ); Fri, 29 Apr 2022 07:33:52 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 700A74969C; Fri, 29 Apr 2022 04:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651231833; x=1682767833; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Hg0uCg94FoPp6VeLHVBX2DwzaPDmymWHaQWVzyJfGqc=; b=xnCJEmJ3N5zfLep2m8gAWXk7UAPO7Ju80F8g7Skpsh8sgCQF7bl239g2 9rAyH/x0dma3tV5/YC8kvJHeQsD7oo8FaDlT/98wxAbQdHV+SGaPbjXxJ xzDl+oxmJMlcI6loT74oMGxtYqikdPkYWu0OEyhciu0nJSXHVXRhfdmhG g=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 29 Apr 2022 04:30:33 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 04:30:32 -0700 Received: from bgodavar-linux.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 29 Apr 2022 04:30:28 -0700 From: Balakrishna Godavarthi To: , , , , , , , CC: , , , , , , Balakrishna Godavarthi Subject: [PATCH v1 2/3] arm64: dts: qcom: sc7280: Add wlan enable gpio to bluetooth node Date: Fri, 29 Apr 2022 15:57:52 +0530 Message-ID: <1651228073-1999-3-git-send-email-quic_bgodavar@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1651228073-1999-1-git-send-email-quic_bgodavar@quicinc.com> References: <1651228073-1999-1-git-send-email-quic_bgodavar@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add wlan_enable gpio details in bluetooth node, As wlan enable gpio status is required to enable bt. Signed-off-by: Sai Teja Aluvala Signed-off-by: Balakrishna Godavarthi --- arch/arm64/boot/dts/qcom/sc7280-idp.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi index ecbf2b8..c556e8a 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-idp.dtsi @@ -341,6 +341,7 @@ pinctrl-0 = <&bt_en>, <&sw_ctrl>; enable-gpios = <&tlmm 85 GPIO_ACTIVE_HIGH>; swctrl-gpios = <&tlmm 86 GPIO_ACTIVE_HIGH>; + wlan-gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>; vddaon-supply = <&vreg_s7b_0p9>; vddbtcxmx-supply = <&vreg_s7b_0p9>; vddrfacmn-supply = <&vreg_s7b_0p9>; From patchwork Fri Apr 29 10:27:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Balakrishna Godavarthi \(QUIC\)" X-Patchwork-Id: 568795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4A74C43217 for ; Fri, 29 Apr 2022 11:30:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358464AbiD2LeF (ORCPT ); Fri, 29 Apr 2022 07:34:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358477AbiD2Ld5 (ORCPT ); Fri, 29 Apr 2022 07:33:57 -0400 Received: from alexa-out-sd-02.qualcomm.com (alexa-out-sd-02.qualcomm.com [199.106.114.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF2B149F14; Fri, 29 Apr 2022 04:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1651231840; x=1682767840; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=4CK1W0a9kn9jaFNkX6JJAfWkAorqu+bWucmc9AijetY=; b=n9/AfdO0OH/EVJX0yVrhMn6C/cLnkHxQ00xA+MdTig10Uizdtu3Nzn8J 6ZCvXugi2QjuC5mOiOqGxLRG+JDyd+Cg38QyII9ODB1xHr8Rf3T4ufa8Y iV9IeT7Mg2sVKy4e9czVAElGqO4II5aHlhcji4pEqDgIlqY+/J2wFuotB k=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 29 Apr 2022 04:30:37 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2022 04:30:37 -0700 Received: from bgodavar-linux.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 29 Apr 2022 04:30:33 -0700 From: Balakrishna Godavarthi To: , , , , , , , CC: , , , , , , Balakrishna Godavarthi Subject: [PATCH v1 3/3] Bluetooth: hci_qca: WAR to handle WCN6750 HW issue Date: Fri, 29 Apr 2022 15:57:53 +0530 Message-ID: <1651228073-1999-4-git-send-email-quic_bgodavar@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1651228073-1999-1-git-send-email-quic_bgodavar@quicinc.com> References: <1651228073-1999-1-git-send-email-quic_bgodavar@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org The patch is workaround for hardware issue on WCN6750. On WCN6750 sometimes observed AON power source takes 100ms time to fully discharge voltage during OFF. As WCN6750 is combo chip for WLAN and BT. If any of the tech area ON is triggered during discharge phase, it fails to turn ON. To overcome this hardware issue, During BT ON, driver check for WLAN_EN pin status. If it high, it will pull BT_EN to high immediately else it will wait for 100ms assuming WLAN was just powered OFF and then BT_EN will be pulled to high. Fixes: d8f97da1b92d2 ("Bluetooth: hci_qca: Add support for QTI Bluetooth chip wcn6750") Reviewed-by: Miao-chen Chou Signed-off-by: Sai Teja Aluvala Signed-off-by: Balakrishna Godavarthi --- drivers/bluetooth/hci_qca.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index eab34e2..c3862d1 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -219,6 +219,7 @@ struct qca_serdev { struct hci_uart serdev_hu; struct gpio_desc *bt_en; struct gpio_desc *sw_ctrl; + struct gpio_desc *wlan_en; struct clk *susclk; enum qca_btsoc_type btsoc_type; struct qca_power *bt_power; @@ -1627,12 +1628,25 @@ static int qca_regulator_init(struct hci_uart *hu) if (qcadev->bt_en) { gpiod_set_value_cansleep(qcadev->bt_en, 0); msleep(50); + } + + if (!qcadev->wlan_en || (qcadev->wlan_en && gpiod_get_value_cansleep(qcadev->wlan_en))) + gpiod_set_value_cansleep(qcadev->bt_en, 1); + + if (qcadev->wlan_en && !gpiod_get_value_cansleep(qcadev->wlan_en)) { + gpiod_set_value_cansleep(qcadev->bt_en, 0); + msleep(100); gpiod_set_value_cansleep(qcadev->bt_en, 1); - msleep(50); - if (qcadev->sw_ctrl) { - sw_ctrl_state = gpiod_get_value_cansleep(qcadev->sw_ctrl); - bt_dev_dbg(hu->hdev, "SW_CTRL is %d", sw_ctrl_state); - } + } + + if (!gpiod_get_value_cansleep(qcadev->bt_en)) + gpiod_set_value_cansleep(qcadev->bt_en, 1); + + msleep(50); + + if (qcadev->sw_ctrl) { + sw_ctrl_state = gpiod_get_value_cansleep(qcadev->sw_ctrl); + bt_dev_dbg(hu->hdev, "SW_CTRL is %d", sw_ctrl_state); } qca_set_speed(hu, QCA_INIT_SPEED); @@ -1906,8 +1920,8 @@ static void qca_power_shutdown(struct hci_uart *hu) qca_regulator_disable(qcadev); } else if (soc_type == QCA_WCN6750) { gpiod_set_value_cansleep(qcadev->bt_en, 0); - msleep(100); qca_regulator_disable(qcadev); + msleep(100); if (qcadev->sw_ctrl) { sw_ctrl_state = gpiod_get_value_cansleep(qcadev->sw_ctrl); bt_dev_dbg(hu->hdev, "SW_CTRL is %d", sw_ctrl_state); @@ -2057,6 +2071,10 @@ static int qca_serdev_probe(struct serdev_device *serdev) qcadev->bt_power->vregs_on = false; + qcadev->wlan_en = devm_gpiod_get_optional(&serdev->dev, "wlan", GPIOD_ASIS); + if (!qcadev->wlan_en && data->soc_type == QCA_WCN6750) + dev_err(&serdev->dev, "failed to acquire WL_EN gpio"); + qcadev->bt_en = devm_gpiod_get_optional(&serdev->dev, "enable", GPIOD_OUT_LOW); if (IS_ERR_OR_NULL(qcadev->bt_en) && data->soc_type == QCA_WCN6750) {