Skip to content

Commit

Permalink
platform/x86: intel/pmc: Move variable declarations and definitions t…
Browse files Browse the repository at this point in the history
…o header and core.c

Move the msr_map variable declaration to core.h and move the pmc_lpm_modes
definition to core.c.

This is a prepartory patch for redesigning the pmc core driver as the
variables will be used in multiple PCH specific files.

Cc: David E Box <david.e.box@linux.intel.com>
Reviewed-by: "David E. Box" <david.e.box@linux.intel.com>
Signed-off-by: Xi Pardee <xi.pardee@intel.com>
Signed-off-by: "David E. Box" <david.e.box@linux.intel.com>
Link: https://lore.kernel.org/r/20221114183257.2067662-3-gayatri.kammela@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
  • Loading branch information
Xi Pardee authored and Hans de Goede committed Nov 21, 2022
1 parent 284c01b commit 03c58a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
15 changes: 14 additions & 1 deletion drivers/platform/x86/intel/pmc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,21 @@
#define ACPI_S0IX_DSM_UUID "57a6512e-3979-4e9d-9708-ff13b2508972"
#define ACPI_GET_LOW_MODE_REGISTERS 1

/* Maximum number of modes supported by platfoms that has low power mode capability */
const char *pmc_lpm_modes[] = {
"S0i2.0",
"S0i2.1",
"S0i2.2",
"S0i3.0",
"S0i3.1",
"S0i3.2",
"S0i3.3",
"S0i3.4",
NULL
};

/* PKGC MSRs are common across Intel Core SoCs */
static const struct pmc_bit_map msr_map[] = {
const struct pmc_bit_map msr_map[] = {
{"Package C2", MSR_PKG_C2_RESIDENCY},
{"Package C3", MSR_PKG_C3_RESIDENCY},
{"Package C6", MSR_PKG_C6_RESIDENCY},
Expand Down
13 changes: 2 additions & 11 deletions drivers/platform/x86/intel/pmc/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,7 @@ enum ppfear_regs {
#define ADL_LPM_STATUS_LATCH_EN_OFFSET 0x1704
#define ADL_LPM_LIVE_STATUS_OFFSET 0x1764

static const char *pmc_lpm_modes[] = {
"S0i2.0",
"S0i2.1",
"S0i2.2",
"S0i3.0",
"S0i3.1",
"S0i3.2",
"S0i3.3",
"S0i3.4",
NULL
};
extern const char *pmc_lpm_modes[];

struct pmc_bit_map {
const char *name;
Expand Down Expand Up @@ -346,6 +336,7 @@ struct pmc_dev {
void (*core_configure)(struct pmc_dev *pmcdev);
};

extern const struct pmc_bit_map msr_map[];
void spt_core_init(struct pmc_dev *pmcdev);
void cnp_core_init(struct pmc_dev *pmcdev);
void icl_core_init(struct pmc_dev *pmcdev);
Expand Down

0 comments on commit 03c58a1

Please sign in to comment.