> > Introduce runtime PM and wakeup interrupt handler for cdns3, > > the runtime PM is default off since other cdns3 has not implemented > > glue layer support for runtime PM. > > > > When the controller is in low power mode, the lpm flag will be set. > > The interrupt triggered later than lpm flag is set considers as > > wakeup interrupt and handled at cdns_drd_irq. > Wonder to know that CPUs may be powered off in this case? Yes > Do you consider the case when usb controller is in low power mode, and > also power off CPUs, then how to wakeup usb controller? > About USB wakeup for system suspend, there are still some works need to do for this driver, will do later. For system wakeup, it is platform specific. If the main cores are powered off totally, and do not respond any wakeup events, it needs the other core to get this wakeup event, and power on main cores. After main cores are powered on, the wakeup interrupt status are there (if controller is not powered off), the controller driver could handle this wakeup event. Peter > Thanks > > > Once the wakeup > > occurs, it first disables interrupt to avoid later interrupt > > occurrence since the controller is in low power mode at that > > time, and access registers may be invalid at that time. At wakeup > > handler, it will call pm_runtime_get to wakeup controller, and > > at runtime resume handler, it will enable interrupt again. > > > > The API platform_suspend is introduced for glue layer to implement > > platform specific PM sequence. > > > > Signed-off-by: Peter Chen <peter.chen@xxxxxxx> > > --- > > drivers/usb/cdns3/core.c | 119 +++++++++++++++++++++++++++++++------ > > drivers/usb/cdns3/core.h | 14 +++++ > > drivers/usb/cdns3/drd.c | 7 +++ > > drivers/usb/cdns3/gadget.c | 4 ++ > > drivers/usb/cdns3/host.c | 7 +++ > > 5 files changed, 134 insertions(+), 17 deletions(-) >