File tree Expand file tree Collapse file tree 8 files changed +30
-7
lines changed
drivers/platform/x86/intel/pmc Expand file tree Collapse file tree 8 files changed +30
-7
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,8 @@ int adl_core_init(struct pmc_dev *pmcdev)
319319 if (ret )
320320 return ret ;
321321
322+ pmc_core_get_low_power_modes (pmcdev );
323+
322324 /* Due to a hardware limitation, the GBE LTR blocks PC10
323325 * when a cable is attached. Tell the PMC to ignore it.
324326 */
Original file line number Diff line number Diff line change @@ -214,6 +214,8 @@ int cnp_core_init(struct pmc_dev *pmcdev)
214214 if (ret )
215215 return ret ;
216216
217+ pmc_core_get_low_power_modes (pmcdev );
218+
217219 /* Due to a hardware limitation, the GBE LTR blocks PC10
218220 * when a cable is attached. Tell the PMC to ignore it.
219221 */
Original file line number Diff line number Diff line change @@ -966,9 +966,8 @@ static bool pmc_core_pri_verify(u32 lpm_pri, u8 *mode_order)
966966 return true;
967967}
968968
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 )
970970{
971- struct pmc_dev * pmcdev = platform_get_drvdata (pdev );
972971 struct pmc * pmc = pmcdev -> pmcs [PMC_IDX_MAIN ];
973972 u8 pri_order [LPM_MAX_NUM_MODES ] = LPM_DEFAULT_PRI ;
974973 u8 mode_order [LPM_MAX_NUM_MODES ];
@@ -1000,7 +999,8 @@ static void pmc_core_get_low_power_modes(struct platform_device *pdev)
1000999 for (mode = 0 ; mode < LPM_MAX_NUM_MODES ; mode ++ )
10011000 pri_order [mode_order [mode ]] = mode ;
10021001 else
1003- dev_warn (& pdev -> dev , "Assuming a default substate order for this platform\n" );
1002+ dev_warn (& pmcdev -> pdev -> dev ,
1003+ "Assuming a default substate order for this platform\n" );
10041004
10051005 /*
10061006 * Loop through all modes from lowest to highest priority,
@@ -1250,7 +1250,6 @@ static int pmc_core_probe(struct platform_device *pdev)
12501250 }
12511251
12521252 pmcdev -> pmc_xram_read_bit = pmc_core_check_read_lock_bit (primary_pmc );
1253- pmc_core_get_low_power_modes (pdev );
12541253 pmc_core_do_dmi_quirks (primary_pmc );
12551254
12561255 pmc_core_dbgfs_register (pmcdev );
Original file line number Diff line number Diff line change @@ -490,6 +490,7 @@ extern int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value);
490490
491491int pmc_core_resume_common (struct pmc_dev * pmcdev );
492492int get_primary_reg_base (struct pmc * pmc );
493+ extern void pmc_core_get_low_power_modes (struct pmc_dev * pmcdev );
493494
494495extern void pmc_core_ssram_init (struct pmc_dev * pmcdev );
495496
Original file line number Diff line number Diff line change @@ -53,7 +53,15 @@ const struct pmc_reg_map icl_reg_map = {
5353int icl_core_init (struct pmc_dev * pmcdev )
5454{
5555 struct pmc * pmc = pmcdev -> pmcs [PMC_IDX_MAIN ];
56+ int ret ;
5657
5758 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 ;
5967}
Original file line number Diff line number Diff line change @@ -985,7 +985,7 @@ static int mtl_resume(struct pmc_dev *pmcdev)
985985int mtl_core_init (struct pmc_dev * pmcdev )
986986{
987987 struct pmc * pmc = pmcdev -> pmcs [PMC_IDX_SOC ];
988- int ret = 0 ;
988+ int ret ;
989989
990990 mtl_d3_fixup ();
991991
@@ -1002,6 +1002,8 @@ int mtl_core_init(struct pmc_dev *pmcdev)
10021002 return ret ;
10031003 }
10041004
1005+ pmc_core_get_low_power_modes (pmcdev );
1006+
10051007 /* Due to a hardware limitation, the GBE LTR blocks PC10
10061008 * when a cable is attached. Tell the PMC to ignore it.
10071009 */
Original file line number Diff line number Diff line change @@ -137,7 +137,15 @@ const struct pmc_reg_map spt_reg_map = {
137137int spt_core_init (struct pmc_dev * pmcdev )
138138{
139139 struct pmc * pmc = pmcdev -> pmcs [PMC_IDX_MAIN ];
140+ int ret ;
140141
141142 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 ;
143151}
Original file line number Diff line number Diff line change @@ -263,6 +263,7 @@ int tgl_core_init(struct pmc_dev *pmcdev)
263263 if (ret )
264264 return ret ;
265265
266+ pmc_core_get_low_power_modes (pmcdev );
266267 pmc_core_get_tgl_lpm_reqs (pmcdev -> pdev );
267268 /* Due to a hardware limitation, the GBE LTR blocks PC10
268269 * when a cable is attached. Tell the PMC to ignore it.
You can’t perform that action at this time.
0 commit comments