summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btintel.c
diff options
context:
space:
mode:
authorChethan T N <chethan.tumkur.narayan@intel.com>2020-06-08 14:27:47 +0200
committerMarcel Holtmann <marcel@holtmann.org>2020-06-10 10:07:36 +0200
commitc453b10c2b28580849e382565c2e8a18ecc8bc24 (patch)
treea6a83847c709cc8d9aa2d26e66b20a5b423e3e59 /drivers/bluetooth/btintel.c
parentBluetooth: btusb: Add support to read Intel debug feature (diff)
downloadlinux-c453b10c2b28580849e382565c2e8a18ecc8bc24.tar.xz
linux-c453b10c2b28580849e382565c2e8a18ecc8bc24.zip
Bluetooth: btusb: Configure Intel debug feature based on available support
This patch shall enable the Intel telemetry exception format based on the supported features Signed-off-by: Chethan T N <chethan.tumkur.narayan@intel.com> Signed-off-by: Ps AyappadasX <AyappadasX.Ps@intel.com> Signed-off-by: Kiran K <kiran.k@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btintel.c')
-rw-r--r--drivers/bluetooth/btintel.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c
index 105ab28836b8..5fa5be3c5598 100644
--- a/drivers/bluetooth/btintel.c
+++ b/drivers/bluetooth/btintel.c
@@ -786,6 +786,33 @@ int btintel_read_debug_features(struct hci_dev *hdev,
}
EXPORT_SYMBOL_GPL(btintel_read_debug_features);
+int btintel_set_debug_features(struct hci_dev *hdev,
+ const struct intel_debug_features *features)
+{
+ u8 mask[11] = { 0x0a, 0x92, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00 };
+ struct sk_buff *skb;
+
+ if (!features)
+ return -EINVAL;
+
+ if (!(features->page1[0] & 0x3f)) {
+ bt_dev_info(hdev, "Telemetry exception format not supported");
+ return 0;
+ }
+
+ skb = __hci_cmd_sync(hdev, 0xfc8b, 11, mask, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ bt_dev_err(hdev, "Setting Intel telemetry ddc write event mask failed (%ld)",
+ PTR_ERR(skb));
+ return PTR_ERR(skb);
+ }
+
+ kfree_skb(skb);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(btintel_set_debug_features);
+
MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION);
MODULE_VERSION(VERSION);