user3267021
user3267021

Reputation: 19

USB Runtime suspend and Resume implementation in DWC3 USB controller

I'm new to USB power management and i have requirement to implement USB Run-time Suspend and Resume. My development board has DWC3 USB controller. According to the spec this DWC3 controller generates SUSPEND interrupt for 3.5 msec.

I want to know how can i configure this controller so that it can generates SUSPEND/RESUME interrupt. I referred Linux USB driver but i couldn't find proper info.

Please provide me detailed info if possible.

Upvotes: 0

Views: 1187

Answers (2)

user3267021
user3267021

Reputation: 19

My understanding was wrong w.r.t requirement. I had to implement USB Hibernation(L2 suspend) feature. For this We receive an event "Hibernation event" when host is suspended. Now feature is implemented and working fine. Need to register for Hibernation event from DEVENT register of DWC3 controller.

Upvotes: 0

Shaibal
Shaibal

Reputation: 925

Ok let me fix some terminology you used.

Its called Suspend signalling and Resume signalling.

According to the spec this DWC3 controller generates SUSPEND interrupt for 3.5 msec.

Its a general requirement. Any USB device or hub connected to host will start transitioning to Suspend state when it sees 3 ms of idle signalling/state on the bus.

I want to know how can i configure this controller so that it can generates SUSPEND/RESUME interrupt.

Again its not interrupt, its signalling. You can not generate those signals. Those will be generated by the controller. You have to tell controller to start suspend signalling.
That can be done by writing PORTSC register with link state U3.

I referred Linux USB driver but i couldn't find proper info.

As I said that you have to write link state U3 to start Suspend signalling, please check below API's in drivers/usb/core/hub.c on how to enable suspend and resume signalling.

usb_port_suspend()
usb_port_resume()

EDIT 1- To know more about Suspend and resume signalling, refer the USB 3.0 specification.

EDIT 2 - Remember that in case of hub, USB 3.0 dictates that global suspend is not supported anymore. So its always a specific port suspend on a hub.

EDIT 3 - The requirement of 3 ms to go to suspend is specific to USB 2.0 and its not valid for USB 3.0 ports.

Upvotes: 1

Related Questions