Skip to content

Commit

Permalink
Bluetooth: hci_qca: Enable WBS support for wcn3991
Browse files Browse the repository at this point in the history
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 <abhishekpandit@chromium.org>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Abhishek Pandit-Subedi authored and Marcel Holtmann committed May 18, 2020
1 parent 56b5453 commit a228f7a
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions drivers/bluetooth/hci_qca.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ enum qca_flags {
QCA_HW_ERROR_EVENT
};

enum qca_capabilities {
QCA_CAP_WIDEBAND_SPEECH = BIT(0),
};

/* HCI_IBS transmit side sleep protocol states */
enum tx_ibs_states {
Expand Down Expand Up @@ -187,10 +190,11 @@ struct qca_vreg {
unsigned int load_uA;
};

struct qca_vreg_data {
struct qca_device_data {
enum qca_btsoc_type soc_type;
struct qca_vreg *vregs;
size_t num_vregs;
uint32_t capabilities;
};

/*
Expand Down Expand Up @@ -1691,7 +1695,7 @@ static const struct hci_uart_proto qca_proto = {
.dequeue = qca_dequeue,
};

static const struct qca_vreg_data qca_soc_data_wcn3990 = {
static const struct qca_device_data qca_soc_data_wcn3990 = {
.soc_type = QCA_WCN3990,
.vregs = (struct qca_vreg []) {
{ "vddio", 15000 },
Expand All @@ -1702,7 +1706,7 @@ static const struct qca_vreg_data qca_soc_data_wcn3990 = {
.num_vregs = 4,
};

static const struct qca_vreg_data qca_soc_data_wcn3991 = {
static const struct qca_device_data qca_soc_data_wcn3991 = {
.soc_type = QCA_WCN3991,
.vregs = (struct qca_vreg []) {
{ "vddio", 15000 },
Expand All @@ -1711,9 +1715,10 @@ static const struct qca_vreg_data qca_soc_data_wcn3991 = {
{ "vddch0", 450000 },
},
.num_vregs = 4,
.capabilities = QCA_CAP_WIDEBAND_SPEECH,
};

static const struct qca_vreg_data qca_soc_data_wcn3998 = {
static const struct qca_device_data qca_soc_data_wcn3998 = {
.soc_type = QCA_WCN3998,
.vregs = (struct qca_vreg []) {
{ "vddio", 10000 },
Expand All @@ -1724,7 +1729,7 @@ static const struct qca_vreg_data qca_soc_data_wcn3998 = {
.num_vregs = 4,
};

static const struct qca_vreg_data qca_soc_data_qca6390 = {
static const struct qca_device_data qca_soc_data_qca6390 = {
.soc_type = QCA_QCA6390,
.num_vregs = 0,
};
Expand Down Expand Up @@ -1860,7 +1865,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
{
struct qca_serdev *qcadev;
struct hci_dev *hdev;
const struct qca_vreg_data *data;
const struct qca_device_data *data;
int err;
bool power_ctrl_enabled = true;

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

/* Wideband speech support must be set per driver since it can't be
* queried via hci.
*/
if (data && (data->capabilities & QCA_CAP_WIDEBAND_SPEECH))
set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);

return 0;
}

Expand Down

0 comments on commit a228f7a

Please sign in to comment.