summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btusb.c
diff options
context:
space:
mode:
authorTedd Ho-Jeong An2018-01-24 18:19:18 +0100
committerMarcel Holtmann2018-01-24 19:31:49 +0100
commite5889af62fce081dbd2e5d087683b9b7135bc731 (patch)
tree0391b8591efb6ff15872fb237964936ebb8e9de2 /drivers/bluetooth/btusb.c
parentBluetooth: hci_intel: Update firmware filename for Intel 9x60 and later (diff)
downloadkernel-qcow2-linux-e5889af62fce081dbd2e5d087683b9b7135bc731.tar.gz
kernel-qcow2-linux-e5889af62fce081dbd2e5d087683b9b7135bc731.tar.xz
kernel-qcow2-linux-e5889af62fce081dbd2e5d087683b9b7135bc731.zip
Bluetooth: btintel: Create common function for Intel Reset
The Intel_Reset command is used to reset the device after downloading the firmware and this is Intel generic command used in both USB and UART. Signed-off-by: Tedd Ho-Jeong An <tedd.an@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth/btusb.c')
-rw-r--r--drivers/bluetooth/btusb.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 29977ebfd031..93db5b9f5376 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2009,8 +2009,6 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb)
static int btusb_setup_intel_new(struct hci_dev *hdev)
{
- static const u8 reset_param[] = { 0x00, 0x01, 0x00, 0x01,
- 0x00, 0x08, 0x04, 0x00 };
struct btusb_data *data = hci_get_drvdata(hdev);
struct sk_buff *skb;
struct intel_version ver;
@@ -2018,6 +2016,7 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
const struct firmware *fw;
const u8 *fw_ptr;
u32 frag_len;
+ u32 boot_param;
char fwname[64];
ktime_t calltime, delta, rettime;
unsigned long long duration;
@@ -2025,6 +2024,9 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
BT_DBG("%s", hdev->name);
+ /* The default boot parameter */
+ boot_param = 0x00040800;
+
calltime = ktime_get();
/* Read the Intel version information to determine if the device
@@ -2341,12 +2343,9 @@ done:
set_bit(BTUSB_BOOTING, &data->flags);
- skb = __hci_cmd_sync(hdev, 0xfc01, sizeof(reset_param), reset_param,
- HCI_INIT_TIMEOUT);
- if (IS_ERR(skb))
- return PTR_ERR(skb);
-
- kfree_skb(skb);
+ err = btintel_send_intel_reset(hdev, boot_param);
+ if (err)
+ return err;
/* The bootloader will not indicate when the device is ready. This
* is done by the operational firmware sending bootup notification.