• Rafael J. Wysocki's avatar
    PCI PM: Introduce function pci_wake_from_d3 · 0235c4fc
    Rafael J. Wysocki authored
    Many device drivers use the following sequence of statements to enable
    the device to wake up the system while being in the D3_hot or D3_cold
    low power state:
    
            pci_enable_wake(pdev, PCI_D3hot, 1);
            pci_enable_wake(pdev, PCI_D3cold, 1);
    
    However, the second call is not necessary if the first one succeeds (the
    ordering of the statements above doesn't matter here) and it may even be
    harmful, because we are not supposed to enable PME# after the wake-up
    power has been enabled for the device.
    
    To allow drivers to overcome this problem, introduce function
    pci_wake_from_d3() that will enable the device to wake up the system
    from any of D3_hot and D3_cold as long as the wake-up from at least one
    of them is supported.
    Acked-by: default avatarPavel Machek <pavel@suse.cz>
    Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
    Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
    0235c4fc
pci.c 50.3 KB