All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: "Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "open list:X86 PLATFORM DRIVERS"
	<platform-driver-x86@vger.kernel.org>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Goswami Sanket <Sanket.Goswami@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH 3/4] platform/x86/amd/pmc: Move keyboard wakeup disablement detection to pmc-quirks
Date: Mon, 11 Dec 2023 22:50:05 -0600	[thread overview]
Message-ID: <20231212045006.97581-4-mario.limonciello@amd.com> (raw)
In-Reply-To: <20231212045006.97581-1-mario.limonciello@amd.com>

Other platforms may need to disable keyboard wakeup besides Cezanne,
so move the detection into amd_pmc_quirks_init() where it may be applied
to multiple platforms.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/platform/x86/amd/pmc/pmc-quirks.c | 3 +++
 drivers/platform/x86/amd/pmc/pmc.c        | 2 +-
 drivers/platform/x86/amd/pmc/pmc.h        | 1 +
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/amd/pmc/pmc-quirks.c b/drivers/platform/x86/amd/pmc/pmc-quirks.c
index 6bbffb081053..c32046dfa960 100644
--- a/drivers/platform/x86/amd/pmc/pmc-quirks.c
+++ b/drivers/platform/x86/amd/pmc/pmc-quirks.c
@@ -235,6 +235,9 @@ void amd_pmc_quirks_init(struct amd_pmc_dev *dev)
 {
 	const struct dmi_system_id *dmi_id;
 
+	if (dev->cpu_id == AMD_CPU_ID_CZN)
+		dev->disable_8042_wakeup = true;
+
 	dmi_id = dmi_first_match(fwbug_list);
 	if (!dmi_id)
 		return;
diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
index 824673a8673e..864c8cc2f8a3 100644
--- a/drivers/platform/x86/amd/pmc/pmc.c
+++ b/drivers/platform/x86/amd/pmc/pmc.c
@@ -930,7 +930,7 @@ static int amd_pmc_suspend_handler(struct device *dev)
 {
 	struct amd_pmc_dev *pdev = dev_get_drvdata(dev);
 
-	if (pdev->cpu_id == AMD_CPU_ID_CZN && !disable_workarounds) {
+	if (pdev->disable_8042_wakeup && !disable_workarounds) {
 		int rc = amd_pmc_wa_irq1(pdev);
 
 		if (rc) {
diff --git a/drivers/platform/x86/amd/pmc/pmc.h b/drivers/platform/x86/amd/pmc/pmc.h
index a85c235247d3..b4794f118739 100644
--- a/drivers/platform/x86/amd/pmc/pmc.h
+++ b/drivers/platform/x86/amd/pmc/pmc.h
@@ -36,6 +36,7 @@ struct amd_pmc_dev {
 	struct mutex lock; /* generic mutex lock */
 	struct dentry *dbgfs_dir;
 	struct quirk_entry *quirks;
+	bool disable_8042_wakeup;
 };
 
 void amd_pmc_process_restore_quirks(struct amd_pmc_dev *dev);
-- 
2.34.1


  parent reply	other threads:[~2023-12-12 15:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12  4:50 [PATCH 0/4] Add a workaround for Framework 13 spurious IRQ1 Mario Limonciello
2023-12-12  4:50 ` [PATCH 1/4] platform/x86/amd/pmc: Move platform defines to header Mario Limonciello
2023-12-12  4:50 ` [PATCH 2/4] platform/x86/amd/pmc: Only run IRQ1 firmware version check on Cezanne Mario Limonciello
2023-12-18 12:59   ` Ilpo Järvinen
2023-12-18 13:01     ` Ilpo Järvinen
2023-12-12  4:50 ` Mario Limonciello [this message]
2023-12-12  4:50 ` [PATCH 4/4] platform/x86/amd/pmc: Disable keyboard wakeup on AMD Framework 13 Mario Limonciello
2023-12-12 20:19 ` [PATCH 0/4] Add a workaround for Framework 13 spurious IRQ1 Thomas Weißschuh
2023-12-18 12:11   ` Hans de Goede
2023-12-18 12:42     ` Ilpo Järvinen
2023-12-18 13:25       ` Hans de Goede
2023-12-18 13:10 ` Ilpo Järvinen

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=20231212045006.97581-4-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Sanket.Goswami@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.