• R
    PM / Domains: Rework system suspend callback routines (v2) · d23b9b00
    Rafael J. Wysocki 提交于
    The current generic PM domains code attempts to use the generic
    system suspend operations along with the domains' device stop/start
    routines, which requires device drivers to assume that their
    system suspend/resume (and hibernation/restore) callbacks will always
    be used with generic PM domains.  However, in theory, the same
    hardware may be used in devices that don't belong to any PM domain,
    in which case it would be necessary to add "fake" PM domains to
    satisfy the above assumption.  Also, the domain the hardware belongs
    to may not be handled with the help of the generic code.
    
    To allow device drivers that may be used along with the generic PM
    domains code of more flexibility, add new device callbacks,
    .suspend(), .suspend_late(), .resume_early(), .resume(), .freeze(),
    .freeze_late(), .thaw_early(), and .thaw(), that can be supplied by
    the drivers in addition to their "standard" system suspend and
    hibernation callbacks.  These new callbacks, if defined, will be used
    by the generic PM domains code for the handling of system suspend and
    hibernation instead of the "standard" ones.  This will allow drivers
    to be designed to work with generic PM domains as well as without
    them.
    
    For backwards compatibility, introduce default implementations of the
    new callbacks for PM domains that will execute pm_generic_suspend(),
    pm_generic_suspend_noirq(), pm_generic_resume_noirq(),
    pm_generic_resume(), pm_generic_freeze(), pm_generic_freeze_noirq(),
    pm_generic_thaw_noirq(), and pm_generic_thaw(), respectively, for the
    given device if its driver doesn't define those callbacks.
    Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
    d23b9b00
domain.c 37.6 KB