From: "David E. Box" <david.e.box@linux.intel.com>
To: irenic.rajneesh@gmail.com, david.e.box@linux.intel.com,
hdegoede@redhat.com, markgross@kernel.org,
andy.shevchenko@gmail.com, rajvi.jingar@linux.intel.com,
xi.pardee@intel.com
Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org
Subject: [PATCH 10/11] platform/x86:intel/pmc: Move get_low_power_modes function
Date: Wed, 15 Mar 2023 11:34:04 -0700 [thread overview]
Message-ID: <20230315183405.2465630-11-david.e.box@linux.intel.com> (raw)
In-Reply-To: <20230315183405.2465630-1-david.e.box@linux.intel.com>
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(-)
diff --git a/drivers/platform/x86/intel/pmc/adl.c b/drivers/platform/x86/intel/pmc/adl.c
index a6ceaf520fd5..6101c9c2aa9c 100644
--- a/drivers/platform/x86/intel/pmc/adl.c
+++ b/drivers/platform/x86/intel/pmc/adl.c
@@ -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.
*/
diff --git a/drivers/platform/x86/intel/pmc/cnp.c b/drivers/platform/x86/intel/pmc/cnp.c
index fcd07a61f88d..68e7ac7f7a11 100644
--- a/drivers/platform/x86/intel/pmc/cnp.c
+++ b/drivers/platform/x86/intel/pmc/cnp.c
@@ -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.
*/
diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index 8f3a5a6fc874..3833ea4a758e 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -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);
diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h
index ba30db31f439..f4b69861c17b 100644
--- a/drivers/platform/x86/intel/pmc/core.h
+++ b/drivers/platform/x86/intel/pmc/core.h
@@ -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);
diff --git a/drivers/platform/x86/intel/pmc/icl.c b/drivers/platform/x86/intel/pmc/icl.c
index a671d7e86431..8315e6c90efa 100644
--- a/drivers/platform/x86/intel/pmc/icl.c
+++ b/drivers/platform/x86/intel/pmc/icl.c
@@ -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;
}
diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c
index 48c7ec094af8..74f1f4c44812 100644
--- a/drivers/platform/x86/intel/pmc/mtl.c
+++ b/drivers/platform/x86/intel/pmc/mtl.c
@@ -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.
*/
diff --git a/drivers/platform/x86/intel/pmc/spt.c b/drivers/platform/x86/intel/pmc/spt.c
index f34015692bb8..1f6bcd40ba76 100644
--- a/drivers/platform/x86/intel/pmc/spt.c
+++ b/drivers/platform/x86/intel/pmc/spt.c
@@ -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;
}
diff --git a/drivers/platform/x86/intel/pmc/tgl.c b/drivers/platform/x86/intel/pmc/tgl.c
index c69f2672fb92..05b7cc6f59a0 100644
--- a/drivers/platform/x86/intel/pmc/tgl.c
+++ b/drivers/platform/x86/intel/pmc/tgl.c
@@ -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.
*/
--
2.34.1
next prev parent reply other threads:[~2023-03-15 18:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-15 18:33 [PATCH 00/11] Intel pmc_core: Enable telemetry David E. Box
2023-03-15 18:33 ` [PATCH 01/11] platform/x86/intel/vsec: Add intel_vsec_register David E. Box
2023-03-15 18:33 ` [PATCH 02/11] platform/x86/intel/vsec: Explicitly enable capabilities David E. Box
2023-03-15 18:33 ` [PATCH 03/11] platform/x86/intel/vsec: Add base address field David E. Box
2023-03-15 18:33 ` [PATCH 04/11] platform/x86/intel/pmt: Add INTEL_PMT module namespace David E. Box
2023-03-15 18:33 ` [PATCH 05/11] platform/x86/intel/pmt: telemetry: Add telemetry read functions David E. Box
2023-03-15 18:34 ` [PATCH 06/11] platform/x86/intel/pmt/telemetry: Add driver version David E. Box
2023-03-15 18:34 ` [PATCH 07/11] platform/x86/intel/pmc: Alder Lake slp_s0_residency fix David E. Box
2023-03-15 18:34 ` [PATCH 08/11] platform/x86:intel/pmc: Combine core_init and core_configure function David E. Box
2023-03-15 18:34 ` [PATCH 09/11] platform/x86/intel/pmc: Add Intel PMT support for MTL PMC David E. Box
2023-03-15 18:34 ` David E. Box [this message]
2023-03-15 18:34 ` [PATCH 11/11] platform/x86/intel/pmc/mtl: get LPM information using Intel PMT David E. Box
2023-03-16 14:51 ` [PATCH 00/11] Intel pmc_core: Enable telemetry Hans de Goede
2023-03-16 15:36 ` David E. Box
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230315183405.2465630-11-david.e.box@linux.intel.com \
--to=david.e.box@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=hdegoede@redhat.com \
--cc=irenic.rajneesh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markgross@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=rajvi.jingar@linux.intel.com \
--cc=xi.pardee@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox