Skip to content

Commit

Permalink
Revert "[NOT FOR UPSTREAM] Revert "platform/x86/intel/pmc/mtl: Put GN…
Browse files Browse the repository at this point in the history
…A/IPU/VPU devices in D3""

This reverts commit 743c0c9.

Signed-off-by: Kai Vehmanen <[email protected]>
  • Loading branch information
kv2019i authored and plbossart committed Sep 7, 2023
1 parent b7b593f commit f821d68
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions drivers/platform/x86/intel/pmc/mtl.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*
*/

#include <linux/pci.h>
#include "core.h"

/*
Expand Down Expand Up @@ -942,8 +943,37 @@ static struct pmc_info mtl_pmc_info_list[] = {
{}
};

#define MTL_GNA_PCI_DEV 0x7e4c
#define MTL_IPU_PCI_DEV 0x7d19
#define MTL_VPU_PCI_DEV 0x7d1d
static void mtl_set_device_d3(unsigned int device)
{
struct pci_dev *pcidev;

pcidev = pci_get_device(PCI_VENDOR_ID_INTEL, device, NULL);
if (pcidev) {
if (!device_trylock(&pcidev->dev)) {
pci_dev_put(pcidev);
return;
}
if (!pcidev->dev.driver) {
dev_info(&pcidev->dev, "Setting to D3hot\n");
pci_set_power_state(pcidev, PCI_D3hot);
}
device_unlock(&pcidev->dev);
pci_dev_put(pcidev);
}
}

/*
* Set power state of select devices that do not have drivers to D3
* so that they do not block Package C entry.
*/
static void mtl_d3_fixup(void)
{
mtl_set_device_d3(MTL_GNA_PCI_DEV);
mtl_set_device_d3(MTL_IPU_PCI_DEV);
mtl_set_device_d3(MTL_VPU_PCI_DEV);
}

static int mtl_resume(struct pmc_dev *pmcdev)
Expand Down

0 comments on commit f821d68

Please sign in to comment.