aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btqca.c
diff options
context:
space:
mode:
authorHarish Bandi <c-hbandi@codeaurora.org>2019-07-12 10:39:40 +0530
committerMarcel Holtmann <marcel@holtmann.org>2019-08-12 18:23:50 +0200
commita2780889e247561744dd8efbd3478a1999b72ae3 (patch)
treef2b671a852bc48705a7701a91850bd45dd86a75c /drivers/bluetooth/btqca.c
parentBluetooth: btqca: Use correct byte format for opcode of injected command (diff)
downloadlinux-dev-a2780889e247561744dd8efbd3478a1999b72ae3.tar.xz
linux-dev-a2780889e247561744dd8efbd3478a1999b72ae3.zip
Bluetooth: hci_qca: Send VS pre shutdown command.
WCN399x chips are coex chips, it needs a VS pre shutdown command while turning off the BT. So that chip can inform BT is OFF to other active clients. Signed-off-by: Harish Bandi <c-hbandi@codeaurora.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btqca.c')
-rw-r--r--drivers/bluetooth/btqca.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index 81a5c45bdcd9..2221935fac7e 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -99,6 +99,27 @@ static int qca_send_reset(struct hci_dev *hdev)
return 0;
}
+int qca_send_pre_shutdown_cmd(struct hci_dev *hdev)
+{
+ struct sk_buff *skb;
+ int err;
+
+ bt_dev_dbg(hdev, "QCA pre shutdown cmd");
+
+ skb = __hci_cmd_sync(hdev, QCA_PRE_SHUTDOWN_CMD, 0,
+ NULL, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ err = PTR_ERR(skb);
+ bt_dev_err(hdev, "QCA preshutdown_cmd failed (%d)", err);
+ return err;
+ }
+
+ kfree_skb(skb);
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(qca_send_pre_shutdown_cmd);
+
static void qca_tlv_check_data(struct rome_config *config,
const struct firmware *fw)
{