Skip to content

Commit

Permalink
Revert "Bluetooth: hci_ll: set operational frequency earlier"
Browse files Browse the repository at this point in the history
As nice as it would be to update firmware faster, that patch broke
at least two different boards, an OMAP4+WL1285 based Motorola Droid
4, as reported by Sebasian Reichel and the Logic PD i.MX6Q +
WL1837MOD.

This reverts commit a2e02f3.

Signed-off-by: Adam Ford <aford173@gmail.com>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: stable@vger.kernel.org
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Adam Ford authored and Marcel Holtmann committed Oct 16, 2019
1 parent c0a21a5 commit cef456c
Showing 1 changed file with 18 additions and 21 deletions.
39 changes: 18 additions & 21 deletions drivers/bluetooth/hci_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,6 @@ static int ll_setup(struct hci_uart *hu)

serdev_device_set_flow_control(serdev, true);

if (hu->oper_speed)
speed = hu->oper_speed;
else if (hu->proto->oper_speed)
speed = hu->proto->oper_speed;
else
speed = 0;

do {
/* Reset the Bluetooth device */
gpiod_set_value_cansleep(lldev->enable_gpio, 0);
Expand All @@ -639,20 +632,6 @@ static int ll_setup(struct hci_uart *hu)
return err;
}

if (speed) {
__le32 speed_le = cpu_to_le32(speed);
struct sk_buff *skb;

skb = __hci_cmd_sync(hu->hdev,
HCI_VS_UPDATE_UART_HCI_BAUDRATE,
sizeof(speed_le), &speed_le,
HCI_INIT_TIMEOUT);
if (!IS_ERR(skb)) {
kfree_skb(skb);
serdev_device_set_baudrate(serdev, speed);
}
}

err = download_firmware(lldev);
if (!err)
break;
Expand All @@ -677,7 +656,25 @@ static int ll_setup(struct hci_uart *hu)
}

/* Operational speed if any */
if (hu->oper_speed)
speed = hu->oper_speed;
else if (hu->proto->oper_speed)
speed = hu->proto->oper_speed;
else
speed = 0;

if (speed) {
__le32 speed_le = cpu_to_le32(speed);
struct sk_buff *skb;

skb = __hci_cmd_sync(hu->hdev, HCI_VS_UPDATE_UART_HCI_BAUDRATE,
sizeof(speed_le), &speed_le,
HCI_INIT_TIMEOUT);
if (!IS_ERR(skb)) {
kfree_skb(skb);
serdev_device_set_baudrate(serdev, speed);
}
}

return 0;
}
Expand Down

0 comments on commit cef456c

Please sign in to comment.