Skip to content

Commit 5aaef97

Browse files
authored
Merge pull request #23 from AdityaGarg8/main
Add Bluetooth support for 16,2
2 parents ac4daa0 + fc40eff commit 5aaef97

4 files changed

+89
-14
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
From 64dad24333ddb290f4e2f6c489abe03247030320 Mon Sep 17 00:00:00 2001
2+
From: Orlando Chamberlain <[email protected]>
3+
Date: Tue, 28 Sep 2021 20:41:35 +1000
4+
Subject: [PATCH] bluetooth: add disable read tx power quirk
5+
6+
---
7+
drivers/bluetooth/btbcm.c | 4 ++++
8+
include/net/bluetooth/hci.h | 9 +++++++++
9+
net/bluetooth/hci_core.c | 3 ++-
10+
3 files changed, 15 insertions(+), 1 deletion(-)
11+
12+
diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
13+
index e4182acee488..4ecc50d93107 100644
14+
--- a/drivers/bluetooth/btbcm.c
15+
+++ b/drivers/bluetooth/btbcm.c
16+
@@ -353,6 +353,10 @@ static int btbcm_read_info(struct hci_dev *hdev)
17+
return PTR_ERR(skb);
18+
19+
bt_dev_info(hdev, "BCM: chip id %u", skb->data[1]);
20+
+
21+
+ if (skb->data[1] == 150)
22+
+ set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks);
23+
+
24+
kfree_skb(skb);
25+
26+
/* Read Controller Features */
27+
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
28+
index b80415011dcd..9ce46cb8564d 100644
29+
--- a/include/net/bluetooth/hci.h
30+
+++ b/include/net/bluetooth/hci.h
31+
@@ -246,6 +246,15 @@ enum {
32+
* HCI after resume.
33+
*/
34+
HCI_QUIRK_NO_SUSPEND_NOTIFIER,
35+
+
36+
+ /*
37+
+ * When this quirk is set, LE tx power is not queried on startup
38+
+ * and the min/max tx power values default to HCI_TX_POWER_INVALID.
39+
+ *
40+
+ * This quirk can be set before hci_register_dev is called or
41+
+ * during the hdev->setup vendor callback.
42+
+ */
43+
+ HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER,
44+
};
45+
46+
/* HCI device flags */
47+
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
48+
index 8a47a3017d61..9a23fe7c8d67 100644
49+
--- a/net/bluetooth/hci_core.c
50+
+++ b/net/bluetooth/hci_core.c
51+
@@ -742,7 +742,8 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt)
52+
hci_req_add(req, HCI_OP_LE_READ_ADV_TX_POWER, 0, NULL);
53+
}
54+
55+
- if (hdev->commands[38] & 0x80) {
56+
+ if (hdev->commands[38] & 0x80 &&
57+
+ !test_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks)) {
58+
/* Read LE Min/Max Tx Power*/
59+
hci_req_add(req, HCI_OP_LE_READ_TRANSMIT_POWER,
60+
0, NULL);
61+
--
62+
2.33.0
63+

9001-bluetooth-disable-read-LE-MinMax-Tx-Power.patch

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From 76d8253d90233b2c2d3fbc82355c603bf0eb9964 Mon Sep 17 00:00:00 2001
2+
From: Aditya Garg <[email protected]>
3+
Date: Fri, 1 Oct 2021 13:30:19 +0530
4+
Subject: [PATCH] Add support for MacBookPro16,2 UART
5+
6+
---
7+
drivers/mfd/intel-lpss-pci.c | 2 ++
8+
1 file changed, 2 insertions(+)
9+
10+
diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c
11+
index c54d19fb1..33d5043fd 100644
12+
--- a/drivers/mfd/intel-lpss-pci.c
13+
+++ b/drivers/mfd/intel-lpss-pci.c
14+
@@ -253,6 +253,8 @@ static const struct pci_device_id intel_lpss_pci_ids[] = {
15+
{ PCI_VDEVICE(INTEL, 0x34ea), (kernel_ulong_t)&bxt_i2c_info },
16+
{ PCI_VDEVICE(INTEL, 0x34eb), (kernel_ulong_t)&bxt_i2c_info },
17+
{ PCI_VDEVICE(INTEL, 0x34fb), (kernel_ulong_t)&spt_info },
18+
+ /* MacBookPro16,2*/
19+
+ { PCI_VDEVICE(INTEL, 0x38a8), (kernel_ulong_t)&bxt_uart_info },
20+
/* TGL-H */
21+
{ PCI_VDEVICE(INTEL, 0x43a7), (kernel_ulong_t)&bxt_uart_info },
22+
{ PCI_VDEVICE(INTEL, 0x43a8), (kernel_ulong_t)&bxt_uart_info },

PKGBUILD

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ source=(
6262
8001-corellium-wifi-bigsur.patch
6363
8002-Add-support-for-BCM4377.patch
6464

65-
9001-bluetooth-disable-read-LE-MinMax-Tx-Power.patch
65+
9001-bluetooth-add-disable-read-tx-power-quirk.patch
66+
9002-add-bluetooth-support-for-16,2.patch
6667
)
6768

6869
validpgpkeys=(
@@ -265,4 +266,5 @@ sha256sums=('ca0eda14c512efa7fc054e9eb89dd8f6a6e7075aef1e39d30b5f243f7bde9b89'
265266
'90a6012cdd8a64ede8e0bbaf7331960bd68f628e0973b65459188eb1ccb5b829'
266267
'903c9e2d141ddb4ebc7f60fd08b54d97306a187a06bfc8832bc8f442f00027e3'
267268
'fbbbb17f657d72a36677b556b2b61594a3389191d05de4e4a3a446daab260667'
268-
'f1b8accfe1a38aeaf00867577e488a9b958efd22dbe6e95bc7ce5d369cbf6b19')
269+
'31e414978a947bdb71f27ed364c4da73b81fcf1921250cb69ee1bcf2bbd25636'
270+
'ee4ea917e501104b42ce3b7ca524598c8de849890acbbacebaacbb7d8f877ff9')

0 commit comments

Comments
 (0)