diff options
author | Xi Pardee <xi.pardee@linux.intel.com> | 2025-02-07 14:56:09 -0800 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2025-02-10 13:14:46 +0200 |
commit | ac6bef0d54014cc010831ec86ac425f482a981ae (patch) | |
tree | a483a29cbd9f8aa16d202c0ff6ab5052b6c85651 /drivers/platform/x86/intel/pmc/adl.c | |
parent | 78eaf4d12d7c4ec6cf2f5ed8d8737ae0da390930 (diff) |
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/adl.c')
-rw-r--r-- | drivers/platform/x86/intel/pmc/adl.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/platform/x86/intel/pmc/adl.c b/drivers/platform/x86/intel/pmc/adl.c index e7878558fd90..ac37f4ece9c7 100644 --- a/drivers/platform/x86/intel/pmc/adl.c +++ b/drivers/platform/x86/intel/pmc/adl.c @@ -311,20 +311,13 @@ const struct pmc_reg_map adl_reg_map = { .pson_residency_counter_step = TGL_PSON_RES_COUNTER_STEP, }; +static struct pmc_dev_info adl_pmc_dev = { + .map = &adl_reg_map, + .suspend = cnl_suspend, + .resume = cnl_resume, +}; + int adl_core_init(struct pmc_dev *pmcdev) { - struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; - int ret; - - pmcdev->suspend = cnl_suspend; - pmcdev->resume = cnl_resume; - - pmc->map = &adl_reg_map; - ret = get_primary_reg_base(pmc); - if (ret) - return ret; - - pmc_core_get_low_power_modes(pmcdev); - - return 0; + return generic_core_init(pmcdev, &adl_pmc_dev); } |