]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
platform/x86/intel/pmc: Add suspend callback
authorDavid E. Box <david.e.box@linux.intel.com>
Sat, 23 Dec 2023 03:25:43 +0000 (19:25 -0800)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 29 Dec 2023 13:31:08 +0000 (15:31 +0200)
Add a suspend callback to struct pmc for performing platform specific tasks
before device suspend. This is needed in order to perform GBE LTR ignore on
certain platforms at suspend-time instead of at probe-time and replace the
GBE LTR ignore removal that was done in order to fix a bug introduced by
commit 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and
core_configure()").

Fixes: 804951203aa5 ("platform/x86:intel/pmc: Combine core_init() and core_configure()")
Signed-off-by: "David E. Box" <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20231223032548.1680738-4-david.e.box@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/intel/pmc/core.c
drivers/platform/x86/intel/pmc/core.h

index e95d3011b9997d5afec7206f9d97f7013132f42c..5ab470d87ad7edcabc8e7d244acbb386699fe6b0 100644 (file)
@@ -1279,6 +1279,9 @@ static __maybe_unused int pmc_core_suspend(struct device *dev)
        struct pmc_dev *pmcdev = dev_get_drvdata(dev);
        struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
 
+       if (pmcdev->suspend)
+               pmcdev->suspend(pmcdev);
+
        /* Check if the syspend will actually use S0ix */
        if (pm_suspend_via_firmware())
                return 0;
index 0729f593c6a7591b331194d95acb25b31398b089..38d888e3afa636c8f0c7236bad86f1cf6c6729ee 100644 (file)
@@ -363,6 +363,7 @@ struct pmc {
  * @s0ix_counter:      S0ix residency (step adjusted)
  * @num_lpm_modes:     Count of enabled modes
  * @lpm_en_modes:      Array of enabled modes from lowest to highest priority
+ * @suspend:           Function to perform platform specific suspend
  * @resume:            Function to perform platform specific resume
  *
  * pmc_dev contains info about power management controller device.
@@ -379,6 +380,7 @@ struct pmc_dev {
        u64 s0ix_counter;
        int num_lpm_modes;
        int lpm_en_modes[LPM_MAX_NUM_MODES];
+       void (*suspend)(struct pmc_dev *pmcdev);
        int (*resume)(struct pmc_dev *pmcdev);
 
        bool has_die_c6;