From patchwork Thu Jun 30 12:45:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hakan Jansson X-Patchwork-Id: 586160 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 AE086C433EF for ; Thu, 30 Jun 2022 12:46:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234989AbiF3MqL (ORCPT ); Thu, 30 Jun 2022 08:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234866AbiF3MqK (ORCPT ); Thu, 30 Jun 2022 08:46:10 -0400 Received: from smtp11.infineon.com (smtp11.infineon.com [IPv6:2a00:18f0:1e00:4::5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7532722508; Thu, 30 Jun 2022 05:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1656593170; x=1688129170; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=67vzM6SR05ZdBlDwgz1V5O8K+EJDsuVgPxu1GJpnSoI=; b=bAPjonGKif1+RD9eVxkzeh7qJQS7PhkKw7tCZRgaVEhjEgaFbMHkF7is vWjB1mjv+C3UzI/RJU/XEvTerMWwCBn9ttKNNF81EaB5OZm8DC6eZ0ZGG 0kazukCf8ophWWs4Ct12SyGfyg8bwuOWUQbTgtYT+gqJ+sohSmGsoqDgC M=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="304013064" X-IronPort-AV: E=Sophos;i="5.92,234,1650924000"; d="scan'208";a="304013064" Received: from unknown (HELO mucxv001.muc.infineon.com) ([172.23.11.16]) by smtp11.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:46:08 +0200 Received: from MUCSE814.infineon.com (MUCSE814.infineon.com [172.23.29.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv001.muc.infineon.com (Postfix) with ESMTPS; Thu, 30 Jun 2022 14:46:07 +0200 (CEST) Received: from MUCSE807.infineon.com (172.23.29.33) by MUCSE814.infineon.com (172.23.29.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:46:07 +0200 Received: from ISCNPF0RJXQS.infineon.com (172.23.8.247) by MUCSE807.infineon.com (172.23.29.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:46:05 +0200 From: Hakan Jansson CC: Hakan Jansson , Krzysztof Kozlowski , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , Rob Herring , "Krzysztof Kozlowski" , Linus Walleij , , , , Marcel Holtmann , Johan Hedberg , "Luiz Augusto von Dentz" , Subject: [PATCH v2 1/5] dt-bindings: net: broadcom-bluetooth: Add CYW55572 DT binding Date: Thu, 30 Jun 2022 14:45:20 +0200 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [172.23.8.247] X-ClientProxiedBy: MUCSE824.infineon.com (172.23.29.55) To MUCSE807.infineon.com (172.23.29.33) To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org CYW55572 is a Wi-Fi + Bluetooth combo device from Infineon. Extend the binding with its DT compatible. Signed-off-by: Hakan Jansson Acked-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij --- V1 -> V2: - No changes, submitted as part of updated patch series Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml index df59575840fe..71fe9b17f8f1 100644 --- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml +++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml @@ -24,6 +24,7 @@ properties: - brcm,bcm43540-bt - brcm,bcm4335a0 - brcm,bcm4349-bt + - infineon,cyw55572-bt shutdown-gpios: maxItems: 1 From patchwork Thu Jun 30 12:45:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hakan Jansson X-Patchwork-Id: 586653 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 A432ECCA47B for ; Thu, 30 Jun 2022 12:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235033AbiF3MqO (ORCPT ); Thu, 30 Jun 2022 08:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234998AbiF3MqM (ORCPT ); Thu, 30 Jun 2022 08:46:12 -0400 Received: from smtp2.infineon.com (smtp2.infineon.com [IPv6:2a00:18f0:1e00:4::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E9621E26; Thu, 30 Jun 2022 05:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1656593172; x=1688129172; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Q8OrJ+LOdUykP7MlWQfd+NOw8NB6lS2i1yFMvfCNmJI=; b=h46BYjhsaV8ZMDYiQAA3veO0Fq59TEnS9abLguwthMHfm+7GoI2+IMz5 ++RsS7XDoK5kh6DCsFJoHG/0noJ1T2IjYcCihAsIqrQ6STXiWFiSYQUc3 UZY4ZJH60ga44bSlVqtAJwBicwh1vj28rx8qm4MWBBEQ7zBS4ch27Hd+O o=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="186455684" X-IronPort-AV: E=Sophos;i="5.92,234,1650924000"; d="scan'208";a="186455684" Received: from unknown (HELO mucxv003.muc.infineon.com) ([172.23.11.20]) by smtp2.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:46:09 +0200 Received: from MUCSE812.infineon.com (MUCSE812.infineon.com [172.23.29.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv003.muc.infineon.com (Postfix) with ESMTPS; Thu, 30 Jun 2022 14:46:09 +0200 (CEST) Received: from MUCSE807.infineon.com (172.23.29.33) by MUCSE812.infineon.com (172.23.29.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:46:09 +0200 Received: from ISCNPF0RJXQS.infineon.com (172.23.8.247) by MUCSE807.infineon.com (172.23.29.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:46:07 +0200 From: Hakan Jansson CC: Hakan Jansson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Linus Walleij , , , , Marcel Holtmann , Johan Hedberg , "Luiz Augusto von Dentz" , Subject: [PATCH v2 2/5] dt-bindings: net: broadcom-bluetooth: Add conditional constraints Date: Thu, 30 Jun 2022 14:45:21 +0200 Message-ID: <3591c206eeccdacb8b4e702494d799792b752661.1656583541.git.hakan.jansson@infineon.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [172.23.8.247] X-ClientProxiedBy: MUCSE824.infineon.com (172.23.29.55) To MUCSE807.infineon.com (172.23.29.33) To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add conditional constraint to make property "reset-gpios" available only for compatible devices acually having the reset pin. Make property "brcm,requires-autobaud-mode" depend on property "shutdown-gpios" as the shutdown pin is required to enter autobaud mode. I looked at all compatible devices and compiled the matrix below before formulating the conditional constraint. This was a pure paper exercise and no verification testing has been performed. d e v h i o c s s e t h - - u w w v t r a a v d d e k k b d o s e e a i w e u u t o n t p p - - - - - - s s g g g g u u p p p p t p p i i i i x l p p o o o o c p l l s s s s o o y y --------------------------------------- brcm,bcm20702a1 X X X X X X X X brcm,bcm4329-bt X X X X X X X X brcm,bcm4330-bt X X X X X X X X brcm,bcm4334-bt X - X X X X X X brcm,bcm43438-bt X - X X X X X X brcm,bcm4345c5 X - X X X X X X brcm,bcm43540-bt X - X X X X X X brcm,bcm4335a0 X - X X X X X X brcm,bcm4349-bt X - X X X X X X infineon,cyw55572-bt X - X X X X X X Signed-off-by: Hakan Jansson Reviewed-by: Linus Walleij --- V1 -> V2: - New patch added to series .../bindings/net/broadcom-bluetooth.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml index 71fe9b17f8f1..445b2a553625 100644 --- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml +++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml @@ -117,6 +117,22 @@ properties: required: - compatible +dependencies: + brcm,requires-autobaud-mode: [ 'shutdown-gpios' ] + +if: + not: + properties: + compatible: + contains: + enum: + - brcm,bcm20702a1 + - brcm,bcm4329-bt + - brcm,bcm4330-bt +then: + properties: + reset-gpios: false + additionalProperties: false examples: From patchwork Thu Jun 30 12:45:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hakan Jansson X-Patchwork-Id: 586652 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 60749C433EF for ; Thu, 30 Jun 2022 12:46:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234838AbiF3MqR (ORCPT ); Thu, 30 Jun 2022 08:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235001AbiF3MqN (ORCPT ); Thu, 30 Jun 2022 08:46:13 -0400 Received: from smtp11.infineon.com (smtp11.infineon.com [IPv6:2a00:18f0:1e00:4::5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFC2F22508; Thu, 30 Jun 2022 05:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1656593172; x=1688129172; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t84O14azMaMNR/tz7MWmKJe0OmdgJaTNB2neB/QIZuk=; b=b0iSLqs1xJfQpqcW5t4VJoBmHvazdVfkz4DCj8yLrMwPC7lyJg58FAFt mze9riPMYAxbV20WcmHUBer7SXEIrY9UeAS9IU3iuYvb93PPMbBXN3KhE WTnVvqCPm7CqzqJBZNqqCmi7WquIbfwDaxdAZ30nQJJaf0ewJVereGM9p s=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="304013072" X-IronPort-AV: E=Sophos;i="5.92,234,1650924000"; d="scan'208";a="304013072" Received: from unknown (HELO mucxv003.muc.infineon.com) ([172.23.11.20]) by smtp11.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:46:11 +0200 Received: from MUCSE805.infineon.com (MUCSE805.infineon.com [172.23.29.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv003.muc.infineon.com (Postfix) with ESMTPS; Thu, 30 Jun 2022 14:46:11 +0200 (CEST) Received: from MUCSE807.infineon.com (172.23.29.33) by MUCSE805.infineon.com (172.23.29.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:46:11 +0200 Received: from ISCNPF0RJXQS.infineon.com (172.23.8.247) by MUCSE807.infineon.com (172.23.29.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:46:09 +0200 From: Hakan Jansson CC: Hakan Jansson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Linus Walleij , , , , Marcel Holtmann , Johan Hedberg , "Luiz Augusto von Dentz" , Subject: [PATCH v2 3/5] Bluetooth: hci_bcm: Add DT compatible for CYW55572 Date: Thu, 30 Jun 2022 14:45:22 +0200 Message-ID: <6d17c74d01e785ca7db21d611a5722943aeffdd3.1656583541.git.hakan.jansson@infineon.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [172.23.8.247] X-ClientProxiedBy: MUCSE824.infineon.com (172.23.29.55) To MUCSE807.infineon.com (172.23.29.33) To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org CYW55572 is a Wi-Fi + Bluetooth combo device from Infineon. Signed-off-by: Hakan Jansson Reviewed-by: Linus Walleij --- V1 -> V2: - No changes, submitted as part of updated patch series drivers/bluetooth/hci_bcm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 6f834ff1b44b..9a129867a4c0 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -1557,6 +1557,7 @@ static const struct of_device_id bcm_bluetooth_of_match[] = { { .compatible = "brcm,bcm4349-bt", .data = &bcm43438_device_data }, { .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data }, { .compatible = "brcm,bcm4335a0" }, + { .compatible = "infineon,cyw55572-bt" }, { }, }; MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match); From patchwork Thu Jun 30 12:45:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hakan Jansson X-Patchwork-Id: 586159 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 6FD44CCA482 for ; Thu, 30 Jun 2022 12:46:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235061AbiF3MqT (ORCPT ); Thu, 30 Jun 2022 08:46:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235043AbiF3MqP (ORCPT ); Thu, 30 Jun 2022 08:46:15 -0400 Received: from smtp2.infineon.com (smtp2.infineon.com [IPv6:2a00:18f0:1e00:4::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FB1D22508; Thu, 30 Jun 2022 05:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1656593174; x=1688129174; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+S/i0os03fT4PDMmolQDm3D23GK/ZwuYZfdR8J4uDrE=; b=K9eMvdpR1j9KVuHduZd7t9BDwgGHotADx4kMXTtNqGCm1GRJW3DCac3e qGIFjtVAOXkEuzY/4/yg6yempXAgW04ez10VGK0N6VSr1Ks/xLzaj5OsI wgytUK/OP/SFZKSfPGmnC1VJK1pxIKB9uNmBYgMUUigadS2euVIn9xkJO Q=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="186455692" X-IronPort-AV: E=Sophos;i="5.92,234,1650924000"; d="scan'208";a="186455692" Received: from unknown (HELO mucxv001.muc.infineon.com) ([172.23.11.16]) by smtp2.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:46:13 +0200 Received: from MUCSE803.infineon.com (MUCSE803.infineon.com [172.23.29.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv001.muc.infineon.com (Postfix) with ESMTPS; Thu, 30 Jun 2022 14:46:13 +0200 (CEST) Received: from MUCSE807.infineon.com (172.23.29.33) by MUCSE803.infineon.com (172.23.29.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:46:13 +0200 Received: from ISCNPF0RJXQS.infineon.com (172.23.8.247) by MUCSE807.infineon.com (172.23.29.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:46:11 +0200 From: Hakan Jansson CC: Hakan Jansson , Linus Walleij , "David S. Miller" , "Eric Dumazet" , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , , , , Marcel Holtmann , Johan Hedberg , "Luiz Augusto von Dentz" , Subject: [PATCH v2 4/5] Bluetooth: hci_bcm: Prevent early baudrate setting in autobaud mode Date: Thu, 30 Jun 2022 14:45:23 +0200 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [172.23.8.247] X-ClientProxiedBy: MUCSE824.infineon.com (172.23.29.55) To MUCSE807.infineon.com (172.23.29.33) To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Always prevent trying to set device baudrate before calling setup() when using autobaud mode. This was previously happening for devices which had device specific data with member no_early_set_baudrate set to 0. Signed-off-by: Hakan Jansson Reviewed-by: Linus Walleij --- V1 -> V2: - No changes, submitted as part of updated patch series drivers/bluetooth/hci_bcm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 9a129867a4c0..0ae627c293c5 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -484,7 +484,7 @@ static int bcm_open(struct hci_uart *hu) /* If oper_speed is set, ldisc/serdev will set the baudrate * before calling setup() */ - if (!bcm->dev->no_early_set_baudrate) + if (!bcm->dev->no_early_set_baudrate && !bcm->dev->use_autobaud_mode) hu->oper_speed = bcm->dev->oper_speed; err = bcm_gpio_set_power(bcm->dev, true); @@ -1204,9 +1204,6 @@ static int bcm_of_probe(struct bcm_device *bdev) { bdev->use_autobaud_mode = device_property_read_bool(bdev->dev, "brcm,requires-autobaud-mode"); - if (bdev->use_autobaud_mode) - bdev->no_early_set_baudrate = true; - device_property_read_u32(bdev->dev, "max-speed", &bdev->oper_speed); device_property_read_u8_array(bdev->dev, "brcm,bt-pcm-int-params", bdev->pcm_int_params, 5); From patchwork Thu Jun 30 12:53:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hakan Jansson X-Patchwork-Id: 586158 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 9D83DC43334 for ; Thu, 30 Jun 2022 12:55:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235169AbiF3MzM (ORCPT ); Thu, 30 Jun 2022 08:55:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234926AbiF3MzG (ORCPT ); Thu, 30 Jun 2022 08:55:06 -0400 Received: from smtp2.infineon.com (smtp2.infineon.com [IPv6:2a00:18f0:1e00:4::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1888F42A33; Thu, 30 Jun 2022 05:55:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1656593704; x=1688129704; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oeAdeUrBFEmz6BwW5n6DuRf2vm8YcCn1LKO9eai7Zzo=; b=ckb1D2WTU70OlMrUCQcFZ8IRdwXD0B+fbxi6TPtCJTdD2Qr0EHIK6pPs CUsbi2QBDUgH0wgPwSKnmTfM4koiNuD93hAFP1E/7e+qfptePT7UImY8Y N9l7nFVFMtcOWd03ZXYLGu+fw2Qx2ALTmy6KKY1cpAM6qq5I02b78isMJ w=; X-SBRS: None X-IronPort-AV: E=McAfee;i="6400,9594,10393"; a="186456821" X-IronPort-AV: E=Sophos;i="5.92,234,1650924000"; d="scan'208";a="186456821" Received: from unknown (HELO mucxv001.muc.infineon.com) ([172.23.11.16]) by smtp2.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jun 2022 14:55:02 +0200 Received: from MUCSE812.infineon.com (MUCSE812.infineon.com [172.23.29.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mucxv001.muc.infineon.com (Postfix) with ESMTPS; Thu, 30 Jun 2022 14:55:02 +0200 (CEST) Received: from MUCSE807.infineon.com (172.23.29.33) by MUCSE812.infineon.com (172.23.29.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:55:02 +0200 Received: from ISCNPF0RJXQS.infineon.com (172.23.8.247) by MUCSE807.infineon.com (172.23.29.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Thu, 30 Jun 2022 14:55:00 +0200 From: Hakan Jansson CC: Hakan Jansson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Linus Walleij , , , , Marcel Holtmann , Johan Hedberg , "Luiz Augusto von Dentz" , Subject: [PATCH v2 5/5] Bluetooth: hci_bcm: Increase host baudrate for CYW55572 in autobaud mode Date: Thu, 30 Jun 2022 14:53:45 +0200 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [172.23.8.247] X-ClientProxiedBy: MUCSE810.infineon.com (172.23.29.36) To MUCSE807.infineon.com (172.23.29.33) To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add device specific data for max baudrate in autobaud mode. This allows the host to use a baudrate higher than "init speed" when loading FW in autobaud mode. The device specific max baudrate in autobaud mode for CYW55572 is set to 921600 bps. Devices without device specific max baudrate in autobaud mode will use init speed as before. If no device specific init speed has been specified, it will default to the bcm_proto default 115200 bps. The increased baud rate improves FW load time. The exact load time will depend on the specific system and FW being used. As a rough indication, the FW load time dropped from ~9s @ 115.2kbps to ~1.7s @ 921.6kbps in one test. Signed-off-by: Hakan Jansson Reviewed-by: Linus Walleij --- V1 -> V2: - Add actual baud rates and example FW load time in commit message drivers/bluetooth/hci_bcm.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index 0ae627c293c5..d7e0b75db8a6 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -53,10 +53,12 @@ * struct bcm_device_data - device specific data * @no_early_set_baudrate: Disallow set baudrate before driver setup() * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it + * @max_autobaud_speed: max baudrate supported by device in autobaud mode */ struct bcm_device_data { bool no_early_set_baudrate; bool drive_rts_on_open; + u32 max_autobaud_speed; }; /** @@ -100,6 +102,7 @@ struct bcm_device_data { * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it * @pcm_int_params: keep the initial PCM configuration * @use_autobaud_mode: start Bluetooth device in autobaud mode + * @max_autobaud_speed: max baudrate supported by device in autobaud mode */ struct bcm_device { /* Must be the first member, hci_serdev.c expects this. */ @@ -139,6 +142,7 @@ struct bcm_device { bool drive_rts_on_open; bool use_autobaud_mode; u8 pcm_int_params[5]; + u32 max_autobaud_speed; }; /* generic bcm uart resources */ @@ -479,7 +483,10 @@ static int bcm_open(struct hci_uart *hu) else if (bcm->dev->drive_rts_on_open) hci_uart_set_flow_control(hu, true); - hu->init_speed = bcm->dev->init_speed; + if (bcm->dev->use_autobaud_mode && bcm->dev->max_autobaud_speed) + hu->init_speed = min(bcm->dev->oper_speed, bcm->dev->max_autobaud_speed); + else + hu->init_speed = bcm->dev->init_speed; /* If oper_speed is set, ldisc/serdev will set the baudrate * before calling setup() @@ -585,8 +592,8 @@ static int bcm_setup(struct hci_uart *hu) return 0; /* Init speed if any */ - if (hu->init_speed) - speed = hu->init_speed; + if (bcm->dev && bcm->dev->init_speed) + speed = bcm->dev->init_speed; else if (hu->proto->init_speed) speed = hu->proto->init_speed; else @@ -1519,6 +1526,7 @@ static int bcm_serdev_probe(struct serdev_device *serdev) data = device_get_match_data(bcmdev->dev); if (data) { + bcmdev->max_autobaud_speed = data->max_autobaud_speed; bcmdev->no_early_set_baudrate = data->no_early_set_baudrate; bcmdev->drive_rts_on_open = data->drive_rts_on_open; } @@ -1542,6 +1550,10 @@ static struct bcm_device_data bcm43438_device_data = { .drive_rts_on_open = true, }; +static struct bcm_device_data cyw55572_device_data = { + .max_autobaud_speed = 921600, +}; + static const struct of_device_id bcm_bluetooth_of_match[] = { { .compatible = "brcm,bcm20702a1" }, { .compatible = "brcm,bcm4329-bt" }, @@ -1554,7 +1566,7 @@ static const struct of_device_id bcm_bluetooth_of_match[] = { { .compatible = "brcm,bcm4349-bt", .data = &bcm43438_device_data }, { .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data }, { .compatible = "brcm,bcm4335a0" }, - { .compatible = "infineon,cyw55572-bt" }, + { .compatible = "infineon,cyw55572-bt", .data = &cyw55572_device_data }, { }, }; MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match);