public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] platform/x86/intel/pmc: Add resume_fixup callback
@ 2023-06-02 23:21 David E. Box
  2023-06-02 23:21 ` [PATCH 2/2] platform/x86/intel/pmc/mtl: Put devices in D3 during resume David E. Box
  0 siblings, 1 reply; 4+ messages in thread
From: David E. Box @ 2023-06-02 23:21 UTC (permalink / raw)
  To: irenic.rajneesh, david.e.box, hdegoede, markgross, ilpo.jarvinen
  Cc: platform-driver-x86, linux-kernel

Add a resume_fixup callback to perform platform specific fixups during
resume from suspend.

Signed-off-by: David E. Box <david.e.box@linux.intel.com>
---
 drivers/platform/x86/intel/pmc/core.c | 3 +++
 drivers/platform/x86/intel/pmc/core.h | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
index da6e7206d38b..0fcd1cb7264b 100644
--- a/drivers/platform/x86/intel/pmc/core.c
+++ b/drivers/platform/x86/intel/pmc/core.c
@@ -1229,6 +1229,9 @@ static __maybe_unused int pmc_core_resume(struct device *dev)
 	const struct pmc_bit_map **maps = pmcdev->map->lpm_sts;
 	int offset = pmcdev->map->lpm_status_offset;
 
+	if (pmcdev->resume_fixup)
+		pmcdev->resume_fixup();
+
 	/* Check if the syspend used S0ix */
 	if (pm_suspend_via_firmware())
 		return 0;
diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h
index 9ca9b9746719..b58458d00bd3 100644
--- a/drivers/platform/x86/intel/pmc/core.h
+++ b/drivers/platform/x86/intel/pmc/core.h
@@ -327,6 +327,7 @@ struct pmc_reg_map {
  * @lpm_en_modes:	Array of enabled modes from lowest to highest priority
  * @lpm_req_regs:	List of substate requirements
  * @core_configure:	Function pointer to configure the platform
+ * @resume_fixup:	Function to perform fixups during resume
  *
  * pmc_dev contains info about power management controller device.
  */
@@ -345,6 +346,7 @@ struct pmc_dev {
 	int lpm_en_modes[LPM_MAX_NUM_MODES];
 	u32 *lpm_req_regs;
 	void (*core_configure)(struct pmc_dev *pmcdev);
+	void (*resume_fixup)(void);
 };
 
 extern const struct pmc_bit_map msr_map[];
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-05 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-02 23:21 [PATCH 1/2] platform/x86/intel/pmc: Add resume_fixup callback David E. Box
2023-06-02 23:21 ` [PATCH 2/2] platform/x86/intel/pmc/mtl: Put devices in D3 during resume David E. Box
2023-06-05 11:59   ` Ilpo Järvinen
2023-06-05 14:52     ` David E. Box

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox