aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel/pmc/core.h
diff options
context:
space:
mode:
authorXi Pardee <xi.pardee@linux.intel.com>2025-02-07 14:56:09 -0800
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2025-02-10 13:14:46 +0200
commitac6bef0d54014cc010831ec86ac425f482a981ae (patch)
treea483a29cbd9f8aa16d202c0ff6ab5052b6c85651 /drivers/platform/x86/intel/pmc/core.h
parentplatform/x86/intel/pmc: Remove duplicate enum (diff)
downloadlinux-ac6bef0d54014cc010831ec86ac425f482a981ae.tar.gz
linux-ac6bef0d54014cc010831ec86ac425f482a981ae.zip
platform/x86:intel/pmc: Create generic_core_init() for all platforms
Create a generic_core_init() function for all architectures to reduce duplicate code in each architecture file. Create an info structure to catch the variations between each architecture and pass it to the generic init function. Convert all architectures to call the generic core init function. Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com> Link: https://lore.kernel.org/r/20250207225615.401235-4-xi.pardee@linux.intel.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/intel/pmc/core.h')
-rw-r--r--drivers/platform/x86/intel/pmc/core.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h
index a0f6cc427ddc..7c9e999ee631 100644
--- a/drivers/platform/x86/intel/pmc/core.h
+++ b/drivers/platform/x86/intel/pmc/core.h
@@ -435,6 +435,27 @@ enum pmc_index {
PMC_IDX_MAX
};
+/**
+ * struct pmc_dev_info - Structure to keep PMC device info
+ * @pci_func: Function number of the primary PMC
+ * @dmu_guid: Die Management Unit GUID
+ * @regmap_list: Pointer to a list of pmc_info structure that could be
+ * available for the platform. When set, this field implies
+ * SSRAM support.
+ * @map: Pointer to a pmc_reg_map struct that contains platform
+ * specific attributes of the primary PMC
+ * @suspend: Function to perform platform specific suspend
+ * @resume: Function to perform platform specific resume
+ */
+struct pmc_dev_info {
+ u8 pci_func;
+ u32 dmu_guid;
+ struct pmc_info *regmap_list;
+ const struct pmc_reg_map *map;
+ void (*suspend)(struct pmc_dev *pmcdev);
+ int (*resume)(struct pmc_dev *pmcdev);
+};
+
extern const struct pmc_bit_map msr_map[];
extern const struct pmc_bit_map spt_pll_map[];
extern const struct pmc_bit_map spt_mphy_map[];
@@ -591,6 +612,7 @@ extern void pmc_core_set_device_d3(unsigned int device);
extern int pmc_core_ssram_init(struct pmc_dev *pmcdev, int func);
+int generic_core_init(struct pmc_dev *pmcdev, struct pmc_dev_info *pmc_dev_info);
int spt_core_init(struct pmc_dev *pmcdev);
int cnp_core_init(struct pmc_dev *pmcdev);
int icl_core_init(struct pmc_dev *pmcdev);