Skip to content
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

drivers: udc_rpi_pico: replace message queue with k_events and minor fixes #87506

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jfischer-no
Copy link
Collaborator

Replace message queue with k_events, support VBUS state change detection, fix clear/set endpoint halt.

Set suspended state on suspend/resume ISR.

Signed-off-by: Johann Fischer <[email protected]>
Using k_events eliminates the drawback of the queue potentially dropping
messages and provides a reliable event notification mechanism. It is
similar to commit c2f2d8c
("drivers: usb: udc_dwc2: Replace queue with events")

Signed-off-by: Johann Fischer <[email protected]>
Support VBUS state change detection and enable/disable DP pull-up
according to VBUS state when pinctrl property is provided.

It brings the similar functionality introduced in commit 4c0317f
("drivers: usb_dc_rpi_pico: Implemented vbus detection handling")
for the legacy device controller driver.

Signed-off-by: Johann Fischer <[email protected]>
Mark endpoint as not busy after transfer is canceled.

Signed-off-by: Johann Fischer <[email protected]>
For the IN endpoint, we only need to set/reset the STALL bit in the
endpoint control register.
To set halt on the OUT endpoint, the AVAILABLE bit must also be set,
which is similar to starting a new transfer, but first any transfer in
progress must be canceled.

Signed-off-by: Johann Fischer <[email protected]>
Do not check if the tailroom is greater than or equal to MPS because the
controller does not write directly to the buffer and therefore cannot
write outside the buffer.

Signed-off-by: Johann Fischer <[email protected]>
At high throughput, the controller sometimes fails to start a new
transaction. Clearing the corresponding endpoint bit in the BUFF_STATUS
completion register before initiating a new transaction solves this
problem.

Signed-off-by: Johann Fischer <[email protected]>
@jfischer-no jfischer-no added area: Drivers area: USB Universal Serial Bus Experimental Experimental features not enabled by default labels Mar 22, 2025
@jfischer-no jfischer-no requested a review from tmon-nordic March 22, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Drivers area: USB Universal Serial Bus Experimental Experimental features not enabled by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant