2021-04-23 03:53:38

by Hilda Wu

[permalink] [raw]
Subject: [PATCH v3 0/2] Bluetooth hci_h5 btrtl Add flag for keep power in suspend/resume

From: hildawu <[email protected]>

Hello!

This v3 series is for support Host can be wakeup and device no need
power down and no need re-dowload fw. Supported this feature chips
RTL8822C/RTL8852A include UART interface. Avoid re-define related
information. So move shared structure info the btrtl.h.

The patch 1 is adjust the position of strcut definition for btrtl
and hci_h5. The purpose for avoid re-defining chip features in btrtl
with USB and UART devices. Let UART devices (hci_h5) can get relevant
information too. That can be easily managed feature of chips.

The patch 2 is support for Host can received BT device signal then
wake Host up. So this patch, add a flag for these devices didnot
power off and didnot re-download patch during suspend and resume.

version 3 changes
- Reworked to use UART flag, refer to Maintainer's suggestion.
- Split into two patches for different purpose.

version 2 changes
- Add the missing struct member
- Modify title length

Thanks.
Hilda

hildawu (2):
Bluetooth: btrtl: Adjust the position of strcut definition
Bluetooth: hci_h5: Add flag for keep power during suspend/resume

drivers/bluetooth/btrtl.c | 36 -----------------------------------
drivers/bluetooth/btrtl.h | 36 ++++++++++++++++++++++++++++++++++-
drivers/bluetooth/hci_h5.c | 34 +++++++++++++++++++++++----------
drivers/bluetooth/hci_ldisc.c | 3 ++-
drivers/bluetooth/hci_uart.h | 1 +
5 files changed, 62 insertions(+), 48 deletions(-)

--
2.17.1


2021-04-23 03:54:38

by Hilda Wu

[permalink] [raw]
Subject: [PATCH v3 1/2] Bluetooth: btrtl: Adjust the position of strcut definition

From: hildawu <[email protected]>

Adjust the position of strcut definition for btrtl and hci_h5.
The purpose is to avoid re-defining some chip features and let UART devices
get relevant information too.

Signed-off-by: hildawu <[email protected]>
---
drivers/bluetooth/btrtl.c | 36 ------------------------------------
drivers/bluetooth/btrtl.h | 36 +++++++++++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 37 deletions(-)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index e7fe5fb22753..94d1e7885aee 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -38,42 +38,6 @@
.hci_ver = (hciv), \
.hci_bus = (bus)

-enum btrtl_chip_id {
- CHIP_ID_8723A,
- CHIP_ID_8723B,
- CHIP_ID_8821A,
- CHIP_ID_8761A,
- CHIP_ID_8822B = 8,
- CHIP_ID_8723D,
- CHIP_ID_8821C,
- CHIP_ID_8822C = 13,
- CHIP_ID_8761B,
- CHIP_ID_8852A = 18,
-};
-
-struct id_table {
- __u16 match_flags;
- __u16 lmp_subver;
- __u16 hci_rev;
- __u8 hci_ver;
- __u8 hci_bus;
- bool config_needed;
- bool has_rom_version;
- char *fw_name;
- char *cfg_name;
-};
-
-struct btrtl_device_info {
- const struct id_table *ic_info;
- u8 rom_version;
- u8 *fw_data;
- int fw_len;
- u8 *cfg_data;
- int cfg_len;
- bool drop_fw;
- int project_id;
-};
-
static const struct id_table ic_id_table[] = {
/* 8723A */
{ IC_INFO(RTL_ROM_LMP_8723A, 0xb, 0x6, HCI_USB),
diff --git a/drivers/bluetooth/btrtl.h b/drivers/bluetooth/btrtl.h
index 2a582682136d..08bda0597c0c 100644
--- a/drivers/bluetooth/btrtl.h
+++ b/drivers/bluetooth/btrtl.h
@@ -12,7 +12,41 @@
#define rtl_dev_info(dev, fmt, ...) bt_dev_info(dev, "RTL: " fmt, ##__VA_ARGS__)
#define rtl_dev_dbg(dev, fmt, ...) bt_dev_dbg(dev, "RTL: " fmt, ##__VA_ARGS__)

-struct btrtl_device_info;
+enum btrtl_chip_id {
+ CHIP_ID_8723A,
+ CHIP_ID_8723B,
+ CHIP_ID_8821A,
+ CHIP_ID_8761A,
+ CHIP_ID_8822B = 8,
+ CHIP_ID_8723D,
+ CHIP_ID_8821C,
+ CHIP_ID_8822C = 13,
+ CHIP_ID_8761B,
+ CHIP_ID_8852A = 18,
+};
+
+struct id_table {
+ __u16 match_flags;
+ __u16 lmp_subver;
+ __u16 hci_rev;
+ __u8 hci_ver;
+ __u8 hci_bus;
+ bool config_needed;
+ bool has_rom_version;
+ char *fw_name;
+ char *cfg_name;
+};
+
+struct btrtl_device_info {
+ const struct id_table *ic_info;
+ u8 rom_version;
+ u8 *fw_data;
+ int fw_len;
+ u8 *cfg_data;
+ int cfg_len;
+ bool drop_fw;
+ int project_id;
+};

struct rtl_download_cmd {
__u8 index;
--
2.17.1