Received: by 10.213.65.68 with SMTP id h4csp1193416imn; Wed, 28 Mar 2018 23:20:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx48Sv05qNMkMwD2PXAe930BVkoAOH0p1o6iWLUZ2vpFT+wEw0l8tcLUyDj/Vg4LvqiCwBsYH X-Received: by 10.99.60.79 with SMTP id i15mr4517216pgn.399.1522304439993; Wed, 28 Mar 2018 23:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522304439; cv=none; d=google.com; s=arc-20160816; b=IiqQ3cmEJfgJs0kIosxz5SiAiXpYvHIOhdeqqZYtjud5I4/N0wobkJo+XTOY5Fchtn bPZGXJh9ZxkI5O5x1AU7TCwH8vGLjLDO9I09blJXZ5zTqS0OJVjGckOwhaOCv0Scj+wT GsTvPP8NqaDpc207swMm1GfANW1xb/p3t30ueIziwpfb+n1hy20weWVMEh8jyaOOPF84 ifMmhNdY0ePpo4tEH57ZzipdsWasW5LHmlNouALfAF+IiAw4hdK2CII1cNhX77xd1WX+ U34aShztkhuBXhAnv1k5CVno/v1+AVRd7dYJRr5w9iZgcrdf5+e+rpMl6KYrYpkm2EgN +pww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=4/DowzzFF6M3Myh6Zy7qoFlUwQrCSX/bF/2lc1bINhE=; b=ysr/BxoT6w7aWnOiMaqbeVc+bLrn5rHkLyhCyH8KuI19+OGYfozdFdFS5q+IOmU9Jp frirtJypyXWfmkAfahAZYB+dVfldXEIaD/4X5h+9T5s9kD//ALBS0T2H7n9oYXzK6cbf rrx2ZGjUHYPPlGkoBVgCExQedn3oB2FhZ55J+iG367Y1X8JOdcObZyjyVtIXkQMl6LZw foNLo6BHl+TYXwMeu8qq3VE0qXw6+tFM9YhQq9MF+CgNAupPygDWqGtIlmGbInVezgLX U+/+eUMDpFlg/ZfEULyOu6woQrwJ9HDGRWlWPINRotIuDwhtKpTbj78vk/kcLT5RgeBK zoBw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si4098274pfa.95.2018.03.28.23.20.25; Wed, 28 Mar 2018 23:20:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751114AbeC2GS1 (ORCPT + 99 others); Thu, 29 Mar 2018 02:18:27 -0400 Received: from zxshcas2.zhaoxin.com ([180.169.121.92]:11655 "EHLO ZXSHCAS2.zhaoxin.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750716AbeC2GS0 (ORCPT ); Thu, 29 Mar 2018 02:18:26 -0400 Received: from zxbjmbx3.zhaoxin.com (10.29.252.165) by ZXSHCAS2.zhaoxin.com (10.28.252.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Thu, 29 Mar 2018 14:18:22 +0800 Received: from timguo-System-Product-Name.zhaoxin.com (10.29.8.54) by zxbjmbx3.zhaoxin.com (10.29.252.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Thu, 29 Mar 2018 14:18:21 +0800 From: David Wang To: , , , , , , CC: , , , , , , David Wang Subject: [PATCH] hwmon, via-cputemp: support new centaur CPUs Date: Thu, 29 Mar 2018 14:17:53 +0800 Message-ID: <1522304273-17817-1-git-send-email-davidwang@zhaoxin.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.29.8.54] X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx3.zhaoxin.com (10.29.252.165) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: David Wang --- 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