Skip to content

Commit a228f7a

Browse files
apanditholtmann
authored andcommitted
Bluetooth: hci_qca: Enable WBS support for wcn3991
WCN3991 supports transparent WBS (host encoded mSBC). Add a flag to the device match data to show WBS is supported. This requires the matching firmware for WCN3991 in linux-firmware: 1a8b0dc00f77 (qca: Enable transparent WBS for WCN3991) Signed-off-by: Abhishek Pandit-Subedi <[email protected]> Reviewed-by: Matthias Kaehlcke <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 56b5453 commit a228f7a

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

drivers/bluetooth/hci_qca.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ enum qca_flags {
7575
QCA_HW_ERROR_EVENT
7676
};
7777

78+
enum qca_capabilities {
79+
QCA_CAP_WIDEBAND_SPEECH = BIT(0),
80+
};
7881

7982
/* HCI_IBS transmit side sleep protocol states */
8083
enum tx_ibs_states {
@@ -187,10 +190,11 @@ struct qca_vreg {
187190
unsigned int load_uA;
188191
};
189192

190-
struct qca_vreg_data {
193+
struct qca_device_data {
191194
enum qca_btsoc_type soc_type;
192195
struct qca_vreg *vregs;
193196
size_t num_vregs;
197+
uint32_t capabilities;
194198
};
195199

196200
/*
@@ -1691,7 +1695,7 @@ static const struct hci_uart_proto qca_proto = {
16911695
.dequeue = qca_dequeue,
16921696
};
16931697

1694-
static const struct qca_vreg_data qca_soc_data_wcn3990 = {
1698+
static const struct qca_device_data qca_soc_data_wcn3990 = {
16951699
.soc_type = QCA_WCN3990,
16961700
.vregs = (struct qca_vreg []) {
16971701
{ "vddio", 15000 },
@@ -1702,7 +1706,7 @@ static const struct qca_vreg_data qca_soc_data_wcn3990 = {
17021706
.num_vregs = 4,
17031707
};
17041708

1705-
static const struct qca_vreg_data qca_soc_data_wcn3991 = {
1709+
static const struct qca_device_data qca_soc_data_wcn3991 = {
17061710
.soc_type = QCA_WCN3991,
17071711
.vregs = (struct qca_vreg []) {
17081712
{ "vddio", 15000 },
@@ -1711,9 +1715,10 @@ static const struct qca_vreg_data qca_soc_data_wcn3991 = {
17111715
{ "vddch0", 450000 },
17121716
},
17131717
.num_vregs = 4,
1718+
.capabilities = QCA_CAP_WIDEBAND_SPEECH,
17141719
};
17151720

1716-
static const struct qca_vreg_data qca_soc_data_wcn3998 = {
1721+
static const struct qca_device_data qca_soc_data_wcn3998 = {
17171722
.soc_type = QCA_WCN3998,
17181723
.vregs = (struct qca_vreg []) {
17191724
{ "vddio", 10000 },
@@ -1724,7 +1729,7 @@ static const struct qca_vreg_data qca_soc_data_wcn3998 = {
17241729
.num_vregs = 4,
17251730
};
17261731

1727-
static const struct qca_vreg_data qca_soc_data_qca6390 = {
1732+
static const struct qca_device_data qca_soc_data_qca6390 = {
17281733
.soc_type = QCA_QCA6390,
17291734
.num_vregs = 0,
17301735
};
@@ -1860,7 +1865,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
18601865
{
18611866
struct qca_serdev *qcadev;
18621867
struct hci_dev *hdev;
1863-
const struct qca_vreg_data *data;
1868+
const struct qca_device_data *data;
18641869
int err;
18651870
bool power_ctrl_enabled = true;
18661871

@@ -1948,6 +1953,12 @@ static int qca_serdev_probe(struct serdev_device *serdev)
19481953
hdev->shutdown = qca_power_off;
19491954
}
19501955

1956+
/* Wideband speech support must be set per driver since it can't be
1957+
* queried via hci.
1958+
*/
1959+
if (data && (data->capabilities & QCA_CAP_WIDEBAND_SPEECH))
1960+
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
1961+
19511962
return 0;
19521963
}
19531964

0 commit comments

Comments
 (0)