Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86:intel/pmc: Call pmc_get_low_power_modes from platform init

In order to setup a table of low power mode requirements for Meteor Lake,
pmc_core_get_low_power_modes() will need to be run from platform init code
so that the enabled modes are known, allowing the use of the
pmc_for_each_mode helper. Make the function global and call it from the
platform init code.

Signed-off-by: Xi Pardee <xi.pardee@intel.com>
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20231129222132.2331261-12-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>

authored by

Xi Pardee and committed by
Hans de Goede
2e35e3aa 416eeb2e

+30 -7
+2
drivers/platform/x86/intel/pmc/adl.c
··· 319 319 if (ret) 320 320 return ret; 321 321 322 + pmc_core_get_low_power_modes(pmcdev); 323 + 322 324 /* Due to a hardware limitation, the GBE LTR blocks PC10 323 325 * when a cable is attached. Tell the PMC to ignore it. 324 326 */
+2
drivers/platform/x86/intel/pmc/cnp.c
··· 214 214 if (ret) 215 215 return ret; 216 216 217 + pmc_core_get_low_power_modes(pmcdev); 218 + 217 219 /* Due to a hardware limitation, the GBE LTR blocks PC10 218 220 * when a cable is attached. Tell the PMC to ignore it. 219 221 */
+3 -4
drivers/platform/x86/intel/pmc/core.c
··· 966 966 return true; 967 967 } 968 968 969 - static void pmc_core_get_low_power_modes(struct platform_device *pdev) 969 + void pmc_core_get_low_power_modes(struct pmc_dev *pmcdev) 970 970 { 971 - struct pmc_dev *pmcdev = platform_get_drvdata(pdev); 972 971 struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; 973 972 u8 pri_order[LPM_MAX_NUM_MODES] = LPM_DEFAULT_PRI; 974 973 u8 mode_order[LPM_MAX_NUM_MODES]; ··· 999 1000 for (mode = 0; mode < LPM_MAX_NUM_MODES; mode++) 1000 1001 pri_order[mode_order[mode]] = mode; 1001 1002 else 1002 - dev_warn(&pdev->dev, "Assuming a default substate order for this platform\n"); 1003 + dev_warn(&pmcdev->pdev->dev, 1004 + "Assuming a default substate order for this platform\n"); 1003 1005 1004 1006 /* 1005 1007 * Loop through all modes from lowest to highest priority, ··· 1250 1250 } 1251 1251 1252 1252 pmcdev->pmc_xram_read_bit = pmc_core_check_read_lock_bit(primary_pmc); 1253 - pmc_core_get_low_power_modes(pdev); 1254 1253 pmc_core_do_dmi_quirks(primary_pmc); 1255 1254 1256 1255 pmc_core_dbgfs_register(pmcdev);
+1
drivers/platform/x86/intel/pmc/core.h
··· 490 490 491 491 int pmc_core_resume_common(struct pmc_dev *pmcdev); 492 492 int get_primary_reg_base(struct pmc *pmc); 493 + extern void pmc_core_get_low_power_modes(struct pmc_dev *pmcdev); 493 494 494 495 extern void pmc_core_ssram_init(struct pmc_dev *pmcdev); 495 496
+9 -1
drivers/platform/x86/intel/pmc/icl.c
··· 53 53 int icl_core_init(struct pmc_dev *pmcdev) 54 54 { 55 55 struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; 56 + int ret; 56 57 57 58 pmc->map = &icl_reg_map; 58 - return get_primary_reg_base(pmc); 59 + 60 + ret = get_primary_reg_base(pmc); 61 + if (ret) 62 + return ret; 63 + 64 + pmc_core_get_low_power_modes(pmcdev); 65 + 66 + return ret; 59 67 }
+3 -1
drivers/platform/x86/intel/pmc/mtl.c
··· 985 985 int mtl_core_init(struct pmc_dev *pmcdev) 986 986 { 987 987 struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC]; 988 - int ret = 0; 988 + int ret; 989 989 990 990 mtl_d3_fixup(); 991 991 ··· 1001 1001 if (ret) 1002 1002 return ret; 1003 1003 } 1004 + 1005 + pmc_core_get_low_power_modes(pmcdev); 1004 1006 1005 1007 /* Due to a hardware limitation, the GBE LTR blocks PC10 1006 1008 * when a cable is attached. Tell the PMC to ignore it.
+9 -1
drivers/platform/x86/intel/pmc/spt.c
··· 137 137 int spt_core_init(struct pmc_dev *pmcdev) 138 138 { 139 139 struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN]; 140 + int ret; 140 141 141 142 pmc->map = &spt_reg_map; 142 - return get_primary_reg_base(pmc); 143 + 144 + ret = get_primary_reg_base(pmc); 145 + if (ret) 146 + return ret; 147 + 148 + pmc_core_get_low_power_modes(pmcdev); 149 + 150 + return ret; 143 151 }
+1
drivers/platform/x86/intel/pmc/tgl.c
··· 263 263 if (ret) 264 264 return ret; 265 265 266 + pmc_core_get_low_power_modes(pmcdev); 266 267 pmc_core_get_tgl_lpm_reqs(pmcdev->pdev); 267 268 /* Due to a hardware limitation, the GBE LTR blocks PC10 268 269 * when a cable is attached. Tell the PMC to ignore it.