Merge tag 'pm-5.3-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[linux-2.6-block.git] / drivers / thermal / intel / int340x_thermal / processor_thermal_device.c
index 06c7ab317dee4767426abcc593497fd190d46c31..213ab3cc6b8069a27b2ccd1c51c7a671a8a76b44 100644 (file)
@@ -603,6 +603,22 @@ static void  proc_thermal_pci_remove(struct pci_dev *pdev)
        proc_thermal_remove(proc_priv);
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int proc_thermal_resume(struct device *dev)
+{
+       struct proc_thermal_device *proc_dev;
+
+       proc_dev = dev_get_drvdata(dev);
+       proc_thermal_read_ppcc(proc_dev);
+
+       return 0;
+}
+#else
+#define proc_thermal_resume NULL
+#endif
+
+static SIMPLE_DEV_PM_OPS(proc_thermal_pm, NULL, proc_thermal_resume);
+
 static const struct pci_device_id proc_thermal_pci_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_PROC_BDW_THERMAL)},
        { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_PROC_HSB_THERMAL)},
@@ -626,6 +642,7 @@ static struct pci_driver proc_thermal_pci_driver = {
        .probe          = proc_thermal_pci_probe,
        .remove         = proc_thermal_pci_remove,
        .id_table       = proc_thermal_pci_ids,
+       .driver.pm      = &proc_thermal_pm,
 };
 
 static const struct acpi_device_id int3401_device_ids[] = {
@@ -640,6 +657,7 @@ static struct platform_driver int3401_driver = {
        .driver = {
                .name = "int3401 thermal",
                .acpi_match_table = int3401_device_ids,
+               .pm = &proc_thermal_pm,
        },
 };