Skip to content

Commit 6a9e38d

Browse files
committed
drivers: uhc: use correct endpoint type and interval
For usb xfer, set endpoint type and interval by the selected endpoint desc. Signed-off-by: Aiden Hu <[email protected]>
1 parent c6e01aa commit 6a9e38d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/usb/uhc/uhc_common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ struct uhc_transfer *uhc_xfer_alloc(const struct device *dev,
111111
}
112112

113113
if (ep_idx == 0) {
114+
interval = 0;
115+
type = USB_EP_TYPE_CONTROL;
114116
mps = udev->dev_desc.bMaxPacketSize0;
115117
} else {
116118
struct usb_ep_descriptor *ep_desc;

drivers/usb/uhc/uhc_mcux_common.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ static usb_host_pipe_handle uhc_mcux_check_hal_ep(const struct device *dev,
244244
}
245245
}
246246

247-
/* TODO: need to check endpoint type too */
248-
if (mcux_ep != NULL &&
247+
if (mcux_ep != NULL && mcux_ep->pipeType == xfer->type &&
249248
(mcux_ep->maxPacketSize != xfer->mps ||
250249
mcux_ep->interval != xfer->interval)) {
251250
/* re-initialize the ep */

0 commit comments

Comments
 (0)