[10/11] platform/x86:intel/pmc: Move get_low_power_modes function
Commit Message
From: Xi Pardee <xi.pardee@intel.com>
Move the pmc_core_get_low_power_modes function call from probe to init
function. This is the preparation work for retrieving LPM information
using Intel PMT API patch as available low power modes need to be known.
Signed-off-by: Xi Pardee <xi.pardee@intel.com>
Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
drivers/platform/x86/intel/pmc/adl.c | 2 ++
drivers/platform/x86/intel/pmc/cnp.c | 2 ++
drivers/platform/x86/intel/pmc/core.c | 3 +--
drivers/platform/x86/intel/pmc/core.h | 1 +
drivers/platform/x86/intel/pmc/icl.c | 10 +++++++++-
drivers/platform/x86/intel/pmc/mtl.c | 2 ++
drivers/platform/x86/intel/pmc/spt.c | 10 +++++++++-
drivers/platform/x86/intel/pmc/tgl.c | 2 ++
8 files changed, 28 insertions(+), 4 deletions(-)
@@ -318,6 +318,8 @@ int adl_core_init(struct pmc_dev *pmcdev)
if (ret)
return ret;
+ pmc_core_get_low_power_modes(pmcdev->pdev);
+
/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
@@ -213,6 +213,8 @@ int cnp_core_init(struct pmc_dev *pmcdev)
if (ret)
return ret;
+ pmc_core_get_low_power_modes(pmcdev->pdev);
+
/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
@@ -898,7 +898,7 @@ static bool pmc_core_pri_verify(u32 lpm_pri, u8 *mode_order)
return true;
}
-static void pmc_core_get_low_power_modes(struct platform_device *pdev)
+void pmc_core_get_low_power_modes(struct platform_device *pdev)
{
struct pmc_dev *pmcdev = platform_get_drvdata(pdev);
u8 pri_order[LPM_MAX_NUM_MODES] = LPM_DEFAULT_PRI;
@@ -1155,7 +1155,6 @@ static int pmc_core_probe(struct platform_device *pdev)
}
pmcdev->pmc_xram_read_bit = pmc_core_check_read_lock_bit(pmcdev);
- pmc_core_get_low_power_modes(pdev);
pmc_core_do_dmi_quirks(pmcdev);
pmc_core_dbgfs_register(pmcdev);
@@ -398,6 +398,7 @@ extern const struct pmc_reg_map mtl_reg_map;
extern void pmc_core_get_tgl_lpm_reqs(struct platform_device *pdev);
extern int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value);
extern int get_primary_reg_base(struct pmc_dev *pmcdev);
+extern void pmc_core_get_low_power_modes(struct platform_device *pdev);
int spt_core_init(struct pmc_dev *pmcdev);
int cnp_core_init(struct pmc_dev *pmcdev);
@@ -52,6 +52,14 @@ const struct pmc_reg_map icl_reg_map = {
int icl_core_init(struct pmc_dev *pmcdev)
{
+ int ret;
+
pmcdev->map = &icl_reg_map;
- return get_primary_reg_base(pmcdev);
+ ret = get_primary_reg_base(pmcdev);
+ if (ret)
+ return ret;
+
+ pmc_core_get_low_power_modes(pmcdev->pdev);
+
+ return ret;
}
@@ -151,6 +151,8 @@ int mtl_core_init(struct pmc_dev *pmcdev)
mtl_pmc_ssram_init(pmcdev);
+ pmc_core_get_low_power_modes(pmcdev->pdev);
+
/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/
@@ -136,6 +136,14 @@ const struct pmc_reg_map spt_reg_map = {
int spt_core_init(struct pmc_dev *pmcdev)
{
+ int ret;
+
pmcdev->map = &spt_reg_map;
- return get_primary_reg_base(pmcdev);
+ ret = get_primary_reg_base(pmcdev);
+ if (ret)
+ return ret;
+
+ pmc_core_get_low_power_modes(pmcdev->pdev);
+
+ return ret;
}
@@ -261,7 +261,9 @@ int tgl_core_init(struct pmc_dev *pmcdev)
if (ret)
return ret;
+ pmc_core_get_low_power_modes(pmcdev->pdev);
pmc_core_get_tgl_lpm_reqs(pmcdev->pdev);
+
/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
*/