Skip to content

Commit 7c13f36

Browse files
debox1ij-intel
authored andcommitted
platform/x86/intel/pmc: Add suspend callback
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 8049512 ("platform/x86:intel/pmc: Combine core_init() and core_configure()"). Fixes: 8049512 ("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>
1 parent b28ff7a commit 7c13f36

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/platform/x86/intel/pmc/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,9 @@ static __maybe_unused int pmc_core_suspend(struct device *dev)
12791279
struct pmc_dev *pmcdev = dev_get_drvdata(dev);
12801280
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
12811281

1282+
if (pmcdev->suspend)
1283+
pmcdev->suspend(pmcdev);
1284+
12821285
/* Check if the syspend will actually use S0ix */
12831286
if (pm_suspend_via_firmware())
12841287
return 0;

drivers/platform/x86/intel/pmc/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ struct pmc {
363363
* @s0ix_counter: S0ix residency (step adjusted)
364364
* @num_lpm_modes: Count of enabled modes
365365
* @lpm_en_modes: Array of enabled modes from lowest to highest priority
366+
* @suspend: Function to perform platform specific suspend
366367
* @resume: Function to perform platform specific resume
367368
*
368369
* pmc_dev contains info about power management controller device.
@@ -379,6 +380,7 @@ struct pmc_dev {
379380
u64 s0ix_counter;
380381
int num_lpm_modes;
381382
int lpm_en_modes[LPM_MAX_NUM_MODES];
383+
void (*suspend)(struct pmc_dev *pmcdev);
382384
int (*resume)(struct pmc_dev *pmcdev);
383385

384386
bool has_die_c6;

0 commit comments

Comments
 (0)