• Lukas Wunner's avatar
    PCI: Query platform firmware for device power state · cc7cc02b
    Lukas Wunner authored
    Usually the most accurate way to determine a PCI device's power state is to
    read its PM Control & Status Register.  There are two cases however when
    this is not an option:  If the device doesn't have the PM capability at
    all, or if it is in D3cold (in which case its config space is
    inaccessible).
    
    In both cases, we can alternatively query the platform firmware for its
    opinion on the device's power state.  To facilitate this, augment struct
    pci_platform_pm_ops with a ->get_power callback and implement it for
    acpi_pci_platform_pm (the only pci_platform_pm_ops existing so far).
    
    It is used by a forthcoming commit to let pci_update_current_state()
    recognize D3cold.
    Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    cc7cc02b
pci-acpi.c 20.2 KB