Bluetooth: btusb: Fine-tune mt7663 mechanism.

Fine-tune read register for mt7663/mt7921.
For mediatek chip spcific wmt protocol, we add more delay to send EP0
In-Token.

Signed-off-by: Mark Chen <Mark-YW.Chen@mediatek.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Mark Chen 2021-02-02 18:26:17 +08:00 committed by Marcel Holtmann
parent 1bb0c66332
commit 48c13301e6
1 changed files with 6 additions and 5 deletions

View File

@ -3139,6 +3139,7 @@ enum {
enum { enum {
BTMTK_WMT_INVALID, BTMTK_WMT_INVALID,
BTMTK_WMT_PATCH_UNDONE, BTMTK_WMT_PATCH_UNDONE,
BTMTK_WMT_PATCH_PROGRESS,
BTMTK_WMT_PATCH_DONE, BTMTK_WMT_PATCH_DONE,
BTMTK_WMT_ON_UNDONE, BTMTK_WMT_ON_UNDONE,
BTMTK_WMT_ON_DONE, BTMTK_WMT_ON_DONE,
@ -3154,7 +3155,7 @@ struct btmtk_wmt_hdr {
struct btmtk_hci_wmt_cmd { struct btmtk_hci_wmt_cmd {
struct btmtk_wmt_hdr hdr; struct btmtk_wmt_hdr hdr;
u8 data[256]; u8 data[1000];
} __packed; } __packed;
struct btmtk_hci_wmt_evt { struct btmtk_hci_wmt_evt {
@ -3253,7 +3254,7 @@ static void btusb_mtk_wmt_recv(struct urb *urb)
* to generate the event. Otherwise, the WMT event cannot return from * to generate the event. Otherwise, the WMT event cannot return from
* the device successfully. * the device successfully.
*/ */
udelay(100); udelay(500);
usb_anchor_urb(urb, &data->ctrl_anchor); usb_anchor_urb(urb, &data->ctrl_anchor);
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
@ -3556,9 +3557,9 @@ static int btusb_mtk_reg_read(struct btusb_data *data, u32 reg, u32 *val)
return err; return err;
} }
static int btusb_mtk_id_get(struct btusb_data *data, u32 *id) static int btusb_mtk_id_get(struct btusb_data *data, u32 reg, u32 *id)
{ {
return btusb_mtk_reg_read(data, 0x80000008, id); return btusb_mtk_reg_read(data, reg, id);
} }
static int btusb_mtk_setup(struct hci_dev *hdev) static int btusb_mtk_setup(struct hci_dev *hdev)
@ -3576,7 +3577,7 @@ static int btusb_mtk_setup(struct hci_dev *hdev)
calltime = ktime_get(); calltime = ktime_get();
err = btusb_mtk_id_get(data, &dev_id); err = btusb_mtk_id_get(data, 0x80000008, &dev_id);
if (err < 0) { if (err < 0) {
bt_dev_err(hdev, "Failed to get device id (%d)", err); bt_dev_err(hdev, "Failed to get device id (%d)", err);
return err; return err;