diff options
author | Tedd Ho-Jeong An <tedd.an@linux.intel.com> | 2018-01-24 20:19:18 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2018-01-24 21:31:49 +0300 |
commit | e5889af62fce081dbd2e5d087683b9b7135bc731 (patch) | |
tree | 0391b8591efb6ff15872fb237964936ebb8e9de2 /drivers/bluetooth/hci_intel.c | |
parent | 965651c16b9e6212f781d5b619ab78bd82bf54ce (diff) | |
download | linux-e5889af62fce081dbd2e5d087683b9b7135bc731.tar.xz |
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/hci_intel.c')
-rw-r--r-- | drivers/bluetooth/hci_intel.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/bluetooth/hci_intel.c b/drivers/bluetooth/hci_intel.c index 97586848ec97..acac48d0c79c 100644 --- a/drivers/bluetooth/hci_intel.c +++ b/drivers/bluetooth/hci_intel.c @@ -540,8 +540,6 @@ static int intel_set_baudrate(struct hci_uart *hu, unsigned int speed) static int intel_setup(struct hci_uart *hu) { - static const u8 reset_param[] = { 0x00, 0x01, 0x00, 0x01, - 0x00, 0x08, 0x04, 0x00 }; struct intel_data *intel = hu->priv; struct hci_dev *hdev = hu->hdev; struct sk_buff *skb; @@ -552,6 +550,7 @@ static int intel_setup(struct hci_uart *hu) const u8 *fw_ptr; char fwname[64]; u32 frag_len; + u32 boot_param; ktime_t calltime, delta, rettime; unsigned long long duration; unsigned int init_speed, oper_speed; @@ -563,6 +562,9 @@ static int intel_setup(struct hci_uart *hu) hu->hdev->set_diag = btintel_set_diag; hu->hdev->set_bdaddr = btintel_set_bdaddr; + /* Default boot parameter */ + boot_param = 0x00040800; + calltime = ktime_get(); if (hu->init_speed) @@ -911,12 +913,9 @@ done: set_bit(STATE_BOOTING, &intel->flags); - skb = __hci_cmd_sync(hdev, 0xfc01, sizeof(reset_param), reset_param, - HCI_CMD_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. |