aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/platform/x86/intel/pmc/spt.c
diff options
context:
space:
mode:
authorXi Pardee <xi.pardee@linux.intel.com>2025-02-11 17:05:56 -0800
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2025-02-13 14:49:03 +0200
commitd026feb03bdcde33e22a75777d59ed9d8725bcdd (patch)
tree354f6d09c517cbd82477077820b66fe567a2fb39 /drivers/platform/x86/intel/pmc/spt.c
parentsonypi: Use str_on_off() helper in sonypi_display_info() (diff)
downloadwireguard-linux-d026feb03bdcde33e22a75777d59ed9d8725bcdd.tar.xz
wireguard-linux-d026feb03bdcde33e22a75777d59ed9d8725bcdd.zip
platform/x86:intel/pmc: Move arch specific action to init function
Move arch specific action from core.c to the init() function of spt.c. Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com> Link: https://lore.kernel.org/r/20250212010621.1003663-1-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/spt.c')
-rw-r--r--drivers/platform/x86/intel/pmc/spt.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel/pmc/spt.c b/drivers/platform/x86/intel/pmc/spt.c
index 956b2ec1c751..440594acac6c 100644
--- a/drivers/platform/x86/intel/pmc/spt.c
+++ b/drivers/platform/x86/intel/pmc/spt.c
@@ -8,6 +8,8 @@
*
*/
+#include <linux/pci.h>
+
#include "core.h"
const struct pmc_bit_map spt_pll_map[] = {
@@ -134,6 +136,25 @@ const struct pmc_reg_map spt_reg_map = {
.pm_vric1_offset = SPT_PMC_VRIC1_OFFSET,
};
+static const struct pci_device_id spt_pmc_pci_id[] = {
+ { PCI_VDEVICE(INTEL, SPT_PMC_PCI_DEVICE_ID) },
+ { }
+};
+
+static int spt_core_init(struct pmc_dev *pmcdev, struct pmc_dev_info *pmc_dev_info)
+{
+ /*
+ * Coffee Lake has CPU ID of Kaby Lake and Cannon Lake PCH. So here
+ * Sunrisepoint PCH regmap can't be used. Use Cannon Lake PCH regmap
+ * in this case.
+ */
+ if (!pci_dev_present(spt_pmc_pci_id))
+ return generic_core_init(pmcdev, &cnp_pmc_dev);
+
+ return generic_core_init(pmcdev, pmc_dev_info);
+}
+
struct pmc_dev_info spt_pmc_dev = {
.map = &spt_reg_map,
+ .init = spt_core_init,
};