-
Notifications
You must be signed in to change notification settings - Fork 8.2k
usb: device_next: hid: add a suspend callback #99123
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
base: main
Are you sure you want to change the base?
Conversation
Add an optional suspend callback to let a downstream hid driver be notified of HID suspend and resume events. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
|
@jfischer-no using this on an hid device to detect when the host goes into suspend, is this the right thing? Can't quite tell it from the controller apis apparently. |
|
tmon-nordic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach better than relying on USB notifications in the application, because here the call is synchronous and therefore the state never gets out-of-sync.
Ok... what notifications are you referring to though? |
zephyr/subsys/usb/device_next/usbd_core.c Line 154 in df8b43d
zephyr/subsys/usb/device_next/usbd_core.c Line 160 in df8b43d
|
|
@tmon-nordic ok but I think |
No, they are the same. The difference is that zephyr/subsys/usb/device_next/usbd_msg.c Line 38 in df8b43d
when CONFIG_USBD_MSG_DEFERRED_MODE is not enabled.
|
Ok very interesting, well, this is cheap enough and works reliably then... Thanks for the pointers. |



Add an optional suspend callback to let a downstream hid driver be notified of HID suspend and resume events.