linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Huang Rui <ray.huang@amd.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>
Cc: "open list:AMD PSTATE DRIVER" <linux-pm@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH 3/3] cpufreq: amd-pstate: Add a module device table
Date: Fri, 25 Mar 2022 00:42:28 -0500	[thread overview]
Message-ID: <20220325054228.5247-4-mario.limonciello@amd.com> (raw)
In-Reply-To: <20220325054228.5247-1-mario.limonciello@amd.com>

`amd-pstate` currently only loads automatically if compiled into the
kernel.  To improve the usability, add a module device table that
will load when AMD CPUs that support CPPC are detected.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/cpufreq/amd-pstate.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 31a04e818195..44490292fa72 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -644,6 +644,12 @@ static void __exit amd_pstate_exit(void)
 	amd_pstate_enable(false);
 }
 
+static const struct x86_cpu_id __maybe_unused amd_pstate_ids[] = {
+	X86_MATCH_VENDOR_FEATURE(AMD, X86_FEATURE_CPPC, NULL),
+	{}
+};
+MODULE_DEVICE_TABLE(x86cpu, amd_pstate_ids);
+
 module_init(amd_pstate_init);
 module_exit(amd_pstate_exit);
 
-- 
2.34.1


  parent reply	other threads:[~2022-03-25  5:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25  5:42 [PATCH 0/3] Improve usability for amd-pstate Mario Limonciello
2022-03-25  5:42 ` [PATCH 1/3] cpufreq: Allow passing NULL as the argument for unregistering a driver Mario Limonciello
2022-03-27 13:23   ` Huang Rui
2022-03-25  5:42 ` [PATCH 2/3] cpufreq: amd-pstate: Allow replacing existing cpufreq drivers when loaded Mario Limonciello
2022-03-25  5:42 ` Mario Limonciello [this message]
2022-03-27 13:27   ` [PATCH 3/3] cpufreq: amd-pstate: Add a module device table Huang Rui
2022-03-27 11:56 ` [PATCH 0/3] Improve usability for amd-pstate Huang Rui
2022-03-28 22:14   ` Limonciello, Mario

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=20220325054228.5247-4-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=ray.huang@amd.com \
    --cc=viresh.kumar@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).