Add boot delay and handshake retry logic
- Add 100ms delay before device initialization to allow USB power stabilization - Implement retry logic (3 attempts) for initial handshake with 50ms between retries - Warn on each failed handshake attempt This addresses enumeration failures during system boot where the US-200 needs additional time to become ready after USB bus power-up.
This commit is contained in:
parent
b0f6666867
commit
3e1e602910
11
us144mkii.c
11
us144mkii.c
|
|
@ -253,9 +253,18 @@ static int tascam_probe(struct usb_interface *intf, const struct usb_device_id *
|
|||
goto free_card;
|
||||
}
|
||||
|
||||
usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), VENDOR_REQ_MODE_CONTROL,
|
||||
msleep(100);
|
||||
|
||||
for (int retry = 0; retry < 3; retry++) {
|
||||
int handshake_result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), VENDOR_REQ_MODE_CONTROL,
|
||||
RT_D2H_VENDOR_DEV, MODE_VAL_HANDSHAKE_READ, 0x0000,
|
||||
tascam->scratch_buf, 1, USB_CTRL_TIMEOUT_MS);
|
||||
if (handshake_result >= 0)
|
||||
break;
|
||||
|
||||
dev_warn(&dev->dev, "Handshake failed (attempt %d/3), retrying...\n", retry + 1);
|
||||
msleep(50);
|
||||
}
|
||||
|
||||
usb_set_interface(dev, 0, 1);
|
||||
usb_set_interface(dev, 1, 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue