Skip to content

Commit d7665d2

Browse files
committed
drivers: uhc: correct interval usage for usb xfer
Convert xfer's interval to actual value because mcux_ep->interval is already calculated. Signed-off-by: Aiden Hu <[email protected]>
1 parent 90a6f22 commit d7665d2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/usb/uhc/uhc_mcux_common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static usb_host_pipe_handle uhc_mcux_check_hal_ep(const struct device *dev,
246246

247247
if (mcux_ep != NULL && mcux_ep->pipeType == xfer->type &&
248248
(mcux_ep->maxPacketSize != xfer->mps ||
249-
mcux_ep->interval != xfer->interval)) {
249+
priv->mcux_eps_interval[i] != xfer->interval)) {
250250
/* re-initialize the ep */
251251
status = priv->mcux_if->controllerClosePipe(priv->mcux_host.controllerHandle,
252252
mcux_ep);
@@ -256,6 +256,7 @@ static usb_host_pipe_handle uhc_mcux_check_hal_ep(const struct device *dev,
256256

257257
uhc_mcux_lock(dev);
258258
priv->mcux_eps[i] = NULL;
259+
priv->mcux_eps_interval[i] = 0;
259260
uhc_mcux_unlock(dev);
260261
mcux_ep = NULL;
261262
}
@@ -309,6 +310,7 @@ usb_host_pipe_t *uhc_mcux_init_hal_ep(const struct device *dev, struct uhc_trans
309310
for (i = 0; i < USB_HOST_CONFIG_MAX_PIPES; i++) {
310311
if (priv->mcux_eps[i] == NULL) {
311312
priv->mcux_eps[i] = mcux_ep;
313+
priv->mcux_eps_interval[i] = xfer->interval;
312314
break;
313315
}
314316
}

drivers/usb/uhc/uhc_mcux_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ struct uhc_mcux_data {
1212
const usb_host_controller_interface_t *mcux_if;
1313
/* TODO: Maybe make it to link with udev->ep_in and udev->ep_out */
1414
usb_host_pipe_t *mcux_eps[USB_HOST_CONFIG_MAX_PIPES];
15+
uint16_t mcux_eps_interval[USB_HOST_CONFIG_MAX_PIPES];
1516
usb_host_instance_t mcux_host;
1617
struct k_thread drv_stack_data;
1718
uint8_t controller_id; /* MCUX hal controller id, 0xFF is invalid value */

0 commit comments

Comments
 (0)