From patchwork Sun May 14 07:47:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rudi Heitbaum X-Patchwork-Id: 681864 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 7339DC77B7F for ; Sun, 14 May 2023 07:48:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232713AbjENHr6 (ORCPT ); Sun, 14 May 2023 03:47:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232109AbjENHr5 (ORCPT ); Sun, 14 May 2023 03:47:57 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E2F82716 for ; Sun, 14 May 2023 00:47:55 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-250252e4113so7786779a91.0 for ; Sun, 14 May 2023 00:47:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heitbaum.com; s=google; t=1684050475; x=1686642475; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ay1MPc6F0iyKA9Pf+RpucZR4uy8JJBBnlfw3+ke13QI=; b=c9CtYou5DiDEv6nGqLhstt6vJCSMYNO/S5P96q/XqghzCd/gomUZ/HQlblodvKDIlx Oh7IWEW+tsTEg8LA5W/LzBt/EvuBWmj9hY/hVLGf+YbBIpE79aoUGOMJKxueqM004iu1 f1NCXVfpxrDWOYWrCC36+PRLCDmBurqms4Vac= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684050475; x=1686642475; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ay1MPc6F0iyKA9Pf+RpucZR4uy8JJBBnlfw3+ke13QI=; b=g/jxOSuNjRr7QbiGzhwkXpyMhGfgtdgJDsEw2yECzyDQ4o+KlR9YK2CAMIzuvnLgPh gmMAOtP7uyWug8ntD4VmYWTTqzN1CVAeeOHg6VP9oJRMvT9KlxxvBmQ+vg5o9x419jEK CVZWaWe70ah1wiyZ2EDqKteirYd0R+3xPBFcZ53xlPZPKGKG3bi9MAOxfKZyxngL+gVx YuBy1IpmtOIr2DXhTA1/Pa5ESs/J9AbIphzg4rzduTTHtewQKcEhB2uGgvRCgj/EOuBS Ki6D1qLp7IoXYeF9pVGaoWsLUOQukwnv/42mi1wjIAySF+TNdD0F50I3xdTHfSG3K541 QICQ== X-Gm-Message-State: AC+VfDzH6cWB8SqsQgdXVkhSec3DJk6lF0inSY3WmgztBw9Tfn5UHlqU Ae81AtuMsUl+U0A/kb7dCH0zeg== X-Google-Smtp-Source: ACHHUZ7+GvsJHRM7m26GQl/jq/2g/yljHEAye1w4XghdoWhpKePYcISv5PAzlF6jy9GhkyljLOaE1w== X-Received: by 2002:a17:90b:1bc1:b0:24e:2248:31c with SMTP id oa1-20020a17090b1bc100b0024e2248031cmr30507509pjb.22.1684050474747; Sun, 14 May 2023 00:47:54 -0700 (PDT) Received: from 8add390ca20e.heitbaum.com ([122.199.31.3]) by smtp.googlemail.com with ESMTPSA id j4-20020a17090276c400b00194caf3e975sm10903363plt.208.2023.05.14.00.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 May 2023 00:47:54 -0700 (PDT) From: Rudi Heitbaum To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, anarsoul@gmail.com, alistair@alistair23.me Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-bluetooth@vger.kernel.org, Rudi Heitbaum Subject: [PATCH 1/3] dt-bindings: net: realtek-bluetooth: Add RTL8822BS Date: Sun, 14 May 2023 07:47:29 +0000 Message-Id: <20230514074731.70614-2-rudi@heitbaum.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230514074731.70614-1-rudi@heitbaum.com> References: <20230514074731.70614-1-rudi@heitbaum.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add compatible string for RTL8822BS for existing Realtek Bluetooth driver. Signed-off-by: Rudi Heitbaum --- .../devicetree/bindings/net/realtek-bluetooth.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml index 8cc2b9924680..d2103931fc1c 100644 --- a/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml +++ b/Documentation/devicetree/bindings/net/realtek-bluetooth.yaml @@ -4,16 +4,16 @@ $id: http://devicetree.org/schemas/net/realtek-bluetooth.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822CS Bluetooth +title: RTL8723BS/RTL8723CS/RTL8821CS/RTL8822BS/RTL8822CS Bluetooth maintainers: - Vasily Khoruzhick - Alistair Francis description: - RTL8723CS/RTL8723CS/RTL8821CS/RTL8822CS is a WiFi + BT chip. WiFi part - is connected over SDIO, while BT is connected over serial. It speaks - H5 protocol with few extra commands to upload firmware and change + RTL8723CS/RTL8723CS/RTL8821CS/RTL8822BS/RTL8822CS is a WiFi + BT chip. + WiFi part is connected over SDIO, while BT is connected over serial. It + speaks H5 protocol with few extra commands to upload firmware and change module speed. properties: @@ -23,11 +23,14 @@ properties: - realtek,rtl8723bs-bt - realtek,rtl8723cs-bt - realtek,rtl8723ds-bt + - realtek,rtl8822bs-bt - realtek,rtl8822cs-bt - items: - enum: - realtek,rtl8821cs-bt - - const: realtek,rtl8822cs-bt + - const: + - realtek,rtl8822bs-bt + - realtek,rtl8822cs-bt device-wake-gpios: maxItems: 1 From patchwork Sun May 14 07:47:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rudi Heitbaum X-Patchwork-Id: 684604 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 2C62AC77B7F for ; Sun, 14 May 2023 07:48:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231128AbjENHsN (ORCPT ); Sun, 14 May 2023 03:48:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232968AbjENHsL (ORCPT ); Sun, 14 May 2023 03:48:11 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93F562112 for ; Sun, 14 May 2023 00:48:05 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1aafa41116fso78700555ad.1 for ; Sun, 14 May 2023 00:48:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heitbaum.com; s=google; t=1684050484; x=1686642484; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4NnQY8noj1MmR/ModEB4va/hdB07OBevUq7UGZR96Es=; b=aod5o48Q1jn62cAjOkvTdvoY//WwVUxfug/sweWLvAK6jZioFwohpqM4nw4MfakmPr mIrNiQ6murJlHEkO5vbNtMJcJHt3G9u7pPvqIVV6fCw8TSn0VaE7RkUL9cyu1oJqNRFf KzHmYF8j48Oy1wxczJ4k3quxgKvmoRhesw0Qc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684050484; x=1686642484; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4NnQY8noj1MmR/ModEB4va/hdB07OBevUq7UGZR96Es=; b=DzSSydgTs+KA6NQRbF9DvsmuDViTO2Nv9oi2if2YP0AcAA9uerY3DfvwHVTej8xYwb PMANr5a1VPdAarXK4U3yNGYLbwyEiVZpIFhiBUAsN3jKs42ATiKl+xE1PP7vgeI9WLwu wCbz9jcm4DfiXfcP2jbQssgnaa380bjRyZo04486bmdUqqNafm6ie8K6Zp9HkJN5j9pz saww0X6ZOIrcReb/xKmLN/g5maL3HcDuSey4yzvoSZj0IBAAS5ocj2AfXBcKgvqLik32 77EB3vOUrft7GLTz/S007ceuX1o8aBQxc1s4pWA3M+1ojvrlo7lSWRvngERoPZXIaXC4 R2RQ== X-Gm-Message-State: AC+VfDxtbZzJd6ck/B78oiLpZbA13KwOScrGGCsOTQ+LSaK/65Z6CFUY 7Up5YuytOeODDe+FKYDgT2d5TA== X-Google-Smtp-Source: ACHHUZ6Hy/3ldJ/A7WBa+micL+eupJ48zrwm9GfokwyqfxTZ3YFGS6iY6weBheTF0G9Sv5PtCwFFGw== X-Received: by 2002:a17:902:6ac3:b0:1ac:93ba:a5ec with SMTP id i3-20020a1709026ac300b001ac93baa5ecmr17497603plt.52.1684050483745; Sun, 14 May 2023 00:48:03 -0700 (PDT) Received: from 8add390ca20e.heitbaum.com ([122.199.31.3]) by smtp.googlemail.com with ESMTPSA id j4-20020a17090276c400b00194caf3e975sm10903363plt.208.2023.05.14.00.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 May 2023 00:48:03 -0700 (PDT) From: Rudi Heitbaum To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, anarsoul@gmail.com, alistair@alistair23.me Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-bluetooth@vger.kernel.org, Rudi Heitbaum Subject: [PATCH 2/3] Bluetooth: btrtl: Add support for RTL8822BS UART Date: Sun, 14 May 2023 07:47:30 +0000 Message-Id: <20230514074731.70614-3-rudi@heitbaum.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230514074731.70614-1-rudi@heitbaum.com> References: <20230514074731.70614-1-rudi@heitbaum.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add a RTL8822BS UART with hci_ver = 0x07. This is similar to RTL8822CS observed on the Tanix TX6 Android set-top box. But the previous generation of chip. The RTL8822BS requires the BROKEN_LOCAL_EXT_FEATURES_PAGE_2 quirk. Signed-off-by: Rudi Heitbaum --- drivers/bluetooth/btrtl.c | 12 +++++++++++- drivers/bluetooth/hci_h5.c | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index 2915c82d719d..b53a4ef88550 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -234,7 +234,15 @@ static const struct id_table ic_id_table[] = { .fw_name = "rtl_bt/rtl8822cu_fw.bin", .cfg_name = "rtl_bt/rtl8822cu_config" }, - /* 8822B */ + /* 8822BS with UART interface */ + { IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_UART), + .config_needed = true, + .has_rom_version = true, + .has_msft_ext = true, + .fw_name = "rtl_bt/rtl8822bs_fw.bin", + .cfg_name = "rtl_bt/rtl8822bs_config" }, + + /* 8822BU with USB interface */ { IC_INFO(RTL_ROM_LMP_8822B, 0xb, 0x7, HCI_USB), .config_needed = true, .has_rom_version = true, @@ -1182,6 +1190,8 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev) hci_set_aosp_capable(hdev); break; + case CHIP_ID_8822B: + set_bit(HCI_QUIRK_BROKEN_LOCAL_EXT_FEATURES_PAGE_2, &hdev->quirks); default: rtl_dev_dbg(hdev, "Central-peripheral role not enabled."); rtl_dev_dbg(hdev, "WBS supported not enabled."); diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index fefc37b98b4a..726b6c7e28b8 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -1072,6 +1072,10 @@ static struct h5_vnd rtl_vnd = { .acpi_gpio_map = acpi_btrtl_gpios, }; +static const struct h5_device_data h5_data_rtl8822bs = { + .vnd = &rtl_vnd, +}; + static const struct h5_device_data h5_data_rtl8822cs = { .vnd = &rtl_vnd, }; @@ -1100,6 +1104,8 @@ static const struct dev_pm_ops h5_serdev_pm_ops = { static const struct of_device_id rtl_bluetooth_of_match[] = { #ifdef CONFIG_BT_HCIUART_RTL + { .compatible = "realtek,rtl8822bs-bt", + .data = (const void *)&h5_data_rtl8822bs }, { .compatible = "realtek,rtl8822cs-bt", .data = (const void *)&h5_data_rtl8822cs }, { .compatible = "realtek,rtl8723bs-bt", From patchwork Sun May 14 07:47:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rudi Heitbaum X-Patchwork-Id: 681863 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 E22C1C7EE22 for ; Sun, 14 May 2023 07:48:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233277AbjENHsb (ORCPT ); Sun, 14 May 2023 03:48:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbjENHs2 (ORCPT ); Sun, 14 May 2023 03:48:28 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89AF42D43 for ; Sun, 14 May 2023 00:48:13 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1ab1ce53ca6so82551265ad.0 for ; Sun, 14 May 2023 00:48:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heitbaum.com; s=google; t=1684050493; x=1686642493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jXMOTCbN4pJHC2KQ8XGHSVJ9bZ+JD3sMLsrY84T9zCg=; b=azGjwxqhbzeX67GBbt3bcHqoIgoCGl5i80BhgsZq2X3loYVux9ag97RU0oJ8Za63hk fxKzsd2u9AlRhI445awheLBaJXtU+lmgGbRU3PqLSQb/xr2c7khgj9GZwe6v3MZ8JvYB 8cSJhjqywpqVBdsYF/G3JQVrzM/vUYWjns6Rw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684050493; x=1686642493; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jXMOTCbN4pJHC2KQ8XGHSVJ9bZ+JD3sMLsrY84T9zCg=; b=bfY4YXC9cpR8gzceOKcCk8zj9KzzjxkWm/nlNlZ8vVO2C4jRcYv5Lf6MqCRrB1Rps7 kFClhYhBSPgGe0vujJMJhD/bL13Nc0xli57vIXVnYklUHZuXos/cc4YCNnMiz7Q3DzOR hC93XCnV+ZTO1l/+wtgcFyS/DPXj8o9m3Ml6tElvXzaY/fVOequacAL+2/lYLGzmVzgx 2xlonrpUlu5PqrQm/8vA6QSV7clMkb61xRm2D2RrFSArsQgm69hURSxU3WNGKL9KlKOH FIy0VaUiVoCh34eKZYtxxe3OGJSdOlbpQWjlWMZpUvfT34R3xfLtsBoQ4UU0tqIDd3tO +nHA== X-Gm-Message-State: AC+VfDy94ew+np/DWtAYkpsQaInNJ7iyayfnwZgAlemj49GAD2ylBHiW YopUIQ3APuoT/gVsX9IK0hDmOynxpPr9138+1/2SHSam X-Google-Smtp-Source: ACHHUZ7nuNI32aku8He5WevcEmfdir2RB6FIdCP/I07cZYqXxRCmHW80kT4iPbcyjRSz4TjOHJo6Tw== X-Received: by 2002:a17:902:d2c7:b0:1a9:90bc:c3c6 with SMTP id n7-20020a170902d2c700b001a990bcc3c6mr39582395plc.16.1684050492641; Sun, 14 May 2023 00:48:12 -0700 (PDT) Received: from 8add390ca20e.heitbaum.com ([122.199.31.3]) by smtp.googlemail.com with ESMTPSA id j4-20020a17090276c400b00194caf3e975sm10903363plt.208.2023.05.14.00.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 May 2023 00:48:12 -0700 (PDT) From: Rudi Heitbaum To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, anarsoul@gmail.com, alistair@alistair23.me Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-bluetooth@vger.kernel.org, Rudi Heitbaum Subject: [PATCH 3/3] arm64: dts: allwinner: h6: tanix-tx6: Add compatible bluetooth Date: Sun, 14 May 2023 07:47:31 +0000 Message-Id: <20230514074731.70614-4-rudi@heitbaum.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230514074731.70614-1-rudi@heitbaum.com> References: <20230514074731.70614-1-rudi@heitbaum.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Tanix TX6 comes either with RTL8822BS or RTL8822CS wifi+bt combo module. Add compatible for RTL8822BS as it uses different firmware. Signed-off-by: Rudi Heitbaum --- arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts index 9a38ff9b3fc7..9460ccbc247d 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-tanix-tx6.dts @@ -21,7 +21,7 @@ &uart1 { status = "okay"; bluetooth { - compatible = "realtek,rtl8822cs-bt"; + compatible = "realtek,rtl8822bs-bt", "realtek,rtl8822cs-bt"; device-wake-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */ host-wake-gpios = <&r_pio 1 1 GPIO_ACTIVE_HIGH>; /* PM1 */ enable-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */