Skip to content

drivers: udc: kinetis/usbd: fixes for v4.0.0 #80727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions drivers/usb/udc/udc_kinetis.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,8 @@ static int usbfsotg_ep_enable(const struct device *dev,
if (cfg->addr == USB_CONTROL_EP_OUT) {
struct net_buf *buf;

priv->busy[0] = false;
priv->busy[1] = false;
buf = udc_ctrl_alloc(dev, USB_CONTROL_EP_OUT, USBFSOTG_EP0_SIZE);
usbfsotg_bd_set_ctrl(bd_even, buf->size, buf->data, false);
priv->out_buf[0] = buf;
Expand Down
10 changes: 7 additions & 3 deletions drivers/usb/udc/udc_nrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ static void udc_nrf_power_handler(nrfx_power_usb_evt_t pwr_evt)
}
}

static void udc_nrf_fake_status_in(const struct device *dev)
static bool udc_nrf_fake_status_in(const struct device *dev)
{
struct udc_nrf_evt evt = {
.type = UDC_NRF_EVT_STATUS_IN,
Expand All @@ -497,7 +497,10 @@ static void udc_nrf_fake_status_in(const struct device *dev)
if (nrf_usbd_common_last_setup_dir_get() == USB_CONTROL_EP_OUT) {
/* Let controller perform status IN stage */
k_msgq_put(&drv_msgq, &evt, K_NO_WAIT);
return true;
}

return false;
}

static int udc_nrf_ep_enqueue(const struct device *dev,
Expand All @@ -512,8 +515,9 @@ static int udc_nrf_ep_enqueue(const struct device *dev,
udc_buf_put(cfg, buf);

if (cfg->addr == USB_CONTROL_EP_IN && buf->len == 0) {
udc_nrf_fake_status_in(dev);
return 0;
if (udc_nrf_fake_status_in(dev)) {
return 0;
}
}

k_msgq_put(&drv_msgq, &evt, K_NO_WAIT);
Expand Down
Loading