From nobody Tue Jun 30 04:38:08 2026 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 F044AC433EF for ; Tue, 25 Jan 2022 16:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242199AbiAYQUs (ORCPT ); Tue, 25 Jan 2022 11:20:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354286AbiAYQQr (ORCPT ); Tue, 25 Jan 2022 11:16:47 -0500 Received: from mx.msync.work (mx.msync.work [IPv6:2a01:4f9:2b:2dc2::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBE29C061768 for ; Tue, 25 Jan 2022 08:16:45 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E7165280BE0; Tue, 25 Jan 2022 16:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1643127256; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=3t996u2cCjv/tctIaoZzV+hoyE2QUpyMSv9doBI04So=; b=wunkG6v2J1VJzjJcos9la2xnAPA+JgXxsAvAtuyocs3/YMPXG1+UUiBKae1AIP2G+6WEXd C1xIBBGs/X4DC19DbKiC9Az7JSgJfY6JbTJCP6UbNGM4/WPWOuCprbM6UUI29Qi7xDSiiT HaR4iW3LXwi85BvdUwoK8r3/M8uewQZ3tBvEGCWJsxe70eaN6lX0x7gbL5+Sn5tesVCfas kPgtqiWAYkf92lYapgxPHsBGbMNiwK8c8odZIP475aNg7aKnIMS7VIptTUpDOZTuhLtOiS vrc/BHIKNYiQVGGZTN4aEqohmgRrzd3N5uZJztFPCSGNBe5V4QZMpjqAHy3t3g== From: Vyacheslav Bocharov To: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rudi Heitbaum Subject: [PATCH v5 1/2] Bluetooth: btrtl: Add support for RTL8822C hci_ver 0x08 Date: Tue, 25 Jan 2022 19:14:00 +0300 Message-Id: <20220125161401.729179-2-adeep@lexina.in> In-Reply-To: <20220125161401.729179-1-adeep@lexina.in> References: <20220125161401.729179-1-adeep@lexina.in> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add a variation of RTL8822CS with hci_ver =3D 0x08. This is fully similar to RTL8822CS with hci_ver =3D 0x0a observed on the Tanix TX6 Android set-top box and JetHome JetHub H1. Signed-off-by: Vyacheslav Bocharov Signed-off-by: Rudi Heitbaum --- drivers/bluetooth/btrtl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c index c2bdd1e6060e..c2030f7e25b4 100644 --- a/drivers/bluetooth/btrtl.c +++ b/drivers/bluetooth/btrtl.c @@ -148,6 +148,14 @@ static const struct id_table ic_id_table[] =3D { .fw_name =3D "rtl_bt/rtl8761bu_fw.bin", .cfg_name =3D "rtl_bt/rtl8761bu_config" }, =20 + /* 8822C with UART interface */ + { IC_INFO(RTL_ROM_LMP_8822B, 0xc, 0x8, HCI_UART), + .config_needed =3D true, + .has_rom_version =3D true, + .has_msft_ext =3D true, + .fw_name =3D "rtl_bt/rtl8822cs_fw.bin", + .cfg_name =3D "rtl_bt/rtl8822cs_config" }, + /* 8822C with UART interface */ { IC_INFO(RTL_ROM_LMP_8822B, 0xc, 0xa, HCI_UART), .config_needed =3D true, --=20 2.30.2 From nobody Tue Jun 30 04:38:08 2026 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 11F2CC433EF for ; Tue, 25 Jan 2022 16:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242386AbiAYQU7 (ORCPT ); Tue, 25 Jan 2022 11:20:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354290AbiAYQQx (ORCPT ); Tue, 25 Jan 2022 11:16:53 -0500 Received: from mx.msync.work (mx.msync.work [IPv6:2a01:4f9:2b:2dc2::3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F06F9C061744 for ; Tue, 25 Jan 2022 08:16:52 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B5866280BE1; Tue, 25 Jan 2022 16:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lexina.in; s=dkim; t=1643127257; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=ZaUa/CaL6dxwiDX9xBVtw2/ZWg2BaHlrMqUB+epYmUg=; b=dLHeUTAChNUc0fo0L5fQQcmbgb+RJFWBi1yNUJRTRReqcjhKuo629cJt1jRvJYLzI3lv6d 1gmSrxUaQIgYFrxNKPSysToV1viAtXMX/7kA1fhJHl8FTSBNFTqVdY+O3d660zNOlp46Pp xlRz24w8tl1EoB75mNMbMJGPoIvaW1EZ6E6Gn5BtZ2kdpk8VwGcS9n0rUB66if0hzvtGPb 4M+7pqysD00VeFM5yxa6Xd6ok1t81Yye/uc1zITw0jZZr8VM2xyWyI4e77M35CqNJSzQq3 xcNp8dkh+xFcrWh+JKFRX6yCUp2Dd7jxyxlt9izyAJqR8KFrig0eMiORjSbevQ== From: Vyacheslav Bocharov To: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rudi Heitbaum Subject: [PATCH v5 2/2] Bluetooth: hci_h5: Add power reset via gpio in h5_btrtl_open Date: Tue, 25 Jan 2022 19:14:01 +0300 Message-Id: <20220125161401.729179-3-adeep@lexina.in> In-Reply-To: <20220125161401.729179-1-adeep@lexina.in> References: <20220125161401.729179-1-adeep@lexina.in> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Add power reset for bluetooth via enable-gpios in h5_btrtl_open function. Signed-off-by: Vyacheslav Bocharov --- While testing the RTL8822CS SDIO WiFi/BT adapter, I found that in some cases the kernel could not initialize it. However, manually resetting the adapter via gpio allows it to start correctly. Apparently at system start the adapter is in an undefined state (including the unknown state of gpio after starting uboot). A forced reset helps to initialize the adapter in most cases. Experimentally it was found that 100ms is enough to reset. drivers/bluetooth/hci_h5.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c index 34286ffe0568..fdf504b0d265 100644 --- a/drivers/bluetooth/hci_h5.c +++ b/drivers/bluetooth/hci_h5.c @@ -966,6 +966,11 @@ static void h5_btrtl_open(struct h5 *h5) pm_runtime_enable(&h5->hu->serdev->dev); } =20 + /* The controller needs reset to startup */ + gpiod_set_value_cansleep(h5->enable_gpio, 0); + gpiod_set_value_cansleep(h5->device_wake_gpio, 0); + msleep(100); + /* The controller needs up to 500ms to wakeup */ gpiod_set_value_cansleep(h5->enable_gpio, 1); gpiod_set_value_cansleep(h5->device_wake_gpio, 1); --=20 2.30.2