Skip to content

Commit 500ede9

Browse files
AidenHuJosuah Demangeon
authored andcommitted
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 9463c45 commit 500ede9

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
@@ -245,7 +245,7 @@ static usb_host_pipe_handle uhc_mcux_check_hal_ep(const struct device *dev,
245245

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

256256
uhc_mcux_lock(dev);
257257
priv->mcux_eps[i] = NULL;
258+
priv->mcux_eps_interval[i] = 0;
258259
uhc_mcux_unlock(dev);
259260
mcux_ep = NULL;
260261
}
@@ -308,6 +309,7 @@ usb_host_pipe_t *uhc_mcux_init_hal_ep(const struct device *dev, struct uhc_trans
308309
for (i = 0; i < USB_HOST_CONFIG_MAX_PIPES; i++) {
309310
if (priv->mcux_eps[i] == NULL) {
310311
priv->mcux_eps[i] = mcux_ep;
312+
priv->mcux_eps_interval[i] = xfer->interval;
311313
break;
312314
}
313315
}

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)