• Peter Chen's avatar
    usb: cdns3: add runtime PM support · b1234e3b
    Peter Chen authored
    Introduce runtime PM and wakeup interrupt handler for cdns3,
    the runtime PM is default off since other cdns3 may not
    implement glue layer support for runtime PM.
    
    One typical wakeup event use case is xHCI runtime suspend will clear
    USBCMD.RS bit, after that the xHCI will not trigger any interrupts,
    so its parent (cdns core device) needs to resume xHCI device when
    any (wakeup) events occurs at host port.
    
    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_wakeup_irq. 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_request_resume to wakeup xHCI device, 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.
    Reviewed-by: default avatarPawel Laszczak <pawell@cadence.com>
    Signed-off-by: default avatarPeter Chen <peter.chen@nxp.com>
    Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
    b1234e3b
core.c 16.1 KB