From: David Wang <davidwang@zhaoxin.com>
To: <jdelvare@suse.com>, <linux@roeck-us.net>, <tglx@linutronix.de>,
<mingo@redhat.com>, <rafel.j.wysocki@intel.com>,
<linux-hwmon@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <brucechang@via-alliance.com>, <cooperyan@zhaoxin.com>,
<qiyuanwang@zhaoxin.com>, <benjaminpan@viatech.com>,
<lukelin@viacpu.com>, <timguo@zhaoxin.com>,
David Wang <davidwang@zhaoxin.com>
Subject: [PATCH] hwmon, via-cputemp: support new centaur CPUs
Date: Thu, 29 Mar 2018 14:17:53 +0800 [thread overview]
Message-ID: <1522304273-17817-1-git-send-email-davidwang@zhaoxin.com> (raw)
Signed-off-by: David Wang <davidwang@zhaoxin.com>
---
drivers/hwmon/via-cputemp.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c
index 07a0cb0..aa0d040 100644
--- a/drivers/hwmon/via-cputemp.c
+++ b/drivers/hwmon/via-cputemp.c
@@ -136,6 +136,11 @@ static int via_cputemp_probe(struct platform_device *pdev)
data->id = pdev->id;
data->name = "via_cputemp";
+ if (c->x86_model == 7) {
+ data->msr_temp = 0x1423;
+ goto test_access;
+ }
+
switch (c->x86_model) {
case 0xA:
/* C7 A */
@@ -152,6 +157,7 @@ static int via_cputemp_probe(struct platform_device *pdev)
return -ENODEV;
}
+test_access:
/* test if we can access the TEMPERATURE MSR */
err = rdmsr_safe_on_cpu(data->id, data->msr_temp, &eax, &edx);
if (err) {
@@ -283,6 +289,7 @@ static int via_cputemp_down_prep(unsigned int cpu)
{ X86_VENDOR_CENTAUR, 6, 0xa, }, /* C7 A */
{ X86_VENDOR_CENTAUR, 6, 0xd, }, /* C7 D */
{ X86_VENDOR_CENTAUR, 6, 0xf, }, /* Nano */
+ { X86_VENDOR_CENTAUR, 7, X86_MODEL_ANY, },
{}
};
MODULE_DEVICE_TABLE(x86cpu, cputemp_ids);
--
1.9.1
reply other threads:[~2018-03-29 6:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1522304273-17817-1-git-send-email-davidwang@zhaoxin.com \
--to=davidwang@zhaoxin.com \
--cc=benjaminpan@viatech.com \
--cc=brucechang@via-alliance.com \
--cc=cooperyan@zhaoxin.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lukelin@viacpu.com \
--cc=mingo@redhat.com \
--cc=qiyuanwang@zhaoxin.com \
--cc=rafel.j.wysocki@intel.com \
--cc=tglx@linutronix.de \
--cc=timguo@zhaoxin.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
all inboxes | Powered by JetHome®